Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
cake-bot
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Oleksandr Barabash
cake-bot
Commits
5f9b368e
Commit
5f9b368e
authored
Jan 31, 2023
by
Oleksandr Barabash
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
additional logs added
parent
cd77923c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
2 deletions
+9
-2
messaging_extension_action_preview_bot.py
bots/messaging_extension_action_preview_bot.py
+6
-0
log.py
utils/log.py
+3
-2
No files found.
bots/messaging_extension_action_preview_bot.py
View file @
5f9b368e
""" Message extension bot """
""" Message extension bot """
import
asyncio
import
asyncio
import
logging
import
sys
import
sys
import
time
import
time
import
uuid
import
uuid
...
@@ -32,6 +33,7 @@ from utils.functions import get_i18n
...
@@ -32,6 +33,7 @@ from utils.functions import get_i18n
from
utils.log
import
Log
from
utils.log
import
Log
log
=
logging
.
getLogger
()
TAG
=
__name__
TAG
=
__name__
...
@@ -246,10 +248,12 @@ class TeamsMessagingExtensionsActionPreviewBot(TeamsActivityHandler):
...
@@ -246,10 +248,12 @@ class TeamsMessagingExtensionsActionPreviewBot(TeamsActivityHandler):
async
def
handle_submit_action
(
self
,
turn_context
:
TurnContext
)
->
None
:
async
def
handle_submit_action
(
self
,
turn_context
:
TurnContext
)
->
None
:
""" Handle card submit action """
""" Handle card submit action """
log
.
info
(
"executing handle_submit_action"
)
i18n
=
get_i18n
(
turn_context
)
i18n
=
get_i18n
(
turn_context
)
mx
=
self
.
get_mx
(
turn_context
)
mx
=
self
.
get_mx
(
turn_context
)
if
mx
.
type
==
MXTypes
.
ACKNOWLEDGE
:
if
mx
.
type
==
MXTypes
.
ACKNOWLEDGE
:
log
.
info
(
"submit action is mx type"
)
try
:
try
:
account
=
turn_context
.
activity
.
from_property
account
=
turn_context
.
activity
.
from_property
ack_objects
=
await
self
.
cosmos_client
.
get_acknowledge_items
(
ack_objects
=
await
self
.
cosmos_client
.
get_acknowledge_items
(
...
@@ -276,6 +280,7 @@ class TeamsMessagingExtensionsActionPreviewBot(TeamsActivityHandler):
...
@@ -276,6 +280,7 @@ class TeamsMessagingExtensionsActionPreviewBot(TeamsActivityHandler):
# DO NOTHING, Notification not found!
# DO NOTHING, Notification not found!
pass
pass
return
return
log
.
info
(
"unsupported submit type"
)
await
turn_context
.
send_activity
(
i18n
.
t
(
"unknown_request"
))
await
turn_context
.
send_activity
(
i18n
.
t
(
"unknown_request"
))
async
def
on_message_activity
(
self
,
turn_context
:
TurnContext
)
->
None
:
async
def
on_message_activity
(
self
,
turn_context
:
TurnContext
)
->
None
:
...
@@ -293,6 +298,7 @@ class TeamsMessagingExtensionsActionPreviewBot(TeamsActivityHandler):
...
@@ -293,6 +298,7 @@ class TeamsMessagingExtensionsActionPreviewBot(TeamsActivityHandler):
)
)
if
turn_context
.
activity
.
value
is
not
None
:
if
turn_context
.
activity
.
value
is
not
None
:
log
.
info
(
"activity.value is not none, handling submit action"
)
return
await
self
.
handle_submit_action
(
turn_context
)
return
await
self
.
handle_submit_action
(
turn_context
)
""" DATA STRUCTURE:
""" DATA STRUCTURE:
...
...
utils/log.py
View file @
5f9b368e
...
@@ -6,8 +6,9 @@ import logging
...
@@ -6,8 +6,9 @@ import logging
def
init_logging
(
filename
=
None
,
level
=
None
):
def
init_logging
(
filename
=
None
,
level
=
None
):
""" init logging on the app level """
""" init logging on the app level """
logging_config
=
{
"format"
:
"
%(asctime)-23
s
%(levelname)8
s::
%(filename)
s::"
logging_config
=
{
"format"
:
"
%(asctime)-23
s
%(levelname)8
s::"
"
%(funcName)
s:
%(message)
s"
,
"
%(name)
s::
%(funcName)
s:"
"
%(message)
s"
,
"level"
:
level
or
logging
.
DEBUG
}
"level"
:
level
or
logging
.
DEBUG
}
if
filename
is
not
None
:
if
filename
is
not
None
:
logging_config
[
"filename"
]
=
filename
logging_config
[
"filename"
]
=
filename
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment