Пример #1
0
def msg(
    body: Any,
    message_type: MessageType = MessageType.INFO,
    debug: bool = False,
):
    if verbose or not debug:
        style_print(_msg_format(body), style=message_type.value)
Пример #2
0
def msg(
    body: Any,
    message_type: MessageType = MessageType.INFO,
    debug: bool = False,
):
    if debug and not verbose:
        return
    if no_style:
        print(_msg_format(body))
    else:
        style_print(_msg_format(body), style=message_type.value)
Пример #3
0
 async def draw_live(self):
     remaining = 0
     while True:
         if remaining == 0:
             remaining = self.settings.refresh
             await self.draw()
             self._draw_buffer += 3
         else:
             erase_lines(3)
             remaining -= 1
         style_print(f"\nrefreshing in {remaining}", style="cyan")
         style_print("press CTRL-C to quit", style="cyan")
         await asyncio.sleep(1)
Пример #4
0
 async def draw_live(self):
     remaining = 0
     try:
         while True:
             if remaining == 0:
                 remaining = self.settings.refresh
                 await self.draw()
                 self._draw_buffer += 3
             else:
                 erase_lines(3)
                 remaining -= 1
             style_print(f"\nrefreshing in {remaining}", style="cyan")
             style_print("press CTRL-C to quit", style="cyan")
             sleep(1)
     except KeyboardInterrupt:
         pass