Пример #1
0
    def apply_rule(self, filename, id_):
        values = self.ui.get_values()
        refstart = values['start_unix_time']
        endtype = values['end_type']
        rend = values['end_relative_time']
        rendn = values['end_relative_number']
        rendu = values['end_relative_unit']
        alarmtype = values['alarm_type']
        ralarm = values['alarm_relative_time']
        ralarmn = values['alarm_relative_number']
        ralarmu = values['alarm_relative_unit']
        standard = values['time_standard']

        try:
            if standard == 'UTC':
                ruled = organism_basicrules_api.make_occur_regularly_rule_UTC(
                    refstart, 2551443, rend, ralarm,
                    ('sy', endtype, alarmtype))
            else:
                ruled = organism_basicrules_api.make_occur_regularly_rule_local(
                    refstart, 2551443, rend, ralarm,
                    ('sy', endtype, alarmtype))
        except organism_basicrules_api.BadRuleError:
            msgboxes.warn_bad_rule(msgboxes.end_time).ShowModal()
        else:
            label = self._make_label(refstart, rend, ralarm, endtype,
                                     alarmtype, rendn, rendu, ralarmn, ralarmu,
                                     standard)
            wxscheduler_api.apply_rule(filename, id_, ruled, label)
Пример #2
0
    def apply_rule(self, filename, id_):
        values = self.ui.get_values()
        refstart = values['start_unix_time']
        endtype = values['end_type']
        rend = values['end_relative_time']
        rendn = values['end_relative_number']
        rendu = values['end_relative_unit']
        alarmtype = values['alarm_type']
        ralarm = values['alarm_relative_time']
        ralarmn = values['alarm_relative_number']
        ralarmu = values['alarm_relative_unit']
        standard = values['time_standard']

        try:
            if standard == 'UTC':
                ruled = organism_basicrules_api.make_occur_regularly_rule_UTC(
                  refstart, 2551443, rend, ralarm, ('sy', endtype, alarmtype))
            else:
                ruled = organism_basicrules_api.make_occur_regularly_rule_local(
                  refstart, 2551443, rend, ralarm, ('sy', endtype, alarmtype))
        except organism_basicrules_api.BadRuleError:
            msgboxes.warn_bad_rule(msgboxes.end_time).ShowModal()
        else:
            label = self._make_label(refstart, rend, ralarm, endtype,
                        alarmtype, rendn, rendu, ralarmn, ralarmu, standard)
            wxscheduler_api.apply_rule(filename, id_, ruled, label)
Пример #3
0
    def apply_rule(self, filename, id_):
        values = self.ui.get_values()
        refstart = values['start_unix_time']
        interval = values['interval']
        intervaln = values['interval_number']
        intervalu = values['interval_unit']
        endtype = values['end_type']
        rend = values['end_relative_time']
        rendn = values['end_relative_number']
        rendu = values['end_relative_unit']
        inclusive = values['inclusive']
        standard = values['time_standard']

        try:
            if standard == 'UTC':
                ruled = organism_basicrules_api.make_except_regularly_rule_UTC(
                              refstart, interval, rend, inclusive, (endtype, ))
            else:
                ruled = organism_basicrules_api.make_except_regularly_rule_local(
                              refstart, interval, rend, inclusive, (endtype, ))
        except organism_basicrules_api.BadRuleError:
            msgboxes.warn_bad_rule(msgboxes.end_time).ShowModal()
        else:
            label = self._make_label(intervaln, intervalu, refstart, rend,
                                    inclusive, endtype, rendn, rendu, standard)
            wxscheduler_api.apply_rule(filename, id_, ruled, label)
