dirops_mod module

Module of one function: my_mkdir,which creates directories as needed.

class dirops_mod.ExistingDirs[source]

Bases: object

Keep track of directories seen recently, that we know (pre)exist.

add(path)[source]

Add path to list of dirs, keeping only the last self.limit_list entries.

exists(path)[source]

Test if a path is known to exist.

dirops_mod.get_path_parts(relative_path)[source]

Chop a (directory-containing) pathname into the directory leading up to it (dirname), and its final part (basename).

dirops_mod.my_mkdir(pathname)[source]

Create one or more directories specified by directory_list.

If pathname has [ ‘a’, ‘b’, ‘c’ ], then we create a/b/c. If pathname has ‘a/b/c’ then we create a/b/c

dirops_mod.prepend_dirs(path)[source]

Take a relative path and add dir- prefixes to all the directories.

dirops_mod.strip_dirs(pathname)[source]

Strip off all the dir- prefixes.