ksconf.util package

Submodules

ksconf.util.compare module

ksconf.util.compare.file_compare(fn1, fn2)
ksconf.util.compare.fileobj_compare(f1, f2)

ksconf.util.completers module

ksconf.util.completers.DirectoriesCompleter(*args, **kwargs)
ksconf.util.completers.FilesCompleter(*args, **kwargs)
ksconf.util.completers.autocomplete(*args, **kwargs)

ksconf.util.file module

ksconf.util.file.dir_exists(directory)

Ensure that the directory exists

ksconf.util.file.file_fingerprint(path, compare_to=None)
ksconf.util.file.file_hash(path, algorithm='sha256')
ksconf.util.file.match_bwlist(value, bwlist, escape=True)
ksconf.util.file.relwalk(top, topdown=True, onerror=None, followlinks=False)

Relative path walker Like os.walk() except that it doesn’t include the “top” prefix in the resulting ‘dirpath’.

ksconf.util.file.smart_copy(src, dest)

Copy (overwrite) file only if the contents have changed.

ksconf.util.terminal module

ksconf.util.terminal.tty_color(stream, *codes)

Module contents

ksconf.util.debug_traceback()

If the ‘KSCONF_DEBUG’ environmental variable is set, then show a stack trace.