Module c.u.c.utils

Part of coherence.upnp.core View Source

No module docstring
Line # Kind Name Docs
22 Function parse_xml Undocumented
25 Function parse_http_response Undocumented
40 Function get_ip_address determine the IP address by interface name
67 Function get_host_address try to get determine the interface used for
103 Class Site Undocumented
111 Class ProxyClient Used by ProxyClientFactory to implement a simple web proxy.
166 Class ProxyClientFactory Used by ProxyRequest to implement a simple web proxy.
196 Class ReverseProxyResource Resource that renders the results gotten from another server
228 Class myHTTPPageGetter Undocumented
248 Class HeaderAwareHTTPClientFactory Undocumented
259 Class HeaderAwareHTTPDownloader Undocumented
274 Function getPage Download a web page as a string.
293 Function downloadPage Download a web page to a file.
312 Class StaticFile taken from twisted.web.static and modified
417 Class CET Undocumented
432 Class CEST Undocumented
454 Function datefaker Undocumented
def parse_xml(data, encoding='utf-8'): (source)
Undocumented
def parse_http_response(data): (source)
Undocumented
def get_ip_address(ifname): (source)

determine the IP address by interface name

http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/439094 (c) Paul Cannon Uses the Linux SIOCGIFADDR ioctl to find the IP address associated with a network interface, given the name of that interface, e.g. "eth0". The address is returned as a string containing a dotted quad.

Updated to work on BSD. OpenBSD and OSX share the same value for SIOCGIFADDR, and its likely that other BSDs do too.
def get_host_address(): (source)
try to get determine the interface used for the default route, as this is most likely the interface we should bind to (on a single homed host!)
def getPage(url, *args, contextFactory=None, **kwargs): (source)

Download a web page as a string.

Download a page. Return a deferred, which will callback with a page (as a string) or errback with a description of the error.

See HTTPClientFactory to see what extra args can be passed.
def downloadPage(url, file, *args, contextFactory=None, **kwargs): (source)
Download a web page to a file.
Parametersfile

path to file on filesystem, or file-like object.

See HTTPDownloader to see what extra args can be passed.
def datefaker(): (source)
Undocumented
API Documentation for Coherence, generated by pydoctor at 2007-12-08 21:02:38.