class documentation

class DirectoryLister(resource.Resource): (source)

View In Hierarchy

Print the content of a directory.
Method __init__ Initialize.
Method __repr__ Undocumented
Method render Render a listing of the content of self.path.
Instance Variable content​Encodings a mapping of extensions to encoding types. It is initialized with the value File.contentEncodings.
Instance Variable content​Types a mapping of extensions to MIME types used to populate the information of a member of this directory. It is initialized with the value File.contentTypes.
Instance Variable default​Type default type used when no mimetype is detected.
Instance Variable dirs filtered content of path, if the whole content should not be displayed (default to None, which means the actual content of path is printed).
Instance Variable line​Pattern template used to render one line in the listing table. It must contain the format keys class, href, text, size, type and encoding.
Instance Variable path directory which content should be listed.
Instance Variable template page template used to render the content of the directory. It must contain the format keys header and tableContent.
Method _build​Table​Content Build a table content using self.linePattern and giving elements odd and even classes.
Method _get​Files​And​Directories Helper returning files and directories in given directory listing, with attributes to be used to build a table content with self.linePattern.

Inherited from Resource:

Method del​Entity Undocumented
Method get​Child Retrieve a 'child' resource from me.
Method get​Child​For​Request Undocumented
Method get​Child​With​Default Retrieve a static or dynamically generated child resource from me.
Method get​Dynamic​Entity Undocumented
Method get​Static​Entity Undocumented
Method list​Dynamic​Entities Undocumented
Method list​Dynamic​Names Undocumented
Method list​Entities Undocumented
Method list​Names Undocumented
Method list​Static​Entities Undocumented
Method list​Static​Names Undocumented
Method put​Child Register a static child.
Method really​Put​Entity Undocumented
Method render_​HEAD Default handling of HEAD method.
Class Variable is​Leaf Signal if this IResource implementor is a "leaf node" or not. If True, getChildWithDefault will not be called on this Resource.
Class Variable server Undocumented
Instance Variable children Undocumented
def __init__(self, pathname, dirs=None, contentTypes=File.contentTypes, contentEncodings=File.contentEncodings, defaultType='text/html'): (source)
def __repr__(self): (source)

Undocumented

Returns
strUndocumented
def render(self, request): (source)
Render a listing of the content of self.path.
contentEncodings: dict = (source)
a mapping of extensions to encoding types. It is initialized with the value File.contentEncodings.
contentTypes: dict = (source)
a mapping of extensions to MIME types used to populate the information of a member of this directory. It is initialized with the value File.contentTypes.
defaultType: str = (source)
default type used when no mimetype is detected.
dirs: None or list = (source)
filtered content of path, if the whole content should not be displayed (default to None, which means the actual content of path is printed).
linePattern: str = (source)
template used to render one line in the listing table. It must contain the format keys class, href, text, size, type and encoding.
path: str = (source)
directory which content should be listed.
template: str = (source)
page template used to render the content of the directory. It must contain the format keys header and tableContent.
def _buildTableContent(self, elements): (source)
Build a table content using self.linePattern and giving elements odd and even classes.
def _getFilesAndDirectories(self, directory): (source)
Helper returning files and directories in given directory listing, with attributes to be used to build a table content with self.linePattern.
Returns
tuple of listtuple of (directories, files)