package documentation
(source)

Module which contains all classes to deal with the filesystem
Module base Base classes for filesystem and storage implementation
Module helpers Helper classes for file system related functions
Module local Local file system object
Module mock Mock objects for file system classes

From __init__.py:

Function cleanup_filename No summary
Function format_file_size No summary
Function localFileOrFolder Convenience method that resolves a local File or Folder object
Constant FS_CASE_SENSITIVE Undocumented
Constant FS_SUPPORT_NON_LOCAL_FILE_SHARES Undocumented
Variable logger Undocumented
logger = (source)

Undocumented

FS_CASE_SENSITIVE = (source)

Undocumented

Value
not ((os.name == 'nt') or (sys.platform == 'darwin'))
FS_SUPPORT_NON_LOCAL_FILE_SHARES = (source)

Undocumented

Value
(os.name == 'nt')
def localFileOrFolder(path, pwd=None): (source)

Convenience method that resolves a local File or Folder object

If the path is a string and ends with either "/" or "\" it is interpreted as user input and a LocalFolder object will be returned. Else the function will try to sort out whether the path is a file or a folder by checking on disk. This requires the object to exist.

NOTE: for consistency, this function only returns objects for existing files or folders, else it raises FileNotFoundError

Parameters
pathfile path as a string, FilePath object, or list of path elements
pwdworking directory as a string, needed to allow relative paths
def cleanup_filename(name): (source)
Removes all characters in 'name' that are not allowed as part of a file name. This function is intended for e.g. config files etc. not for page files in a store. For file system filenames we can not use: '\', '/', ':', '*', '?', '"', '<', '>', '|' And we also exclude "\t" and "\n".
Parameters
namethe filename as string
Returns
the name with invalid characters removed
def format_file_size(bytes): (source)
Returns a human readable label for a file size E.g. 1230 becomes "1.23kb", idem for "Mb" and "Gb"
Parameters
bytesfile size in bytes as integer
Returns
size as string