Add docstring

This commit is contained in:
Labrys of Knossos 2019-01-15 17:35:41 -05:00
commit 7185e0b31b

View file

@ -37,6 +37,13 @@ class WorkingDirectory(object):
def module_path(module=__file__, parent=False):
"""
Detect path for a module.
:param module: The module who's path is being detected. Defaults to current module.
:param parent: True to return the parent folder of the current module.
:return: The absolute normalized path to the module or its parent.
"""
try:
path = module.__file__
except AttributeError:
@ -122,6 +129,12 @@ def clean_folders(*paths):
def force_clean_folder(path, required):
"""
Force clean a folder and exclude any required subfolders.
:param path: Target folder to remove subfolders
:param required: Keep only the required subfolders
"""
root, dirs, files = next(os.walk(path))
required = sorted(required)
if required: