def __init__(self, **kwargs): super(MatchScreen, self).__init__(**kwargs) self.score_objects = [self.ids.labelHome, self.ids.labelAway] self.set_title('Spiel') self.score_touch = None self.start_time = 0.0 self.stop_time = 0.0 self.timer_event = None self.submit_success = None self.thread = None self.__reset() NetworkInfo.register(self.__callback_check_failed_submission)
def __init__(self, **kwargs): super(BackgroundScreenManager, self).__init__(**kwargs) #self.transition = FadeTransition(duration=0.2) self.transition = NoTransition() # setup hardware listener self.hwlistener = HardwareListener() Clock.schedule_interval(self.callback, 1/30.0) # setup network status NetworkInfo.start_polling() # setup screens self.add_widget(MenuScreen(name='menu')) self.add_widget(RfidSetupScreen(name='rfid-setup')) self.add_widget(SettingsScreen(name='settings')) self.add_widget(LineupScreen(name='lineup')) self.add_widget(MatchScreen(name='match'))
def refresh(): diskspace = humanize.naturalsize(disk_usage('/').free, binary=True) battery_pct = int(sensors_battery().percent) battery_status = "charging" if sensors_battery( ).power_plugged else "discharging" date = datetime.now().strftime('%d/%m %H:%M:%S') network_info = NetworkInfo.update() content = f"\N{globe with meridians} {network_info.summary} | \U0001F50B {battery_pct}% {battery_status} | \N{floppy disk} {diskspace} avail. | \U0001F55E {date}" stdout.write(f"{content}\n") stdout.flush()
def __init__(self, **kwargs): super(BackgroundScreenManager, self).__init__(**kwargs) self.transition = FadeTransition(duration=0.2) # setup hardware listener self.hwlistener = HardwareListener() self.hwlistener.register(self.receive_msg) # setup network status NetworkInfo.start_polling() # setup screens self.add_widget(MenuScreen(name='menu')) self.add_widget(RfidSetupScreen(name='rfid-setup')) self.add_widget(SettingsScreen(name='settings')) self.add_widget(LoungeScreen(name='lounge')) self.add_widget(MatchScreen(name='match')) SoundManager.play(Trigger.INTRO)
def network_info_pressed(self): NetworkInfo.say_connection_status()
def __init__(self, **kwargs): super(MenuScreen, self).__init__(**kwargs) # initial fade in self.fadeopacity = 0.0 NetworkInfo.register(self.__update_network_info)
def __init__(self, **kwargs): super(BaseScreen, self).__init__(**kwargs) NetworkInfo.register(self.__update_network_info)
def __network_btn_long_press(self, dt): self.network_btn_long_press = True NetworkInfo.reconnect()
def __init__(self, **kwargs): super(MenuScreen, self).__init__(**kwargs) # initial fade in self.fadeopacity = 0.0 NetworkInfo.register(self.__update_network_info) SoundManager.play(Trigger.INTRO)
def network_btn_pressed(self): if not self.network_btn_long_press: NetworkInfo.say_connection_status() else: self.network_btn_long_press = False