Skip to content

Instantly share code, notes, and snippets.

@andriyshevchenko
Created September 27, 2024 14:33
Show Gist options
  • Save andriyshevchenko/f2961e6913eca07a54d2d5612dd6dbaa to your computer and use it in GitHub Desktop.
Save andriyshevchenko/f2961e6913eca07a54d2d5612dd6dbaa to your computer and use it in GitHub Desktop.
class BtnLogged(Button):
def __init__(self, native: Native, journal: Journal):
self.native = native
self.journal = journal
self.message = StrFormatted(
StrLiteral("Clicking button %s"),
StrNativeDesc(native)
)
self.level = LvlDefault(logging.DEBUG)
async def click(self):
await asyncio.gather(
self.journal.write(self.message, self.level),
self.native.click(),
return_exceptions=False,
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment