Beispiel #1
0
    def __init__(self, filename):
        self.filename = filename

        self.database = db.Database(self.filename)
        self.database.close()

        self.settings = Config()

        self.label = self.settings.label
        self.time = datetimeutil.time_to_local(self.settings.time)
        self.date = datetimeutil.date_to_local(self.settings.date)
        self.command = self.settings.command
        self.notes = ""
        self.popup = self.settings.popup
        self.dialog = self.settings.dialog
        self.boxcar = self.settings.boxcar_notify
        self.boxcar_ok = self.settings.boxcar_token != ''
        self.pushbullet_api_key = self.settings.pushbullet_api_key
        self.pushbullet_device = self.settings.pushbullet_device
        self.pushbullet_devices = self.settings.pushbullet_devices
        self.pushbullet_ok = self.settings.pushbullet_api_key != ''
        self.pushbullet_device_index = self.get_pushbullet_index()
        self.sound_file = self.settings.sound_file
        self.sound_length = self.settings.sound_play_length
        self.sound_loop = self.settings.sound_loop
        self.sound_loop_times = self.settings.sound_loop_times

        self.time_format = self.settings.time_format
        self.date_format = self.settings.date_format

        self.play_sound = False
        if self.sound_file is not None and not self.sound_file == "":
            self.play_sound = True
Beispiel #2
0
    def build_time(self, index, once_s, every, from_s, to_s):
        value = ""
        if index == 0:
            value = once_s
        elif index == 1 or index == 2:
            value = "every "
            value += str(int(every)) #int() to get rid of possible double

            if index == 1:
                value += " minutes"
            else: #elif index == 2:
                value += " hours"

            if from_s != "" and to_s != "":
                value += " from " + from_s
                value += " to " + to_s

        return datetimeutil.time_to_local(value)