Exemplo n.º 1
0
def dueDateCompleter(cmd, text, line, begidx, endidx):
    position = computeCompleteParameterPosition(text, line, begidx, endidx)
    if position == 1:  # Task id
        return taskIdCompleter(cmd, text, line, begidx, endidx)
    elif position == 2 and not text.startswith("+"):  # week day
        return [
            str(x) for x in list(WEEKDAYS.keys())
            if str(x).lower().startswith(text.lower())
        ]
Exemplo n.º 2
0
def recurrenceCompleter(cmd, text, line, begidx, endidx):
    frequencies = [x.lower() for x in FREQUENCIES.values()] + ["none"]
    weekdays = [x.lower() for x in WEEKDAYS.keys()]

    position = computeCompleteParameterPosition(text, line, begidx, endidx)
    if position == 1:  # Task id
        return taskIdCompleter(cmd, text, line, begidx, endidx)
    elif position == 2:  # frequency
        return [x for x in frequencies if x.startswith(text.lower())]
    elif position == 3 and "weekly" in line.lower():
        return [x for x in weekdays if x.startswith(text.lower())]
Exemplo n.º 3
0
def recurrenceCompleter(cmd, text, line, begidx, endidx):
    frequencies = [x.lower() for x in FREQUENCIES.values()] + ["none"]
    weekdays = [x.lower() for x in WEEKDAYS.keys()]

    position = computeCompleteParameterPosition(text, line, begidx, endidx)
    if position == 1:  # Task id
        return taskIdCompleter(cmd, text, line, begidx, endidx)
    elif position == 2:  # frequency
        return [x for x in frequencies if x.startswith(text.lower())]
    elif position == 3 and "weekly" in line.lower():
        return [x for x in weekdays if x.startswith(text.lower())]
Exemplo n.º 4
0
def dueDateCompleter(cmd, text, line, begidx, endidx):
    position = computeCompleteParameterPosition(text, line, begidx, endidx)
    if position == 1:  # Task id
        return taskIdCompleter(cmd, text, line, begidx, endidx)
    elif position == 2 and not text.startswith("+"):  # week day
        return [str(x) for x in list(WEEKDAYS.keys()) if str(x).lower().startswith(text.lower())]