Пример #1
0
    def _make_label(rstartin, rstartA, rstartH, rstartM, rendH, rendM, ralarmH,
                                ralarmM, rendn, rendu, ralarmn, ralarmu,
                                endtype, alarmtype, fend, palarm, standard):
        label = 'Occur on the {} {} of every month at {}:{} ({})'.format(
                    MonthInverseWeekdayHourCtrl.compute_weekday_number_label(
                                                            rstartin), rstartA,
                    str(rstartH).zfill(2), str(rstartM).zfill(2), standard)

        if endtype == 1:
            label += ' for {} {}'.format(rendn, rendu)
        elif endtype == 2:
            label += ' until {}:{}'.format(str(rendH).zfill(2),
                                                           str(rendM).zfill(2))
            if fend:
                label += ' of the following day'

        if alarmtype == 1:
            label += ', activate alarm {} {} before'.format(ralarmn, ralarmu)
        elif alarmtype == 2:
            label += ', activate alarm at {}:{}'.format(
                                  str(ralarmH).zfill(2), str(ralarmM).zfill(2))
            if palarm:
                label += ' of the previous day'

        return label