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
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)
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)
def show_ref_sections(prefix): write(defaults.get_sections(prefix)) sys.exit(0)
def show_ref_file(): write(defaults.REF_FILE) sys.exit(0)