common#

pydarkstar.common.create_path(*args, absolute=True, dt_fmt='%Y_%m_%d_%H_%M_%S', dt=None, **kwargs)[source]#

Construct a path. You can access dt or datetime as objects.

Parameters
  • args – path components passed to os.path.join()

  • absolute (bool) – make path absolute

  • dt (datetime.datetime) – datetime object

  • dt_fmt (str) – date format

  • kwargs – variables passed to str.format()

pydarkstar.common.backup(path, copy=False)[source]#

Create backup file name.

Parameters
  • path – path of file

  • copy – perform copy file

pydarkstar.common.find_files(top, regex='.*', r=False, ignorecase=True, **kwargs)[source]#

Search for files that match pattern.

Parameters
  • ignorecase – ignore case in regular expression

  • top – top level directory

  • regex – pattern to match

  • r – recursive search