class DirectoryLister(resource.Resource): (source)
Constructor: DirectoryLister(pathname, dirs, contentTypes, contentEncodings, defaultType)
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 |
a mapping of extensions to encoding types. It is initialized with the value File.contentEncodings . |
Instance Variable | content |
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 |
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 |
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 |
Build a table content using self.linePattern and giving elements odd and even classes. |
Method | _get |
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 |
Undocumented |
Method | get |
Retrieve a 'child' resource from me. |
Method | get |
Deprecated in favor of getChildForRequest . |
Method | get |
Retrieve a static or dynamically generated child resource from me. |
Method | get |
Undocumented |
Method | get |
Undocumented |
Method | list |
Undocumented |
Method | list |
Undocumented |
Method | list |
Undocumented |
Method | list |
Undocumented |
Method | list |
Undocumented |
Method | list |
Undocumented |
Method | put |
Register a static child. |
Method | really |
Undocumented |
Method | render_ |
Default handling of HEAD method. |
Class Variable | allowed |
Undocumented |
Class Variable | is |
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 |
twisted.web.resource.Resource.__init__
Initialize.
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
.
filtered content of path, if the whole content should not be displayed (default to None
, which means the actual content of path is printed).
template used to render one line in the listing table. It must contain the format keys class, href, text, size, type and encoding.
page template used to render the content of the directory. It must contain the format keys header and tableContent.