Пример #1
0
    def render(self):
        if self.data.config.testing_mode:
            debug.info("Rendering in Testing Mode")
            while True:
                Seriesticker(self.data, self.matrix, self.sleepEvent).render()
                data.refresh.daily(self.data)
                self.sleepEvent.wait(1)
                debug.info("Testing Mode Refresh")

        while self.data.network_issues:
            Clock(self.data, self.matrix, self.sleepEvent, duration=60)
            self.data.refresh_data()

        while True:
            try:
                debug.info('Rendering...')

                if self.status.is_offseason(self.data.date()):
                    # Offseason (Show offseason related stuff)
                    debug.info("It's offseason")
                    self.__render_offday()
                elif self.data.config.testScChampions:
                    self.test_stanley_cup_champion(
                        self.data.config.testScChampions)

                else:
                    # Season.
                    if not self.data.config.live_mode:
                        debug.info(
                            "Live mode is off. Going through the boards")
                        self.__render_offday()
                    elif self.data.is_pref_team_offday():
                        debug.info("Your preferred teams are Off today")
                        self.__render_offday()
                    elif self.data.is_nhl_offday():
                        debug.info("There is no game in the NHL today")
                        self.__render_offday()
                    else:
                        debug.info("Game Day Wooooo")
                        self.__render_game_day()

                self.data.refresh_data()

            except AttributeError as e:
                debug.log(f"ERROR WHILE RENDERING: {e}")
                debug.log("Refreshing data in a minute")
                self.boards.fallback(self.data, self.matrix, self.sleepEvent)
                self.data.refresh_data()
Пример #2
0
 def seriesticker(self, data, matrix, sleepEvent):
     '''
         forcing it to show since the playoff start and regular season end are in conflict for 2021
     '''
     Seriesticker(data, matrix, sleepEvent).render()
     '''if data.status.is_playoff(data.today, data.playoffs):
Пример #3
0
 def seriesticker(self, data, matrix, sleepEvent):
     if data.status.is_playoff(data.today, data.playoffs):
         Seriesticker(data, matrix, sleepEvent).render()