Exemplo n.º 1
0
    def command_delayed(self, args):
        if args is None:
            return
        delay_str, txt = args
        delay = common.parse_str_to_secs(delay_str)
        if not delay_str:
            return

        tab = self.api.current_tab()
        timed_event = timed_events.DelayedEvent(delay, self.say, (tab, txt))
        self.api.add_timed_event(timed_event)
Exemplo n.º 2
0
    def command_delayed(self, arg):
        args = common.shell_split(arg)
        if len(args) != 2:
            return
        delay = common.parse_str_to_secs(args[0])
        if not delay:
            return

        tab = self.core.current_tab()
        timed_event = timed_events.DelayedEvent(delay, self.say, (tab, args[1]))
        self.core.add_timed_event(timed_event)
Exemplo n.º 3
0
    def command_delayed(self, args):
        if args is None:
            return
        delay_str, txt = args
        delay = common.parse_str_to_secs(delay_str)
        if not delay_str:
            return

        tab = self.api.current_tab()
        timed_event = timed_events.DelayedEvent(delay, self.say, (tab, txt))
        self.api.add_timed_event(timed_event)
Exemplo n.º 4
0
    def command_delayed(self, arg):
        args = common.shell_split(arg)
        if len(args) != 2:
            return
        delay = common.parse_str_to_secs(args[0])
        if not delay:
            return

        tab = self.api.current_tab()
        timed_event = timed_events.DelayedEvent(delay, self.say,
                                                (tab, args[1]))
        self.api.add_timed_event(timed_event)
Exemplo n.º 5
0
    def command_remind(self, arg):
        args = common.shell_split(arg)
        if len(args) < 2:
            return
        time = common.parse_str_to_secs(args[0])
        if not time:
            return

        self.tasks[self.count] = (time, args[1])
        timed_event = timed_events.DelayedEvent(time, self.remind, self.count)
        self.api.add_timed_event(timed_event)
        self.api.information('Task %s added: %s every %s.' % (self.count, args[1],
            common.parse_secs_to_str(time)), 'Info')
        self.count += 1
Exemplo n.º 6
0
    def command_remind(self, arg):
        args = common.shell_split(arg)
        if len(args) < 2:
            return
        time = common.parse_str_to_secs(args[0])
        if not time:
            return

        self.tasks[self.count] = (time, args[1])
        timed_event = timed_events.DelayedEvent(time, self.remind, self.count)
        self.api.add_timed_event(timed_event)
        self.api.information(
            'Task %s added: %s every %s.' %
            (self.count, args[1], common.parse_secs_to_str(time)), 'Info')
        self.count += 1
Exemplo n.º 7
0
def test_parse_str_to_secs():
    assert parse_str_to_secs("1d3m1h") == 90180
    assert parse_str_to_secs("1d3mfaiiiiil") == 0
Exemplo n.º 8
0
def test_parse_str_to_secs():
    assert parse_str_to_secs("1d3m1h") == 90180
    assert parse_str_to_secs("1d3mfaiiiiil") == 0