Exemplo n.º 1
0
    def _make_label(interval, refyear, month, day, rstartH, rstartM,
                rendH, rendM, ralarmH, ralarmM, rendn, rendu,
                ralarmn, ralarmu, endtype, alarmtype, fend, palarm, standard):
        label = 'Occur on {} {} at {}:{} ({}) every {} years (e.g. {})'.format(
                                day, DateHourCtrl.compute_month_label(month),
                                str(rstartH).zfill(2), str(rstartM).zfill(2),
                                standard, interval, refyear)

        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
Exemplo n.º 2
0
    def _make_label(interval, refyear, month, day, rstartH, rstartM, rendH,
                    rendM, ralarmH, ralarmM, rendn, rendu, ralarmn, ralarmu,
                    endtype, alarmtype, fend, palarm, standard):
        label = 'Occur on {} {} at {}:{} ({}) every {} years (e.g. {})'.format(
            day, DateHourCtrl.compute_month_label(month),
            str(rstartH).zfill(2),
            str(rstartM).zfill(2), standard, interval, refyear)

        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