Parameterize duration, pprint msg

offline_dark_clearing
Tyler Goodlet 2022-10-05 14:26:20 -04:00
parent 3924c66bd0
commit 26d6e10ad7
2 changed files with 7 additions and 4 deletions

View File

@ -49,10 +49,13 @@ class Struct(
hasattr(sys, 'ps1') hasattr(sys, 'ps1')
# TODO: check if we're in pdb # TODO: check if we're in pdb
): ):
return f'Struct({pformat(self.to_dict())})' return self.pformat()
return super().__repr__() return super().__repr__()
def pformat(self) -> str:
return f'Struct({pformat(self.to_dict())})'
def copy( def copy(
self, self,
update: Optional[dict] = None, update: Optional[dict] = None,

View File

@ -37,8 +37,8 @@ _dbus_uid: Optional[str] = ''
async def notify_from_ems_status_msg( async def notify_from_ems_status_msg(
uuid: str,
msg: Status, msg: Status,
duration: int = 3000,
is_subproc: bool = False, is_subproc: bool = False,
) -> None: ) -> None:
@ -84,12 +84,12 @@ async def notify_from_ems_status_msg(
[ [
'notify-send', 'notify-send',
'-u', 'normal', '-u', 'normal',
'-t', '1616', '-t', f'{duration}',
'piker', 'piker',
# TODO: add in standard fill/exec info that maybe we # TODO: add in standard fill/exec info that maybe we
# pack in a broker independent way? # pack in a broker independent way?
f"'{msg.resp}: {msg.req.price}'", f"'{msg.pformat()}'",
], ],
) )
log.runtime(result) log.runtime(result)