Ejemplo n.º 1
0
 def activate_table(self):
     if get_timetable_settings()["activated"]:
         if self.table_process is None:
             self.table_process = subprocess.Popen(args=self.table_cmd, shell=True)
     else:
         if self.table_process is not None:
             self.reset()
Ejemplo n.º 2
0
 def activate_table(self):
     if get_timetable_settings()["activated"]:
         if self.table_process is None:
             self.table_process = subprocess.Popen(args=self.table_cmd,
                                                   shell=True)
     else:
         if self.table_process is not None:
             self.reset()
Ejemplo n.º 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]
Ejemplo n.º 4
0
def retrieve_icals():
    """
    Writes formatted icals to files. Raises value error if url invalid.

    :raises ValueError
    """
    _settings = get_timetable_settings()

    #try:
    #    main_ical = tools.download_ical(_settings["main_url"])
    #    _write_to_main_ical(main_ical)
    #except ValueError:
    #    raise Exception("Main URL faulty, problem in programming.")

    if _settings["user_url"] != "":
        try:
            user_ical = tools.download_ical(_settings["user_url"])
            _write_to_user_ical(user_ical)
        except ValueError:
            raise Exception("Invalid URL! Please check URL.")
    else:
        raise Exception("There doesn't seem to be a URL configured.")
Ejemplo n.º 5
0
def retrieve_icals():
    """
    Writes formatted icals to files. Raises value error if url invalid.

    :raises ValueError
    """
    _settings = get_timetable_settings()

    #try:
    #    main_ical = tools.download_ical(_settings["main_url"])
    #    _write_to_main_ical(main_ical)
    #except ValueError:
    #    raise Exception("Main URL faulty, problem in programming.")

    if _settings["user_url"] != "":
        try:
            user_ical = tools.download_ical(_settings["user_url"])
            _write_to_user_ical(user_ical)
        except ValueError:
            raise Exception("Invalid URL! Please check URL.")
    else:
        raise Exception("There doesn't seem to be a URL configured.")