コード例 #1
0
def clock(operation, prefix, *args, **kwargs):
    if verbose:
        if show_timings:
            write('{0} '.format(prefix))
            go = time.time()
        else:
            write_line(prefix)
    result = operation(*args, **kwargs)
    if verbose and show_timings:
        notify('({0:0.2f}s)'.format(time.time() - go))
    return result
コード例 #2
0
ファイル: skool2html.py プロジェクト: Wolfe-Lyon/skoolkit
def clock(operation, prefix, *args, **kwargs):
    if verbose:
        if show_timings:
            write('{0} '.format(prefix))
            go = time.time()
        else:
            write_line(prefix)
    result = operation(*args, **kwargs)
    if verbose and show_timings:
        notify('({0:0.2f}s)'.format(time.time() - go))
    return result
コード例 #3
0
ファイル: skool2html.py プロジェクト: Wolfe-Lyon/skoolkit
def show_search_dirs():
    write(SEARCH_DIRS_MSG)
    prefix = '- '
    write_line(prefix + 'The directory that contains the skool or ref file named on the command line')
    for search_dir in SEARCH_DIRS:
        if not search_dir:
            search_dir = 'The current working directory'
        elif not os.path.split(search_dir)[0]:
            search_dir = os.path.join('.', search_dir)
        else:
            search_dir = os.path.normpath(search_dir)
        write_line(prefix + search_dir)
    write_line(prefix + 'Any other directories specified by the -S/--search option')
    sys.exit(0)
コード例 #4
0
def show_search_dirs():
    write(SEARCH_DIRS_MSG)
    prefix = '- '
    write_line(prefix + 'The directory that contains the skool file named on the command line')
    for search_dir in SEARCH_DIRS:
        if not search_dir:
            search_dir = 'The current working directory'
        elif not os.path.split(search_dir)[0]:
            search_dir = os.path.join('.', search_dir)
        else:
            search_dir = os.path.normpath(search_dir)
        write_line(prefix + search_dir)
    write_line(prefix + 'Any other directories specified by the -S/--search option')
    sys.exit(0)
コード例 #5
0
def show_ref_sections(prefix):
    write(defaults.get_sections(prefix))
    sys.exit(0)
コード例 #6
0
def show_ref_file():
    write(defaults.REF_FILE)
    sys.exit(0)
コード例 #7
0
ファイル: skool2html.py プロジェクト: Wolfe-Lyon/skoolkit
def show_ref_sections(prefix):
    write(defaults.get_sections(prefix))
    sys.exit(0)
コード例 #8
0
ファイル: skool2html.py プロジェクト: Wolfe-Lyon/skoolkit
def show_ref_file():
    write(defaults.REF_FILE)
    sys.exit(0)