class documentation

class Folder(FSObjectBase): (source)

Known subclasses: zim.newfs.mock.MockFolder

View In Hierarchy

Base class for folder implementations. Cannot be intatiated directly; use one of the subclasses instead. Main use outside of this module is to check isinstance(object, Folder).
Method __init__ Undocumented
Method __iter__ Undocumented
Method child Undocumented
Method file Undocumented
Method folder Undocumented
Method list_files Undocumented
Method list_folders Undocumented
Method list_names Undocumented
Method new_file No summary
Method new_folder No summary
Method remove_children Recursively remove everything below this folder .
Method walk Undocumented
Method _copyto Undocumented
Method _new_child Undocumented
Method _object_iter Undocumented

Inherited from FSObjectBase:

Method copyto Undocumented
Method ctime Undocumented
Method exists Undocumented
Method isequal No summary
Method iswritable Undocumented
Method moveto Undocumented
Method mtime Undocumented
Method parent Undocumented
Method remove Undocumented
Method touch Undocumented
Instance Variable watcher Undocumented
Method _cleanup Undocumented
Method _moveto Undocumented
Method _set_mtime Undocumented

Inherited from FilePath (via FSObjectBase):

Class Method new_from_zim_config Returns a new object based on the string representation for that path
Method __eq__ Undocumented
Method __repr__ Undocumented
Method __str__ Undocumented
Method commonparent Undocumented
Method get_abspath No summary
Method get_childpath Undocumented
Method ischild Undocumented
Method parents Undocumented
Method relpath Undocumented
Method serialize_zim_config Returns the file path as string for serializing the object
Class Variable __slots__ Undocumented
Instance Variable islocal Undocumented
Instance Variable path Undocumented
Instance Variable pathnames Undocumented
Property basename Undocumented
Property dirname Undocumented
Property uri Undocumented
Property userpath Undocumented
def __init__(self, path): (source)

Undocumented

def __iter__(self): (source)

Undocumented

def child(self, path): (source)

Undocumented

def file(self, path): (source)

Undocumented

def folder(self, path): (source)

Undocumented

def list_files(self): (source)

Undocumented

def list_folders(self): (source)

Undocumented

def list_names(self, include_hidden=False): (source)

Undocumented

def new_file(self, path, check=None): (source)
Get a File object for a new file below this folder. Like file() but guarantees the file does not yet exist by adding sequential numbers if needed. So the resulting file may have a modified name.
Parameters
paththe relative file path
checka function that can check and reject the choice before it is given back
Returns
a File object
def new_folder(self, path, check=None): (source)
Get a Folder object for a new folder below this folder. Like folder() but guarantees the file does not yet exist by adding sequential numbers if needed. So the resulting file may have a modified name.
Parameters
paththe relative file path
checka function that can check and reject the choice before it is given back
Returns
a Folder object
def remove_children(self): (source)

Recursively remove everything below this folder .

WARNING: This is quite powerful and can do a lot of damage when executed for the wrong folder, so please make sure to double check the dir is actually what you think it is before calling this.

def walk(self): (source)

Undocumented

def _copyto(self, other): (source)

Undocumented

def _new_child(self, path, factory, check=None): (source)

Undocumented

def _object_iter(self, names, showfile, showdir): (source)

Undocumented