Пример #1
0
def detach_tab_parse(func: str, rest: str) -> FuncArgsType:
    if rest not in ('new', 'ask'):
        log_error(f'Ignoring invalid detach_tab argument: {rest}')
        rest = 'new'
    return func, (rest,)
Пример #2
0
 def abort() -> None:
     log_error(f'Symbol map: {val} is invalid, ignoring')
Пример #3
0
 def abort(msg: str) -> None:
     log_error('Send text: {} is invalid ({}), ignoring'.format(
         val, msg))
Пример #4
0
def set_colors(func: str, rest: str) -> FuncArgsType:
    import shlex
    r = shlex.split(rest)
    if len(r) < 1:
        log_error('Too few arguments to set_colors function')
    return func, r
Пример #5
0
def remote_control(func: str, rest: str) -> FuncArgsType:
    func, args = shlex_parse(func, rest)
    if len(args) < 1:
        log_error('Too few arguments to remote_control function')
    return func, args
Пример #6
0
def detach_window_parse(func: str, rest: str) -> FuncArgsType:
    if rest not in ('new', 'new-tab', 'ask', 'tab-prev', 'tab-left',
                    'tab-right'):
        log_error(f'Ignoring invalid detach_window argument: {rest}')
        rest = 'new'
    return func, (rest, )
Пример #7
0
 def abort(msg: str) -> None:
     log_error(f'Send text: {val} is invalid ({msg}), ignoring')
Пример #8
0
 def abort() -> Dict[Tuple[int, int], str]:
     log_error(f'Symbol map: {val} is invalid, ignoring')
Пример #9
0
def remote_control(func: str, rest: str) -> FuncArgsType:
    import shlex
    r = shlex.split(rest)
    if len(r) < 1:
        log_error('Too few arguments to remote_control function')
    return func, r
Пример #10
0
def detach_window_parse(func: str, rest: str) -> FuncArgsType:
    if rest not in ('new', 'new-tab', 'ask'):
        log_error('Ignoring invalid detach_window argument: {}'.format(rest))
        rest = 'new'
    return func, (rest, )
Пример #11
0
 def dl(f: UnderlineCallback, *a: Any) -> None:
     try:
         f(ans, cell_width, *a)
     except Exception as e:
         log_error(f'Failed to render {f.__name__} at cell_width={cell_width} and cell_height={cell_height} with error: {e}')
Пример #12
0
 def dl(f: UnderlineCallback, *a: Any) -> None:
     try:
         f(ans, cell_width, *a)
     except Exception as e:
         log_error('Failed to render {} at cell_width={} and cell_height={} with error: {}'.format(
             f.__name__, cell_width, cell_height, e))