def run(self): while True: if terminate: config.update("running", False) break if not config.is_scheduled(): config.update("running", False) break editable = config.get_config() theme = config.get("theme") if should_be_light(): if theme == "light": time.sleep(30) continue else: switch_to_light() else: if theme == "dark": time.sleep(30) continue else: switch_to_dark() time.sleep(30)
def sync_with_config(self): # sets the scheduled button to be enabled or disabled if config.is_scheduled(): self.ui.schedule_radio.setChecked(True) self.ui.dark_time.setEnabled(True) self.ui.light_time.setEnabled(True) yin_yang.start_daemon() # sets the correct time based on config self.set_correct_time() # setting the correct buttons based on config "dark" "light" self.set_correct_buttons()