예제 #1
0
def repeat(m):
    repeat_count = m_to_number(m)

    if repeat_count != None and repeat_count >= 2:
        repeater = Rep(repeat_count - 1)
        repeater.ctx = talon
        return repeater(None)
예제 #2
0
 def repeat(self):
     repeater = Rep(1)
     repeater.ctx = talon
     repeater(None)
     if self.job:
         self.job = cron.after(self.repeat_delay, self.repeat)
         print('REPEAT')
예제 #3
0
def repeat(m):
    repeat_count = parse_words_as_integer(m._words[1:])

    if repeat_count != None and repeat_count >= 2:
        repeater = Rep(repeat_count - 1)
        repeater.ctx = talon
        return repeater(None)
예제 #4
0
def repeat(m):
    repeat_count = parse_words_as_integer(m._words[1:])
    print(talon.last)

    if repeat_count is not None and repeat_count >= 2:
        repeater = Rep(repeat_count - 1)
        repeater.ctx = talon
        return repeater(None)
예제 #5
0
def repeat(m):
    # repeater = Rep(int(ordinals[str(m)]))
    o = m.ordinals
    if isinstance(o, list):
        o = o[0]
    repeater = Rep(int(ordinals[o]))
    repeater.ctx = talon
    return repeater(None)
예제 #6
0
def repeat(m):
    # TODO: This could be made more intelligent:
    #         * Apply a timeout after which the command will not repeat previous actions
    #         * Prevent stacking of repetitions upon previous repetitions
    repeat_count = utils.m_to_number(m)

    if repeat_count != None and repeat_count >= 2:
        repeater = Rep(repeat_count - 1)
        repeater.ctx = talon
        return repeater(None)
예제 #7
0
def repeat(m):

    words = m._words

    repeat_count = text_to_number(words[1:])
    print("Repeat! {} {}".format([str(w) for w in words], repeat_count))
    if not repeat_count:
        repeat_count = 1
    repeater = Rep(repeat_count)
    repeater.ctx = m.ctx
    return repeater(None)
예제 #8
0
def repeat(m):
    # TODO: This could be made more intelligent:
    #         * Apply a timeout after which the command will not repeat previous actions
    #         * Prevent stacking of repetitions upon previous repetitions
    repeat_count = utils.extract_num_from_m(m)

    if repeat_count is not None:
        if repeat_count >= 2:
            repeat_count -= 1
        repeater = Rep(repeat_count)
        repeater.ctx = talon
        return repeater(None)
예제 #9
0
def repeat(m):

    # noinspection PyProtectedMember
    words = m._words

    repeat_count = text_to_number(words[1:])
    print("Repeat! {} {}".format([str(w) for w in words], repeat_count))
    if not repeat_count:
        repeat_count = 1
    repeater = Rep(repeat_count)
    repeater.ctx = talon
    result = repeater(None)
    print(f"Result: {result}")
    return result
예제 #10
0
def repeat(m):
    # TODO: This could be made more intelligent:
    #         * Apply a timeout after which the command will not repeat previous actions
    #         * Prevent stacking of repetitions upon previous repetitions
    starts_with_wink = m._words[0] == 'wink'
    if starts_with_wink and len(m._words) == 1:
        repeat_count = 1
    else:
        repeat_count = utils.extract_num_from_m(m)

    if repeat_count is not None:
        # for integrated repeats, need to subtract the first execution
        # "enter five times" will execute enter once and only then repeat, so need to subtract
        if not starts_with_wink and repeat_count >= 2:
            repeat_count -= 1

        repeater = Rep(repeat_count)
        repeater.ctx = talon
        return repeater(None)
예제 #11
0
def repeat_delay(n, delay=0.09):
    for i in range(n):
        sleep(delay)
        repeater = Rep(i - 1)
        repeater.ctx = talon
        repeater(None)
예제 #12
0
def repeat(m):
    o = m["repeater.ordinals"][0]
    repeater = Rep(int(ordinals[o]))
    repeater.ctx = talon
    return repeater(None)