Directory

class cgp_generic_utils.files.Directory(path)

Bases: cgp_generic_utils.files.Path

directory object that manipulates a directory on the file system

baseName()

the baseName of the directory

Returns:the baseName of the directory
Return type:str
content(fileFilters=None, fileExtensions=None, fileExtensionsIncluded=True)

content of the directory

Parameters:
  • fileFilters (list[str]) – filter of the directory children - default is cgp_generic_utils.constants.FileFilter.ALL
  • fileExtensions (list[str]) – extensions of the files to get - default is all extensions
  • fileExtensionsIncluded (bool) – True : file extensions are included - False : file extensions are excluded
Returns:

the content of the directory

Return type:

list[cgp_generic_utils.files.Directory, cgp_generic_utils.files.File, cgp_generic_utils.files.JsonFile, cgp_generic_utils.files.PyFile, cgp_generic_utils.files.TxtFile, cgp_generic_utils.files.UiFile]

classmethod create(path, **__)
Parameters:path (str) – path of the file to create
Returns:the created directory
Return type:cgp_generic_utils.files.Directory