def activate_rings(self):
     if get_time_manager_settings()["activated"]:
         if self.rings_process is None:
             self.rings_process = subprocess.Popen(args=self.rings_cmd, shell=True)
     else:
         if self.rings_process is not None:
             self.reset()
Beispiel #2
0
 def activate_rings(self):
     if get_time_manager_settings()["activated"]:
         if self.rings_process is None:
             self.rings_process = subprocess.Popen(args=self.rings_cmd,
                                                   shell=True)
     else:
         if self.rings_process is not None:
             self.reset()
Beispiel #3
0
def get_state(sub_menu):
    """
    :return The state of a plugin
    :rtype bool
    """
    key = "activated"
    states = {TimetableSubMenu.__name__: settings.get_timetable_settings()[key],
              MailSubMenu.__name__: settings.get_email_settings()[key],
              NotificationSubMenu.__name__: settings.get_notification_settings()[key],
              TimeManagerSubMenu.__name__: settings.get_time_manager_settings()[key]}
    return states[sub_menu]
 def run(self):
     """
     As long as _exit_thread is false, this objects instance will stay active. When it's true, the instance will
     become inactive and should be left for garbage collection by removing all references to it.
     """
     start_time = datetime.now()
     new_activity = Activity(self._type_of_activity, start_time, datetime.now(), self._time)
     dbc.add_to_db(new_activity)
     while not self._exit_thread and settings.get_time_manager_settings()["activated"]:
         sleep(1)
         self.sub_menu_reference._display_label = converting.sec_to_time(self._time)
         self._time += 1
         dbc.update_last_activity(start_time=start_time, end_time=datetime.now())
Beispiel #5
0
 def run(self):
     """
     As long as _exit_thread is false, this objects instance will stay active. When it's true, the instance will
     become inactive and should be left for garbage collection by removing all references to it.
     """
     start_time = datetime.now()
     new_activity = Activity(self._type_of_activity, start_time,
                             datetime.now(), self._time)
     dbc.add_to_db(new_activity)
     while not self._exit_thread and settings.get_time_manager_settings(
     )["activated"]:
         sleep(1)
         self.sub_menu_reference._display_label = converting.sec_to_time(
             self._time)
         self._time += 1
         dbc.update_last_activity(start_time=start_time,
                                  end_time=datetime.now())