Пример #4
0
    def apply_rule(self, filename, id_):
        values = self.ui.get_values()
        rstartd = values["start_day"]
        rstartH = values["start_hour"]
        rstartM = values["start_minute"]
        endtype = values["end_type"]
        rend = values["end_relative_time"]
        fend = values["end_next_day"]
        rendn = values["end_relative_number"]
        rendu = values["end_relative_unit"]
        rendH = values["end_hour"]
        rendM = values["end_minute"]
        alarmtype = values["alarm_type"]
        ralarm = values["alarm_relative_time"]
        palarm = values["alarm_previous_day"]
        ralarmn = values["alarm_relative_number"]
        ralarmu = values["alarm_relative_unit"]
        ralarmH = values["alarm_hour"]
        ralarmM = values["alarm_minute"]
        standard = values["time_standard"]

        smonths = range(1, 13)

        try:
            if standard == "UTC":
                ruled = organism_basicrules_api.make_occur_monthly_number_direct_rule_UTC(
                    smonths, rstartd, rstartH, rstartM, rend, ralarm, ("1m", endtype, alarmtype)
                )
            else:
                ruled = organism_basicrules_api.make_occur_monthly_number_direct_rule_local(
                    smonths, rstartd, rstartH, rstartM, rend, ralarm, ("1m", endtype, alarmtype)
                )
        except organism_basicrules_api.BadRuleError:
            msgboxes.warn_bad_rule(msgboxes.generic).ShowModal()
        else:
            label = self._make_label(
                rstartd,
                rstartH,
                rstartM,
                rendH,
                rendM,
                ralarmH,
                ralarmM,
                rendn,
                rendu,
                ralarmn,
                ralarmu,
                endtype,
                alarmtype,
                fend,
                palarm,
                standard,
            )
            wxscheduler_api.apply_rule(filename, id_, ruled, label)
