예제 #1
0
 def _set_clock_font(self):
     log_fw.debug(
         f"Setting font {config.FONTS[self.font_index][0]} x{config.FONTS[self.font_index][1]}"
     )
     try:
         self.font = ImageFont.truetype(
             f"./fonts/{config.FONTS[self.font_index][0]}",
             floor(config.CLOCK_FONT_SIZE *
                   config.FONTS[self.font_index][1]))
     except OSError as err:
         log_fw.exception(
             f"Error while opening font: {err.filename}, {err.filename2}: {err.strerror} {err.errno}"
         )
예제 #2
0
파일: saat.py 프로젝트: lemehmet/gunes-saat
    def __init__(self):
        log_fw.debug("Initializing")
        display.OledDisplay.__init__(self)
        clock_view = ClockView(display=self)
        moving_ball = MovingBall(display=self)
        rico_ball = RicoBall(display=self)

        rico_ball.set_right(clock_view)
        clock_view.set_left(rico_ball)
        clock_view.set_right(moving_ball)
        moving_ball.set_left(clock_view)
        moving_ball.set_right(rico_ball)

        self.vm.set_root_view(rico_ball)
        # TODO: Invoke the current view's initialize
        self.vm.paint()
        log_fw.debug("Issued initial paint")
예제 #3
0
 def on_sched_event(self):
     log_fw.debug("View::on_sched_event()")
예제 #4
0
 def on_sched_event(self):
     log_fw.debug("ClockView::on_sched_event()")
     clock_text = self._clock_text()
     if clock_text != self.last_clock_text:
         self.paint()
예제 #5
0
 def on_sched_event(self):
     log_fw.debug("MovingBall::on_sched_event()")
     self.paint()
예제 #6
0
 def on_sched_event(self):
     log_fw.debug("DiagnosticLine::on_sched_event()")
     self.paint()
예제 #7
0
 def on_sched_event(self):
     log_fw.debug("RicoBall::on_sched_event()")
     self._move_ball()
     self.paint()
예제 #8
0
 def on_sched_event(self):
     log_fw.debug("TextView::on_sched_event()")
     self.paint()