Module n.util

Part of nevow View Source

No module docstring
Line # Kind Name Docs
6 Class UnexposedMethodError Raised on any attempt to get a method which has not been exposed.
12 Class Expose Helper for exposing methods for various uses using a simple decorator-style
94 Function escapeToXML Borrowed from twisted.xish.domish
114 Function getPOSTCharset Locate the unicode encoding of the POST'ed form data.
160 Function remainingSegmentsFactory Undocumented
164 Function currentSegmentsFactory Undocumented
191 Function resource_filename Undocumented
197 Class CachedFile Helper for caching operations on files in the filesystem.
def escapeToXML(text, isattrib=False): (source)

Borrowed from twisted.xish.domish

Escape text to proper XML form, per section 2.3 in the XML specification.
ParameterstextText to escape (type: str )
isattribTriggers escaping of characters necessary for use as attribute values (type: bool )
def getPOSTCharset(ctx): (source)

Locate the unicode encoding of the POST'ed form data.

To work reliably you must do the following:
  • set the form's enctype attribute to 'multipart/form-data'
  • set the form's accept-charset attribute, probably to 'utf-8'
  • add a hidden form field called '_charset_'
For instance:
 <form action="foo" method="post" enctype="multipart/form-data" accept-charset="utf-8">
   <input type="hidden" name="_charset_" />
   ...
 </form>
def remainingSegmentsFactory(ctx): (source)
Undocumented
def currentSegmentsFactory(ctx): (source)
Undocumented
def resource_filename(modulename, resource_name): (source)
Undocumented
API Documentation for Nevow, generated by pydoctor.