Пример #5
0
    def apply_rule(self, filename, id_):
        values = self.ui.get_values()
        sdays = values['selected_weekdays']
        rstart = values['start_relative_time']
        rstartH = values['start_hour']
        rstartM = values['start_minute']
        endtype = values['end_type']
        rend = values['end_relative_time']
        fend = values['end_next_day']
        rendn = values['end_relative_number']
        rendu = values['end_relative_unit']
        rendH = values['end_hour']
        rendM = values['end_minute']
        alarmtype = values['alarm_type']
        ralarm = values['alarm_relative_time']
        palarm = values['alarm_previous_day']
        ralarmn = values['alarm_relative_number']
        ralarmu = values['alarm_relative_unit']
        ralarmH = values['alarm_hour']
        ralarmM = values['alarm_minute']
        standard = values['time_standard']

        rstarts = [(d - sdays[0]) * 86400 for d in sdays]

        refstart = (int(_time.time()) // 604800 * 7 + 3 + sdays[0]) * 86400 + \
                                                                        rstart

        try:
            if standard == 'UTC':
                ruled = organism_basicrules_api.make_occur_regularly_group_rule_UTC(
                    refstart, 604800, rstarts, rend, ralarm,
                    ('sw', endtype, alarmtype))
            else:
                ruled = organism_basicrules_api.make_occur_regularly_group_rule_local(
                    refstart, 604800, rstarts, rend, ralarm,
                    ('sw', endtype, alarmtype))
        except organism_basicrules_api.BadRuleError:
            msgboxes.warn_bad_rule(msgboxes.generic).ShowModal()
        else:
            label = self._make_label(sdays, rstartH, rstartM, rendH, rendM,
                                     ralarmH, ralarmM, rendn, rendu, ralarmn,
                                     ralarmu, endtype, alarmtype, fend, palarm,
                                     standard)
            wxscheduler_api.apply_rule(filename, id_, ruled, label)
Пример #6
0
    def apply_rule(self, filename, id_):
        values = self.ui.get_values()
        sdays = values['selected_weekdays']
        rstart = values['start_relative_time']
        rstartH = values['start_hour']
        rstartM = values['start_minute']
        endtype = values['end_type']
        rend = values['end_relative_time']
        fend = values['end_next_day']
        rendn = values['end_relative_number']
        rendu = values['end_relative_unit']
        rendH = values['end_hour']
        rendM = values['end_minute']
        alarmtype = values['alarm_type']
        ralarm = values['alarm_relative_time']
        palarm = values['alarm_previous_day']
        ralarmn = values['alarm_relative_number']
        ralarmu = values['alarm_relative_unit']
        ralarmH = values['alarm_hour']
        ralarmM = values['alarm_minute']
        standard = values['time_standard']

        rstarts = [(d - sdays[0]) * 86400 for d in sdays]

        refstart = (int(_time.time()) // 604800 * 7 + 3 + sdays[0]) * 86400 + \
                                                                        rstart

        try:
            if standard == 'UTC':
                ruled = organism_basicrules_api.make_occur_regularly_group_rule_UTC(
                                    refstart, 604800, rstarts, rend, ralarm,
                                    ('sw', endtype, alarmtype))
            else:
                ruled = organism_basicrules_api.make_occur_regularly_group_rule_local(
                                    refstart, 604800, rstarts, rend, ralarm,
                                    ('sw', endtype, alarmtype))
        except organism_basicrules_api.BadRuleError:
            msgboxes.warn_bad_rule(msgboxes.generic).ShowModal()
        else:
            label = self._make_label(sdays, rstartH, rstartM, rendH, rendM,
                        ralarmH, ralarmM, rendn, rendu, ralarmn,
                        ralarmu, endtype, alarmtype, fend, palarm, standard)
            wxscheduler_api.apply_rule(filename, id_, ruled, label)
Пример #7
0
    def apply_rule(self, filename, id_):
        values = self.ui.get_values()
        refstart = values['start_unix_time']
        refyear = values['start_year']
        month = values['start_month'] + 1
        day = values['start_day']
        rstartH = values['start_hour']
        rstartM = values['start_minute']
        interval = values['interval_years']
        endtype = values['end_type']
        rend = values['end_relative_time']
        fend = values['end_next_day']
        rendn = values['end_relative_number']
        rendu = values['end_relative_unit']
        rendH = values['end_hour']
        rendM = values['end_minute']
        alarmtype = values['alarm_type']
        ralarm = values['alarm_relative_time']
        palarm = values['alarm_previous_day']
        ralarmn = values['alarm_relative_number']
        ralarmu = values['alarm_relative_unit']
        ralarmH = values['alarm_hour']
        ralarmM = values['alarm_minute']
        standard = values['time_standard']

        try:
            if standard == 'UTC':
                ruled = organism_basicrules_api.make_occur_yearly_rule_UTC(
                            interval, refyear, month, day, rstartH, rstartM,
                            rend, ralarm, (endtype, alarmtype))
            else:
                ruled = organism_basicrules_api.make_occur_yearly_rule_local(
                            interval, refyear, month, day, rstartH, rstartM,
                            rend, ralarm, (endtype, alarmtype))
        except organism_basicrules_api.BadRuleError:
            msgboxes.warn_bad_rule(msgboxes.generic).ShowModal()
        else:
            label = self._make_label(interval, refyear, month, day, rstartH,
                                    rstartM, rendH, rendM, ralarmH, ralarmM,
                                    rendn, rendu, ralarmn, ralarmu, endtype,
                                    alarmtype, fend, palarm, standard)
            wxscheduler_api.apply_rule(filename, id_, ruled, label)
    def apply_rule(self, filename, id_):
        values = self.ui.get_values()
        rstartn = values['start_weekday_number']
        rstartA = values['start_weekday']
        weekday = values['start_weekday_index']
        rstartH = values['start_hour']
        rstartM = values['start_minute']
        endtype = values['end_type']
        rend = values['end_relative_time']
        fend = values['end_next_day']
        rendn = values['end_relative_number']
        rendu = values['end_relative_unit']
        rendH = values['end_hour']
        rendM = values['end_minute']
        alarmtype = values['alarm_type']
        ralarm = values['alarm_relative_time']
        palarm = values['alarm_previous_day']
        ralarmn = values['alarm_relative_number']
        ralarmu = values['alarm_relative_unit']
        ralarmH = values['alarm_hour']
        ralarmM = values['alarm_minute']
        standard = values['time_standard']

        smonths = range(1, 13)

        try:
            if standard == 'UTC':
                ruled = organism_basicrules_api.make_occur_monthly_weekday_direct_rule_UTC(
                    smonths, weekday, rstartn, rstartH, rstartM, rend, ralarm,
                    ('1m', endtype, alarmtype))
            else:
                ruled = organism_basicrules_api.make_occur_monthly_weekday_direct_rule_local(
                    smonths, weekday, rstartn, rstartH, rstartM, rend, ralarm,
                    ('1m', endtype, alarmtype))
        except organism_basicrules_api.BadRuleError:
            msgboxes.warn_bad_rule(msgboxes.generic).ShowModal()
        else:
            label = self._make_label(rstartn, rstartA, rstartH, rstartM, rendH,
                                     rendM, ralarmH, ralarmM, rendn, rendu,
                                     ralarmn, ralarmu, endtype, alarmtype,
                                     fend, palarm, standard)
            wxscheduler_api.apply_rule(filename, id_, ruled, label)
Пример #9
0
    def apply_rule(self, filename, id_):
        values = self.ui.get_values()
        refstart = values['start_unix_time']
        refyear = values['start_year']
        month = values['start_month'] + 1
        day = values['start_day']
        rstartH = values['start_hour']
        rstartM = values['start_minute']
        interval = values['interval_years']
        endtype = values['end_type']
        rend = values['end_relative_time']
        fend = values['end_next_day']
        rendn = values['end_relative_number']
        rendu = values['end_relative_unit']
        rendH = values['end_hour']
        rendM = values['end_minute']
        alarmtype = values['alarm_type']
        ralarm = values['alarm_relative_time']
        palarm = values['alarm_previous_day']
        ralarmn = values['alarm_relative_number']
        ralarmu = values['alarm_relative_unit']
        ralarmH = values['alarm_hour']
        ralarmM = values['alarm_minute']
        standard = values['time_standard']

        try:
            if standard == 'UTC':
                ruled = organism_basicrules_api.make_occur_yearly_rule_UTC(
                    interval, refyear, month, day, rstartH, rstartM, rend,
                    ralarm, (endtype, alarmtype))
            else:
                ruled = organism_basicrules_api.make_occur_yearly_rule_local(
                    interval, refyear, month, day, rstartH, rstartM, rend,
                    ralarm, (endtype, alarmtype))
        except organism_basicrules_api.BadRuleError:
            msgboxes.warn_bad_rule(msgboxes.generic).ShowModal()
        else:
            label = self._make_label(interval, refyear, month, day, rstartH,
                                     rstartM, rendH, rendM, ralarmH, ralarmM,
                                     rendn, rendu, ralarmn, ralarmu, endtype,
                                     alarmtype, fend, palarm, standard)
            wxscheduler_api.apply_rule(filename, id_, ruled, label)
Пример #10
0
    def apply_rule(self, filename, id_):
        values = self.ui.get_values()
        rstartn = values['start_weekday_number']
        rstartA = values['start_weekday']
        weekday = values['start_weekday_index']
        rstartH = values['start_hour']
        rstartM = values['start_minute']
        endtype = values['end_type']
        rend = values['end_relative_time']
        fend = values['end_next_day']
        rendn = values['end_relative_number']
        rendu = values['end_relative_unit']
        rendH = values['end_hour']
        rendM = values['end_minute']
        alarmtype = values['alarm_type']
        ralarm = values['alarm_relative_time']
        palarm = values['alarm_previous_day']
        ralarmn = values['alarm_relative_number']
        ralarmu = values['alarm_relative_unit']
        ralarmH = values['alarm_hour']
        ralarmM = values['alarm_minute']
        standard = values['time_standard']

        smonths = range(1, 13)

        try:
            if standard == 'UTC':
                ruled = organism_basicrules_api.make_occur_monthly_weekday_direct_rule_UTC(
                                smonths, weekday, rstartn, rstartH, rstartM,
                                rend, ralarm, ('1m', endtype, alarmtype))
            else:
                ruled = organism_basicrules_api.make_occur_monthly_weekday_direct_rule_local(
                                smonths, weekday, rstartn, rstartH, rstartM,
                                rend, ralarm, ('1m', endtype, alarmtype))
        except organism_basicrules_api.BadRuleError:
            msgboxes.warn_bad_rule(msgboxes.generic).ShowModal()
        else:
            label = self._make_label(rstartn, rstartA, rstartH, rstartM, rendH,
                    rendM, ralarmH, ralarmM, rendn, rendu, ralarmn, ralarmu,
                    endtype, alarmtype, fend, palarm, standard)
            wxscheduler_api.apply_rule(filename, id_, ruled, label)
Пример #11
0
    def apply_rule(self, filename, id_):
        values = self.ui.get_values()
        smonths = values['selected_months']
        rstartid = values['start_day']
        rstartH = values['start_hour']
        rstartM = values['start_minute']
        endtype = values['end_type']
        rend = values['end_relative_time']
        fend = values['end_next_day']
        rendn = values['end_relative_number']
        rendu = values['end_relative_unit']
        rendH = values['end_hour']
        rendM = values['end_minute']
        alarmtype = values['alarm_type']
        ralarm = values['alarm_relative_time']
        palarm = values['alarm_previous_day']
        ralarmn = values['alarm_relative_number']
        ralarmu = values['alarm_relative_unit']
        ralarmH = values['alarm_hour']
        ralarmM = values['alarm_minute']
        standard = values['time_standard']

        try:
            if standard == 'UTC':
                ruled = organism_basicrules_api.make_occur_monthly_number_inverse_rule_UTC(
                    smonths, rstartid, rstartH, rstartM, rend, ralarm,
                    (None, endtype, alarmtype))
            else:
                ruled = organism_basicrules_api.make_occur_monthly_number_inverse_rule_local(
                    smonths, rstartid, rstartH, rstartM, rend, ralarm,
                    (None, endtype, alarmtype))
        except organism_basicrules_api.BadRuleError:
            msgboxes.warn_bad_rule(msgboxes.short_months).ShowModal()
        else:
            label = self._make_label(smonths, rstartid, rstartH, rstartM,
                                     rendH, rendM, ralarmH, ralarmM, rendn,
                                     rendu, ralarmn, ralarmu, endtype,
                                     alarmtype, fend, palarm, standard)
            wxscheduler_api.apply_rule(filename, id_, ruled, label)
    def apply_rule(self, filename, id_):
        values = self.ui.get_values()
        smonths = values['selected_months']
        rstartid = values['start_day']
        rstartH = values['start_hour']
        rstartM = values['start_minute']
        endtype = values['end_type']
        rend = values['end_relative_time']
        fend = values['end_next_day']
        rendn = values['end_relative_number']
        rendu = values['end_relative_unit']
        rendH = values['end_hour']
        rendM = values['end_minute']
        alarmtype = values['alarm_type']
        ralarm = values['alarm_relative_time']
        palarm = values['alarm_previous_day']
        ralarmn = values['alarm_relative_number']
        ralarmu = values['alarm_relative_unit']
        ralarmH = values['alarm_hour']
        ralarmM = values['alarm_minute']
        standard = values['time_standard']

        try:
            if standard == 'UTC':
                ruled = organism_basicrules_api.make_occur_monthly_number_inverse_rule_UTC(
                             smonths, rstartid, rstartH, rstartM, rend, ralarm,
                             (None, endtype, alarmtype))
            else:
                ruled = organism_basicrules_api.make_occur_monthly_number_inverse_rule_local(
                             smonths, rstartid, rstartH, rstartM, rend, ralarm,
                             (None, endtype, alarmtype))
        except organism_basicrules_api.BadRuleError:
            msgboxes.warn_bad_rule(msgboxes.short_months).ShowModal()
        else:
            label = self._make_label(smonths, rstartid, rstartH, rstartM,
                        rendH, rendM, ralarmH, ralarmM, rendn, rendu, ralarmn,
                        ralarmu, endtype, alarmtype, fend, palarm, standard)
            wxscheduler_api.apply_rule(filename, id_, ruled, label)