i3pyblocks.blocks.datetime

Blocks based on datetime.

Module Contents

Classes

DateTimeBlock

Block that shows date and time for current location.

class i3pyblocks.blocks.datetime.DateTimeBlock(format_date: str = '%D', format_time: str = '%T', sleep: int = 1, **kwargs)

Bases: i3pyblocks.blocks.PollingBlock

Block that shows date and time for current location.

This blocks alternates between Time and Date display by clicks in the Block. Keep in mind that format_date and format_time names are arbitrary and both formats have capacity to display both date and time.

Parameters
  • format_date – Format string when showing date. Uses strftime placeholders.

  • format_time – Format string when showing time. Uses strftime placeholders.

  • sleep – Sleep in seconds between each call to run(). If you’re not showing seconds in this block it makes sense to increase this value.

  • **kwargs – Extra arguments to be passed to PollingBlock class.

toggle_date_time(self) None
async click_handler(self, **_kwargs) None
async run(self) None