1 2<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> 3<html><head><title>Python: module telemetry.core.memory_cache_http_server</title> 4<meta charset="utf-8"> 5</head><body bgcolor="#f0f0f8"> 6 7<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading"> 8<tr bgcolor="#7799ee"> 9<td valign=bottom> <br> 10<font color="#ffffff" face="helvetica, arial"> <br><big><big><strong><a href="telemetry.html"><font color="#ffffff">telemetry</font></a>.<a href="telemetry.core.html"><font color="#ffffff">core</font></a>.memory_cache_http_server</strong></big></big></font></td 11><td align=right valign=bottom 12><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="../telemetry/core/memory_cache_http_server.py">telemetry/core/memory_cache_http_server.py</a></font></td></tr></table> 13 <p><tt># Copyright 2012 The Chromium Authors. All rights reserved.<br> 14# Use of this source code is governed by a BSD-style license that can be<br> 15# found in the LICENSE file.</tt></p> 16<p> 17<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> 18<tr bgcolor="#aa55cc"> 19<td colspan=3 valign=bottom> <br> 20<font color="#ffffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr> 21 22<tr><td bgcolor="#aa55cc"><tt> </tt></td><td> </td> 23<td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="BaseHTTPServer.html">BaseHTTPServer</a><br> 24<a href="SimpleHTTPServer.html">SimpleHTTPServer</a><br> 25<a href="SocketServer.html">SocketServer</a><br> 26</td><td width="25%" valign=top><a href="StringIO.html">StringIO</a><br> 27<a href="errno.html">errno</a><br> 28<a href="gzip.html">gzip</a><br> 29</td><td width="25%" valign=top><a href="telemetry.core.local_server.html">telemetry.core.local_server</a><br> 30<a href="mimetypes.html">mimetypes</a><br> 31<a href="os.html">os</a><br> 32</td><td width="25%" valign=top><a href="socket.html">socket</a><br> 33<a href="sys.html">sys</a><br> 34<a href="urlparse.html">urlparse</a><br> 35</td></tr></table></td></tr></table><p> 36<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> 37<tr bgcolor="#ee77aa"> 38<td colspan=3 valign=bottom> <br> 39<font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr> 40 41<tr><td bgcolor="#ee77aa"><tt> </tt></td><td> </td> 42<td width="100%"><dl> 43<dt><font face="helvetica, arial"><a href="SimpleHTTPServer.html#SimpleHTTPRequestHandler">SimpleHTTPServer.SimpleHTTPRequestHandler</a>(<a href="BaseHTTPServer.html#BaseHTTPRequestHandler">BaseHTTPServer.BaseHTTPRequestHandler</a>) 44</font></dt><dd> 45<dl> 46<dt><font face="helvetica, arial"><a href="telemetry.core.memory_cache_http_server.html#MemoryCacheHTTPRequestHandler">MemoryCacheHTTPRequestHandler</a> 47</font></dt></dl> 48</dd> 49<dt><font face="helvetica, arial"><a href="__builtin__.html#tuple">__builtin__.tuple</a>(<a href="__builtin__.html#object">__builtin__.object</a>) 50</font></dt><dd> 51<dl> 52<dt><font face="helvetica, arial"><a href="telemetry.core.memory_cache_http_server.html#ByteRange">ByteRange</a> 53</font></dt><dt><font face="helvetica, arial"><a href="telemetry.core.memory_cache_http_server.html#ResourceAndRange">ResourceAndRange</a> 54</font></dt></dl> 55</dd> 56<dt><font face="helvetica, arial"><a href="telemetry.core.local_server.html#LocalServer">telemetry.core.local_server.LocalServer</a>(<a href="__builtin__.html#object">__builtin__.object</a>) 57</font></dt><dd> 58<dl> 59<dt><font face="helvetica, arial"><a href="telemetry.core.memory_cache_http_server.html#MemoryCacheHTTPServer">MemoryCacheHTTPServer</a> 60</font></dt></dl> 61</dd> 62<dt><font face="helvetica, arial"><a href="telemetry.core.local_server.html#LocalServerBackend">telemetry.core.local_server.LocalServerBackend</a>(<a href="__builtin__.html#object">__builtin__.object</a>) 63</font></dt><dd> 64<dl> 65<dt><font face="helvetica, arial"><a href="telemetry.core.memory_cache_http_server.html#MemoryCacheHTTPServerBackend">MemoryCacheHTTPServerBackend</a> 66</font></dt></dl> 67</dd> 68</dl> 69 <p> 70<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> 71<tr bgcolor="#ffc8d8"> 72<td colspan=3 valign=bottom> <br> 73<font color="#000000" face="helvetica, arial"><a name="ByteRange">class <strong>ByteRange</strong></a>(<a href="__builtin__.html#tuple">__builtin__.tuple</a>)</font></td></tr> 74 75<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> 76<td colspan=2><tt><a href="#ByteRange">ByteRange</a>(from_byte, to_byte)<br> </tt></td></tr> 77<tr><td> </td> 78<td width="100%"><dl><dt>Method resolution order:</dt> 79<dd><a href="telemetry.core.memory_cache_http_server.html#ByteRange">ByteRange</a></dd> 80<dd><a href="__builtin__.html#tuple">__builtin__.tuple</a></dd> 81<dd><a href="__builtin__.html#object">__builtin__.object</a></dd> 82</dl> 83<hr> 84Methods defined here:<br> 85<dl><dt><a name="ByteRange-__getnewargs__"><strong>__getnewargs__</strong></a>(self)</dt><dd><tt>Return self as a plain <a href="__builtin__.html#tuple">tuple</a>. Used by copy and pickle.</tt></dd></dl> 86 87<dl><dt><a name="ByteRange-__getstate__"><strong>__getstate__</strong></a>(self)</dt><dd><tt>Exclude the OrderedDict from pickling</tt></dd></dl> 88 89<dl><dt><a name="ByteRange-__repr__"><strong>__repr__</strong></a>(self)</dt><dd><tt>Return a nicely formatted representation string</tt></dd></dl> 90 91<dl><dt><a name="ByteRange-_asdict"><strong>_asdict</strong></a>(self)</dt><dd><tt>Return a new OrderedDict which maps field names to their values</tt></dd></dl> 92 93<dl><dt><a name="ByteRange-_replace"><strong>_replace</strong></a>(_self, **kwds)</dt><dd><tt>Return a new <a href="#ByteRange">ByteRange</a> object replacing specified fields with new values</tt></dd></dl> 94 95<hr> 96Class methods defined here:<br> 97<dl><dt><a name="ByteRange-_make"><strong>_make</strong></a>(cls, iterable, new<font color="#909090">=<built-in method __new__ of type object></font>, len<font color="#909090">=<built-in function len></font>)<font color="#909090"><font face="helvetica, arial"> from <a href="__builtin__.html#type">__builtin__.type</a></font></font></dt><dd><tt>Make a new <a href="#ByteRange">ByteRange</a> object from a sequence or iterable</tt></dd></dl> 98 99<hr> 100Static methods defined here:<br> 101<dl><dt><a name="ByteRange-__new__"><strong>__new__</strong></a>(_cls, from_byte, to_byte)</dt><dd><tt>Create new instance of <a href="#ByteRange">ByteRange</a>(from_byte, to_byte)</tt></dd></dl> 102 103<hr> 104Data descriptors defined here:<br> 105<dl><dt><strong>__dict__</strong></dt> 106<dd><tt>Return a new OrderedDict which maps field names to their values</tt></dd> 107</dl> 108<dl><dt><strong>from_byte</strong></dt> 109<dd><tt>Alias for field number 0</tt></dd> 110</dl> 111<dl><dt><strong>to_byte</strong></dt> 112<dd><tt>Alias for field number 1</tt></dd> 113</dl> 114<hr> 115Data and other attributes defined here:<br> 116<dl><dt><strong>_fields</strong> = ('from_byte', 'to_byte')</dl> 117 118<hr> 119Methods inherited from <a href="__builtin__.html#tuple">__builtin__.tuple</a>:<br> 120<dl><dt><a name="ByteRange-__add__"><strong>__add__</strong></a>(...)</dt><dd><tt>x.<a href="#ByteRange-__add__">__add__</a>(y) <==> x+y</tt></dd></dl> 121 122<dl><dt><a name="ByteRange-__contains__"><strong>__contains__</strong></a>(...)</dt><dd><tt>x.<a href="#ByteRange-__contains__">__contains__</a>(y) <==> y in x</tt></dd></dl> 123 124<dl><dt><a name="ByteRange-__eq__"><strong>__eq__</strong></a>(...)</dt><dd><tt>x.<a href="#ByteRange-__eq__">__eq__</a>(y) <==> x==y</tt></dd></dl> 125 126<dl><dt><a name="ByteRange-__ge__"><strong>__ge__</strong></a>(...)</dt><dd><tt>x.<a href="#ByteRange-__ge__">__ge__</a>(y) <==> x>=y</tt></dd></dl> 127 128<dl><dt><a name="ByteRange-__getattribute__"><strong>__getattribute__</strong></a>(...)</dt><dd><tt>x.<a href="#ByteRange-__getattribute__">__getattribute__</a>('name') <==> x.name</tt></dd></dl> 129 130<dl><dt><a name="ByteRange-__getitem__"><strong>__getitem__</strong></a>(...)</dt><dd><tt>x.<a href="#ByteRange-__getitem__">__getitem__</a>(y) <==> x[y]</tt></dd></dl> 131 132<dl><dt><a name="ByteRange-__getslice__"><strong>__getslice__</strong></a>(...)</dt><dd><tt>x.<a href="#ByteRange-__getslice__">__getslice__</a>(i, j) <==> x[i:j]<br> 133 <br> 134Use of negative indices is not supported.</tt></dd></dl> 135 136<dl><dt><a name="ByteRange-__gt__"><strong>__gt__</strong></a>(...)</dt><dd><tt>x.<a href="#ByteRange-__gt__">__gt__</a>(y) <==> x>y</tt></dd></dl> 137 138<dl><dt><a name="ByteRange-__hash__"><strong>__hash__</strong></a>(...)</dt><dd><tt>x.<a href="#ByteRange-__hash__">__hash__</a>() <==> hash(x)</tt></dd></dl> 139 140<dl><dt><a name="ByteRange-__iter__"><strong>__iter__</strong></a>(...)</dt><dd><tt>x.<a href="#ByteRange-__iter__">__iter__</a>() <==> iter(x)</tt></dd></dl> 141 142<dl><dt><a name="ByteRange-__le__"><strong>__le__</strong></a>(...)</dt><dd><tt>x.<a href="#ByteRange-__le__">__le__</a>(y) <==> x<=y</tt></dd></dl> 143 144<dl><dt><a name="ByteRange-__len__"><strong>__len__</strong></a>(...)</dt><dd><tt>x.<a href="#ByteRange-__len__">__len__</a>() <==> len(x)</tt></dd></dl> 145 146<dl><dt><a name="ByteRange-__lt__"><strong>__lt__</strong></a>(...)</dt><dd><tt>x.<a href="#ByteRange-__lt__">__lt__</a>(y) <==> x<y</tt></dd></dl> 147 148<dl><dt><a name="ByteRange-__mul__"><strong>__mul__</strong></a>(...)</dt><dd><tt>x.<a href="#ByteRange-__mul__">__mul__</a>(n) <==> x*n</tt></dd></dl> 149 150<dl><dt><a name="ByteRange-__ne__"><strong>__ne__</strong></a>(...)</dt><dd><tt>x.<a href="#ByteRange-__ne__">__ne__</a>(y) <==> x!=y</tt></dd></dl> 151 152<dl><dt><a name="ByteRange-__rmul__"><strong>__rmul__</strong></a>(...)</dt><dd><tt>x.<a href="#ByteRange-__rmul__">__rmul__</a>(n) <==> n*x</tt></dd></dl> 153 154<dl><dt><a name="ByteRange-__sizeof__"><strong>__sizeof__</strong></a>(...)</dt><dd><tt>T.<a href="#ByteRange-__sizeof__">__sizeof__</a>() -- size of T in memory, in bytes</tt></dd></dl> 155 156<dl><dt><a name="ByteRange-count"><strong>count</strong></a>(...)</dt><dd><tt>T.<a href="#ByteRange-count">count</a>(value) -> integer -- return number of occurrences of value</tt></dd></dl> 157 158<dl><dt><a name="ByteRange-index"><strong>index</strong></a>(...)</dt><dd><tt>T.<a href="#ByteRange-index">index</a>(value, [start, [stop]]) -> integer -- return first index of value.<br> 159Raises ValueError if the value is not present.</tt></dd></dl> 160 161</td></tr></table> <p> 162<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> 163<tr bgcolor="#ffc8d8"> 164<td colspan=3 valign=bottom> <br> 165<font color="#000000" face="helvetica, arial"><a name="MemoryCacheHTTPRequestHandler">class <strong>MemoryCacheHTTPRequestHandler</strong></a>(<a href="SimpleHTTPServer.html#SimpleHTTPRequestHandler">SimpleHTTPServer.SimpleHTTPRequestHandler</a>)</font></td></tr> 166 167<tr><td bgcolor="#ffc8d8"><tt> </tt></td><td> </td> 168<td width="100%"><dl><dt>Method resolution order:</dt> 169<dd><a href="telemetry.core.memory_cache_http_server.html#MemoryCacheHTTPRequestHandler">MemoryCacheHTTPRequestHandler</a></dd> 170<dd><a href="SimpleHTTPServer.html#SimpleHTTPRequestHandler">SimpleHTTPServer.SimpleHTTPRequestHandler</a></dd> 171<dd><a href="BaseHTTPServer.html#BaseHTTPRequestHandler">BaseHTTPServer.BaseHTTPRequestHandler</a></dd> 172<dd><a href="SocketServer.html#StreamRequestHandler">SocketServer.StreamRequestHandler</a></dd> 173<dd><a href="SocketServer.html#BaseRequestHandler">SocketServer.BaseRequestHandler</a></dd> 174</dl> 175<hr> 176Methods defined here:<br> 177<dl><dt><a name="MemoryCacheHTTPRequestHandler-GetByteRange"><strong>GetByteRange</strong></a>(self, total_num_of_bytes)</dt><dd><tt>Parse the header and get the range values specified.<br> 178 <br> 179Args:<br> 180 total_num_of_bytes: Total # of bytes in requested resource,<br> 181 used to calculate upper range limit.<br> 182Returns:<br> 183 A <a href="#ByteRange">ByteRange</a> namedtuple object with the requested byte-range values.<br> 184 If no Range is explicitly requested or there is a failure parsing,<br> 185 return None.<br> 186 If range specified is in the format "N-", return N-END. Refer to<br> 187 <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html">http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html</a> for details.<br> 188 If upper range limit is greater than total # of bytes, return upper index.</tt></dd></dl> 189 190<dl><dt><a name="MemoryCacheHTTPRequestHandler-SendHead"><strong>SendHead</strong></a>(self)</dt></dl> 191 192<dl><dt><a name="MemoryCacheHTTPRequestHandler-do_GET"><strong>do_GET</strong></a>(self)</dt><dd><tt>Serve a GET request.</tt></dd></dl> 193 194<dl><dt><a name="MemoryCacheHTTPRequestHandler-do_HEAD"><strong>do_HEAD</strong></a>(self)</dt><dd><tt>Serve a HEAD request.</tt></dd></dl> 195 196<dl><dt><a name="MemoryCacheHTTPRequestHandler-handle"><strong>handle</strong></a>(self)</dt></dl> 197 198<dl><dt><a name="MemoryCacheHTTPRequestHandler-log_error"><strong>log_error</strong></a>(self, fmt, *args)</dt></dl> 199 200<dl><dt><a name="MemoryCacheHTTPRequestHandler-log_request"><strong>log_request</strong></a>(self, code<font color="#909090">='-'</font>, size<font color="#909090">='-'</font>)</dt></dl> 201 202<hr> 203Data and other attributes defined here:<br> 204<dl><dt><strong>protocol_version</strong> = 'HTTP/1.1'</dl> 205 206<dl><dt><strong>wbufsize</strong> = -1</dl> 207 208<hr> 209Methods inherited from <a href="SimpleHTTPServer.html#SimpleHTTPRequestHandler">SimpleHTTPServer.SimpleHTTPRequestHandler</a>:<br> 210<dl><dt><a name="MemoryCacheHTTPRequestHandler-copyfile"><strong>copyfile</strong></a>(self, source, outputfile)</dt><dd><tt>Copy all data between two file objects.<br> 211 <br> 212The SOURCE argument is a file object open for reading<br> 213(or anything with a read() method) and the DESTINATION<br> 214argument is a file object open for writing (or<br> 215anything with a write() method).<br> 216 <br> 217The only reason for overriding this would be to change<br> 218the block size or perhaps to replace newlines by CRLF<br> 219-- note however that this the default server uses this<br> 220to copy binary data as well.</tt></dd></dl> 221 222<dl><dt><a name="MemoryCacheHTTPRequestHandler-guess_type"><strong>guess_type</strong></a>(self, path)</dt><dd><tt>Guess the type of a file.<br> 223 <br> 224Argument is a PATH (a filename).<br> 225 <br> 226Return value is a string of the form type/subtype,<br> 227usable for a MIME Content-type header.<br> 228 <br> 229The default implementation looks the file's extension<br> 230up in the table self.<strong>extensions_map</strong>, using application/octet-stream<br> 231as a default; however it would be permissible (if<br> 232slow) to look inside the data to make a better guess.</tt></dd></dl> 233 234<dl><dt><a name="MemoryCacheHTTPRequestHandler-list_directory"><strong>list_directory</strong></a>(self, path)</dt><dd><tt>Helper to produce a directory listing (absent index.html).<br> 235 <br> 236Return value is either a file object, or None (indicating an<br> 237error). In either case, the headers are sent, making the<br> 238interface the same as for <a href="#MemoryCacheHTTPRequestHandler-send_head">send_head</a>().</tt></dd></dl> 239 240<dl><dt><a name="MemoryCacheHTTPRequestHandler-send_head"><strong>send_head</strong></a>(self)</dt><dd><tt>Common code for GET and HEAD commands.<br> 241 <br> 242This sends the response code and MIME headers.<br> 243 <br> 244Return value is either a file object (which has to be copied<br> 245to the outputfile by the caller unless the command was HEAD,<br> 246and must be closed by the caller under all circumstances), or<br> 247None, in which case the caller has nothing further to do.</tt></dd></dl> 248 249<dl><dt><a name="MemoryCacheHTTPRequestHandler-translate_path"><strong>translate_path</strong></a>(self, path)</dt><dd><tt>Translate a /-separated PATH to the local filename syntax.<br> 250 <br> 251Components that mean special things to the local file system<br> 252(e.g. drive or directory names) are ignored. (XXX They should<br> 253probably be diagnosed.)</tt></dd></dl> 254 255<hr> 256Data and other attributes inherited from <a href="SimpleHTTPServer.html#SimpleHTTPRequestHandler">SimpleHTTPServer.SimpleHTTPRequestHandler</a>:<br> 257<dl><dt><strong>extensions_map</strong> = {'': 'application/octet-stream', '.%': 'application/x-trash', '.323': 'text/h323', '.3gp': 'video/3gpp', '.7z': 'application/x-7z-compressed', '.a': 'application/octet-stream', '.abw': 'application/x-abiword', '.ai': 'application/postscript', '.aif': 'audio/x-aiff', '.aifc': 'audio/x-aiff', ...}</dl> 258 259<dl><dt><strong>server_version</strong> = 'SimpleHTTP/0.6'</dl> 260 261<hr> 262Methods inherited from <a href="BaseHTTPServer.html#BaseHTTPRequestHandler">BaseHTTPServer.BaseHTTPRequestHandler</a>:<br> 263<dl><dt><a name="MemoryCacheHTTPRequestHandler-address_string"><strong>address_string</strong></a>(self)</dt><dd><tt>Return the client address formatted for logging.<br> 264 <br> 265This version looks up the full hostname using gethostbyaddr(),<br> 266and tries to find a name that contains at least one dot.</tt></dd></dl> 267 268<dl><dt><a name="MemoryCacheHTTPRequestHandler-date_time_string"><strong>date_time_string</strong></a>(self, timestamp<font color="#909090">=None</font>)</dt><dd><tt>Return the current date and time formatted for a message header.</tt></dd></dl> 269 270<dl><dt><a name="MemoryCacheHTTPRequestHandler-end_headers"><strong>end_headers</strong></a>(self)</dt><dd><tt>Send the blank line ending the MIME headers.</tt></dd></dl> 271 272<dl><dt><a name="MemoryCacheHTTPRequestHandler-handle_one_request"><strong>handle_one_request</strong></a>(self)</dt><dd><tt>Handle a single HTTP request.<br> 273 <br> 274You normally don't need to override this method; see the class<br> 275__doc__ string for information on how to handle specific HTTP<br> 276commands such as GET and POST.</tt></dd></dl> 277 278<dl><dt><a name="MemoryCacheHTTPRequestHandler-log_date_time_string"><strong>log_date_time_string</strong></a>(self)</dt><dd><tt>Return the current time formatted for logging.</tt></dd></dl> 279 280<dl><dt><a name="MemoryCacheHTTPRequestHandler-log_message"><strong>log_message</strong></a>(self, format, *args)</dt><dd><tt>Log an arbitrary message.<br> 281 <br> 282This is used by all other logging functions. Override<br> 283it if you have specific logging wishes.<br> 284 <br> 285The first argument, FORMAT, is a format string for the<br> 286message to be logged. If the format string contains<br> 287any % escapes requiring parameters, they should be<br> 288specified as subsequent arguments (it's just like<br> 289printf!).<br> 290 <br> 291The client ip address and current date/time are prefixed to every<br> 292message.</tt></dd></dl> 293 294<dl><dt><a name="MemoryCacheHTTPRequestHandler-parse_request"><strong>parse_request</strong></a>(self)</dt><dd><tt>Parse a request (internal).<br> 295 <br> 296The request should be stored in self.<strong>raw_requestline</strong>; the results<br> 297are in self.<strong>command</strong>, self.<strong>path</strong>, self.<strong>request_version</strong> and<br> 298self.<strong>headers</strong>.<br> 299 <br> 300Return True for success, False for failure; on failure, an<br> 301error is sent back.</tt></dd></dl> 302 303<dl><dt><a name="MemoryCacheHTTPRequestHandler-send_error"><strong>send_error</strong></a>(self, code, message<font color="#909090">=None</font>)</dt><dd><tt>Send and log an error reply.<br> 304 <br> 305Arguments are the error code, and a detailed message.<br> 306The detailed message defaults to the short entry matching the<br> 307response code.<br> 308 <br> 309This sends an error response (so it must be called before any<br> 310output has been generated), logs the error, and finally sends<br> 311a piece of HTML explaining the error to the user.</tt></dd></dl> 312 313<dl><dt><a name="MemoryCacheHTTPRequestHandler-send_header"><strong>send_header</strong></a>(self, keyword, value)</dt><dd><tt>Send a MIME header.</tt></dd></dl> 314 315<dl><dt><a name="MemoryCacheHTTPRequestHandler-send_response"><strong>send_response</strong></a>(self, code, message<font color="#909090">=None</font>)</dt><dd><tt>Send the response header and log the response code.<br> 316 <br> 317Also send two standard headers with the server software<br> 318version and the current date.</tt></dd></dl> 319 320<dl><dt><a name="MemoryCacheHTTPRequestHandler-version_string"><strong>version_string</strong></a>(self)</dt><dd><tt>Return the server software version string.</tt></dd></dl> 321 322<hr> 323Data and other attributes inherited from <a href="BaseHTTPServer.html#BaseHTTPRequestHandler">BaseHTTPServer.BaseHTTPRequestHandler</a>:<br> 324<dl><dt><strong>MessageClass</strong> = <class mimetools.Message></dl> 325 326<dl><dt><strong>default_request_version</strong> = 'HTTP/0.9'</dl> 327 328<dl><dt><strong>error_content_type</strong> = 'text/html'</dl> 329 330<dl><dt><strong>error_message_format</strong> = '<head><font color="#c040c0">\n</font><title>Error response</title><font color="#c040c0">\n</font></head><font color="#c040c0">\n</font><bo...ode explanation: %(code)s = %(explain)s.<font color="#c040c0">\n</font></body><font color="#c040c0">\n</font>'</dl> 331 332<dl><dt><strong>monthname</strong> = [None, 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']</dl> 333 334<dl><dt><strong>responses</strong> = {100: ('Continue', 'Request received, please continue'), 101: ('Switching Protocols', 'Switching to new protocol; obey Upgrade header'), 200: ('OK', 'Request fulfilled, document follows'), 201: ('Created', 'Document created, URL follows'), 202: ('Accepted', 'Request accepted, processing continues off-line'), 203: ('Non-Authoritative Information', 'Request fulfilled from cache'), 204: ('No Content', 'Request fulfilled, nothing follows'), 205: ('Reset Content', 'Clear input form for further input.'), 206: ('Partial Content', 'Partial content follows.'), 300: ('Multiple Choices', 'Object has several resources -- see URI list'), ...}</dl> 335 336<dl><dt><strong>sys_version</strong> = 'Python/2.7.6'</dl> 337 338<dl><dt><strong>weekdayname</strong> = ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']</dl> 339 340<hr> 341Methods inherited from <a href="SocketServer.html#StreamRequestHandler">SocketServer.StreamRequestHandler</a>:<br> 342<dl><dt><a name="MemoryCacheHTTPRequestHandler-finish"><strong>finish</strong></a>(self)</dt></dl> 343 344<dl><dt><a name="MemoryCacheHTTPRequestHandler-setup"><strong>setup</strong></a>(self)</dt></dl> 345 346<hr> 347Data and other attributes inherited from <a href="SocketServer.html#StreamRequestHandler">SocketServer.StreamRequestHandler</a>:<br> 348<dl><dt><strong>disable_nagle_algorithm</strong> = False</dl> 349 350<dl><dt><strong>rbufsize</strong> = -1</dl> 351 352<dl><dt><strong>timeout</strong> = None</dl> 353 354<hr> 355Methods inherited from <a href="SocketServer.html#BaseRequestHandler">SocketServer.BaseRequestHandler</a>:<br> 356<dl><dt><a name="MemoryCacheHTTPRequestHandler-__init__"><strong>__init__</strong></a>(self, request, client_address, server)</dt></dl> 357 358</td></tr></table> <p> 359<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> 360<tr bgcolor="#ffc8d8"> 361<td colspan=3 valign=bottom> <br> 362<font color="#000000" face="helvetica, arial"><a name="MemoryCacheHTTPServer">class <strong>MemoryCacheHTTPServer</strong></a>(<a href="telemetry.core.local_server.html#LocalServer">telemetry.core.local_server.LocalServer</a>)</font></td></tr> 363 364<tr><td bgcolor="#ffc8d8"><tt> </tt></td><td> </td> 365<td width="100%"><dl><dt>Method resolution order:</dt> 366<dd><a href="telemetry.core.memory_cache_http_server.html#MemoryCacheHTTPServer">MemoryCacheHTTPServer</a></dd> 367<dd><a href="telemetry.core.local_server.html#LocalServer">telemetry.core.local_server.LocalServer</a></dd> 368<dd><a href="__builtin__.html#object">__builtin__.object</a></dd> 369</dl> 370<hr> 371Methods defined here:<br> 372<dl><dt><a name="MemoryCacheHTTPServer-GetBackendStartupArgs"><strong>GetBackendStartupArgs</strong></a>(self)</dt></dl> 373 374<dl><dt><a name="MemoryCacheHTTPServer-UrlOf"><strong>UrlOf</strong></a>(self, path)</dt></dl> 375 376<dl><dt><a name="MemoryCacheHTTPServer-__init__"><strong>__init__</strong></a>(self, paths)</dt></dl> 377 378<hr> 379Data descriptors defined here:<br> 380<dl><dt><strong>paths</strong></dt> 381</dl> 382<dl><dt><strong>url</strong></dt> 383</dl> 384<hr> 385Methods inherited from <a href="telemetry.core.local_server.html#LocalServer">telemetry.core.local_server.LocalServer</a>:<br> 386<dl><dt><a name="MemoryCacheHTTPServer-Close"><strong>Close</strong></a>(self)</dt></dl> 387 388<dl><dt><a name="MemoryCacheHTTPServer-Start"><strong>Start</strong></a>(self, local_server_controller)</dt></dl> 389 390<dl><dt><a name="MemoryCacheHTTPServer-__del__"><strong>__del__</strong></a>(self)</dt></dl> 391 392<dl><dt><a name="MemoryCacheHTTPServer-__enter__"><strong>__enter__</strong></a>(self)</dt></dl> 393 394<dl><dt><a name="MemoryCacheHTTPServer-__exit__"><strong>__exit__</strong></a>(self, *args)</dt></dl> 395 396<hr> 397Data descriptors inherited from <a href="telemetry.core.local_server.html#LocalServer">telemetry.core.local_server.LocalServer</a>:<br> 398<dl><dt><strong>__dict__</strong></dt> 399<dd><tt>dictionary for instance variables (if defined)</tt></dd> 400</dl> 401<dl><dt><strong>__weakref__</strong></dt> 402<dd><tt>list of weak references to the object (if defined)</tt></dd> 403</dl> 404<dl><dt><strong>is_running</strong></dt> 405</dl> 406</td></tr></table> <p> 407<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> 408<tr bgcolor="#ffc8d8"> 409<td colspan=3 valign=bottom> <br> 410<font color="#000000" face="helvetica, arial"><a name="MemoryCacheHTTPServerBackend">class <strong>MemoryCacheHTTPServerBackend</strong></a>(<a href="telemetry.core.local_server.html#LocalServerBackend">telemetry.core.local_server.LocalServerBackend</a>)</font></td></tr> 411 412<tr><td bgcolor="#ffc8d8"><tt> </tt></td><td> </td> 413<td width="100%"><dl><dt>Method resolution order:</dt> 414<dd><a href="telemetry.core.memory_cache_http_server.html#MemoryCacheHTTPServerBackend">MemoryCacheHTTPServerBackend</a></dd> 415<dd><a href="telemetry.core.local_server.html#LocalServerBackend">telemetry.core.local_server.LocalServerBackend</a></dd> 416<dd><a href="__builtin__.html#object">__builtin__.object</a></dd> 417</dl> 418<hr> 419Methods defined here:<br> 420<dl><dt><a name="MemoryCacheHTTPServerBackend-ServeForever"><strong>ServeForever</strong></a>(self)</dt></dl> 421 422<dl><dt><a name="MemoryCacheHTTPServerBackend-StartAndGetNamedPorts"><strong>StartAndGetNamedPorts</strong></a>(self, args)</dt></dl> 423 424<dl><dt><a name="MemoryCacheHTTPServerBackend-__init__"><strong>__init__</strong></a>(self)</dt></dl> 425 426<hr> 427Data descriptors inherited from <a href="telemetry.core.local_server.html#LocalServerBackend">telemetry.core.local_server.LocalServerBackend</a>:<br> 428<dl><dt><strong>__dict__</strong></dt> 429<dd><tt>dictionary for instance variables (if defined)</tt></dd> 430</dl> 431<dl><dt><strong>__weakref__</strong></dt> 432<dd><tt>list of weak references to the object (if defined)</tt></dd> 433</dl> 434</td></tr></table> <p> 435<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> 436<tr bgcolor="#ffc8d8"> 437<td colspan=3 valign=bottom> <br> 438<font color="#000000" face="helvetica, arial"><a name="ResourceAndRange">class <strong>ResourceAndRange</strong></a>(<a href="__builtin__.html#tuple">__builtin__.tuple</a>)</font></td></tr> 439 440<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> 441<td colspan=2><tt><a href="#ResourceAndRange">ResourceAndRange</a>(resource, byte_range)<br> </tt></td></tr> 442<tr><td> </td> 443<td width="100%"><dl><dt>Method resolution order:</dt> 444<dd><a href="telemetry.core.memory_cache_http_server.html#ResourceAndRange">ResourceAndRange</a></dd> 445<dd><a href="__builtin__.html#tuple">__builtin__.tuple</a></dd> 446<dd><a href="__builtin__.html#object">__builtin__.object</a></dd> 447</dl> 448<hr> 449Methods defined here:<br> 450<dl><dt><a name="ResourceAndRange-__getnewargs__"><strong>__getnewargs__</strong></a>(self)</dt><dd><tt>Return self as a plain <a href="__builtin__.html#tuple">tuple</a>. Used by copy and pickle.</tt></dd></dl> 451 452<dl><dt><a name="ResourceAndRange-__getstate__"><strong>__getstate__</strong></a>(self)</dt><dd><tt>Exclude the OrderedDict from pickling</tt></dd></dl> 453 454<dl><dt><a name="ResourceAndRange-__repr__"><strong>__repr__</strong></a>(self)</dt><dd><tt>Return a nicely formatted representation string</tt></dd></dl> 455 456<dl><dt><a name="ResourceAndRange-_asdict"><strong>_asdict</strong></a>(self)</dt><dd><tt>Return a new OrderedDict which maps field names to their values</tt></dd></dl> 457 458<dl><dt><a name="ResourceAndRange-_replace"><strong>_replace</strong></a>(_self, **kwds)</dt><dd><tt>Return a new <a href="#ResourceAndRange">ResourceAndRange</a> object replacing specified fields with new values</tt></dd></dl> 459 460<hr> 461Class methods defined here:<br> 462<dl><dt><a name="ResourceAndRange-_make"><strong>_make</strong></a>(cls, iterable, new<font color="#909090">=<built-in method __new__ of type object></font>, len<font color="#909090">=<built-in function len></font>)<font color="#909090"><font face="helvetica, arial"> from <a href="__builtin__.html#type">__builtin__.type</a></font></font></dt><dd><tt>Make a new <a href="#ResourceAndRange">ResourceAndRange</a> object from a sequence or iterable</tt></dd></dl> 463 464<hr> 465Static methods defined here:<br> 466<dl><dt><a name="ResourceAndRange-__new__"><strong>__new__</strong></a>(_cls, resource, byte_range)</dt><dd><tt>Create new instance of <a href="#ResourceAndRange">ResourceAndRange</a>(resource, byte_range)</tt></dd></dl> 467 468<hr> 469Data descriptors defined here:<br> 470<dl><dt><strong>__dict__</strong></dt> 471<dd><tt>Return a new OrderedDict which maps field names to their values</tt></dd> 472</dl> 473<dl><dt><strong>byte_range</strong></dt> 474<dd><tt>Alias for field number 1</tt></dd> 475</dl> 476<dl><dt><strong>resource</strong></dt> 477<dd><tt>Alias for field number 0</tt></dd> 478</dl> 479<hr> 480Data and other attributes defined here:<br> 481<dl><dt><strong>_fields</strong> = ('resource', 'byte_range')</dl> 482 483<hr> 484Methods inherited from <a href="__builtin__.html#tuple">__builtin__.tuple</a>:<br> 485<dl><dt><a name="ResourceAndRange-__add__"><strong>__add__</strong></a>(...)</dt><dd><tt>x.<a href="#ResourceAndRange-__add__">__add__</a>(y) <==> x+y</tt></dd></dl> 486 487<dl><dt><a name="ResourceAndRange-__contains__"><strong>__contains__</strong></a>(...)</dt><dd><tt>x.<a href="#ResourceAndRange-__contains__">__contains__</a>(y) <==> y in x</tt></dd></dl> 488 489<dl><dt><a name="ResourceAndRange-__eq__"><strong>__eq__</strong></a>(...)</dt><dd><tt>x.<a href="#ResourceAndRange-__eq__">__eq__</a>(y) <==> x==y</tt></dd></dl> 490 491<dl><dt><a name="ResourceAndRange-__ge__"><strong>__ge__</strong></a>(...)</dt><dd><tt>x.<a href="#ResourceAndRange-__ge__">__ge__</a>(y) <==> x>=y</tt></dd></dl> 492 493<dl><dt><a name="ResourceAndRange-__getattribute__"><strong>__getattribute__</strong></a>(...)</dt><dd><tt>x.<a href="#ResourceAndRange-__getattribute__">__getattribute__</a>('name') <==> x.name</tt></dd></dl> 494 495<dl><dt><a name="ResourceAndRange-__getitem__"><strong>__getitem__</strong></a>(...)</dt><dd><tt>x.<a href="#ResourceAndRange-__getitem__">__getitem__</a>(y) <==> x[y]</tt></dd></dl> 496 497<dl><dt><a name="ResourceAndRange-__getslice__"><strong>__getslice__</strong></a>(...)</dt><dd><tt>x.<a href="#ResourceAndRange-__getslice__">__getslice__</a>(i, j) <==> x[i:j]<br> 498 <br> 499Use of negative indices is not supported.</tt></dd></dl> 500 501<dl><dt><a name="ResourceAndRange-__gt__"><strong>__gt__</strong></a>(...)</dt><dd><tt>x.<a href="#ResourceAndRange-__gt__">__gt__</a>(y) <==> x>y</tt></dd></dl> 502 503<dl><dt><a name="ResourceAndRange-__hash__"><strong>__hash__</strong></a>(...)</dt><dd><tt>x.<a href="#ResourceAndRange-__hash__">__hash__</a>() <==> hash(x)</tt></dd></dl> 504 505<dl><dt><a name="ResourceAndRange-__iter__"><strong>__iter__</strong></a>(...)</dt><dd><tt>x.<a href="#ResourceAndRange-__iter__">__iter__</a>() <==> iter(x)</tt></dd></dl> 506 507<dl><dt><a name="ResourceAndRange-__le__"><strong>__le__</strong></a>(...)</dt><dd><tt>x.<a href="#ResourceAndRange-__le__">__le__</a>(y) <==> x<=y</tt></dd></dl> 508 509<dl><dt><a name="ResourceAndRange-__len__"><strong>__len__</strong></a>(...)</dt><dd><tt>x.<a href="#ResourceAndRange-__len__">__len__</a>() <==> len(x)</tt></dd></dl> 510 511<dl><dt><a name="ResourceAndRange-__lt__"><strong>__lt__</strong></a>(...)</dt><dd><tt>x.<a href="#ResourceAndRange-__lt__">__lt__</a>(y) <==> x<y</tt></dd></dl> 512 513<dl><dt><a name="ResourceAndRange-__mul__"><strong>__mul__</strong></a>(...)</dt><dd><tt>x.<a href="#ResourceAndRange-__mul__">__mul__</a>(n) <==> x*n</tt></dd></dl> 514 515<dl><dt><a name="ResourceAndRange-__ne__"><strong>__ne__</strong></a>(...)</dt><dd><tt>x.<a href="#ResourceAndRange-__ne__">__ne__</a>(y) <==> x!=y</tt></dd></dl> 516 517<dl><dt><a name="ResourceAndRange-__rmul__"><strong>__rmul__</strong></a>(...)</dt><dd><tt>x.<a href="#ResourceAndRange-__rmul__">__rmul__</a>(n) <==> n*x</tt></dd></dl> 518 519<dl><dt><a name="ResourceAndRange-__sizeof__"><strong>__sizeof__</strong></a>(...)</dt><dd><tt>T.<a href="#ResourceAndRange-__sizeof__">__sizeof__</a>() -- size of T in memory, in bytes</tt></dd></dl> 520 521<dl><dt><a name="ResourceAndRange-count"><strong>count</strong></a>(...)</dt><dd><tt>T.<a href="#ResourceAndRange-count">count</a>(value) -> integer -- return number of occurrences of value</tt></dd></dl> 522 523<dl><dt><a name="ResourceAndRange-index"><strong>index</strong></a>(...)</dt><dd><tt>T.<a href="#ResourceAndRange-index">index</a>(value, [start, [stop]]) -> integer -- return first index of value.<br> 524Raises ValueError if the value is not present.</tt></dd></dl> 525 526</td></tr></table></td></tr></table> 527</body></html>