1 2 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> 3 <html><head><title>Python: module telemetry.core.local_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>.local_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/local_server.py">telemetry/core/local_server.py</a></font></td></tr></table> 13 <p><tt># Copyright 2014 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="collections.html">collections</a><br> 24 <a href="telemetry.internal.forwarders.html">telemetry.internal.forwarders</a><br> 25 </td><td width="25%" valign=top><a href="json.html">json</a><br> 26 <a href="os.html">os</a><br> 27 </td><td width="25%" valign=top><a href="re.html">re</a><br> 28 <a href="subprocess.html">subprocess</a><br> 29 </td><td width="25%" valign=top><a href="sys.html">sys</a><br> 30 <a href="telemetry.core.util.html">telemetry.core.util</a><br> 31 </td></tr></table></td></tr></table><p> 32 <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> 33 <tr bgcolor="#ee77aa"> 34 <td colspan=3 valign=bottom> <br> 35 <font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr> 36 37 <tr><td bgcolor="#ee77aa"><tt> </tt></td><td> </td> 38 <td width="100%"><dl> 39 <dt><font face="helvetica, arial"><a href="__builtin__.html#object">__builtin__.object</a> 40 </font></dt><dd> 41 <dl> 42 <dt><font face="helvetica, arial"><a href="telemetry.core.local_server.html#LocalServer">LocalServer</a> 43 </font></dt><dt><font face="helvetica, arial"><a href="telemetry.core.local_server.html#LocalServerBackend">LocalServerBackend</a> 44 </font></dt><dt><font face="helvetica, arial"><a href="telemetry.core.local_server.html#LocalServerController">LocalServerController</a> 45 </font></dt></dl> 46 </dd> 47 <dt><font face="helvetica, arial"><a href="__builtin__.html#tuple">__builtin__.tuple</a>(<a href="__builtin__.html#object">__builtin__.object</a>) 48 </font></dt><dd> 49 <dl> 50 <dt><font face="helvetica, arial"><a href="telemetry.core.local_server.html#NamedPort">NamedPort</a> 51 </font></dt></dl> 52 </dd> 53 </dl> 54 <p> 55 <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> 56 <tr bgcolor="#ffc8d8"> 57 <td colspan=3 valign=bottom> <br> 58 <font color="#000000" face="helvetica, arial"><a name="LocalServer">class <strong>LocalServer</strong></a>(<a href="__builtin__.html#object">__builtin__.object</a>)</font></td></tr> 59 60 <tr><td bgcolor="#ffc8d8"><tt> </tt></td><td> </td> 61 <td width="100%">Methods defined here:<br> 62 <dl><dt><a name="LocalServer-Close"><strong>Close</strong></a>(self)</dt></dl> 63 64 <dl><dt><a name="LocalServer-GetBackendStartupArgs"><strong>GetBackendStartupArgs</strong></a>(self)</dt><dd><tt>Returns whatever arguments are required to start up the backend</tt></dd></dl> 65 66 <dl><dt><a name="LocalServer-Start"><strong>Start</strong></a>(self, local_server_controller)</dt></dl> 67 68 <dl><dt><a name="LocalServer-__del__"><strong>__del__</strong></a>(self)</dt></dl> 69 70 <dl><dt><a name="LocalServer-__enter__"><strong>__enter__</strong></a>(self)</dt></dl> 71 72 <dl><dt><a name="LocalServer-__exit__"><strong>__exit__</strong></a>(self, *args)</dt></dl> 73 74 <dl><dt><a name="LocalServer-__init__"><strong>__init__</strong></a>(self, server_backend_class)</dt></dl> 75 76 <hr> 77 Data descriptors defined here:<br> 78 <dl><dt><strong>__dict__</strong></dt> 79 <dd><tt>dictionary for instance variables (if defined)</tt></dd> 80 </dl> 81 <dl><dt><strong>__weakref__</strong></dt> 82 <dd><tt>list of weak references to the object (if defined)</tt></dd> 83 </dl> 84 <dl><dt><strong>is_running</strong></dt> 85 </dl> 86 </td></tr></table> <p> 87 <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> 88 <tr bgcolor="#ffc8d8"> 89 <td colspan=3 valign=bottom> <br> 90 <font color="#000000" face="helvetica, arial"><a name="LocalServerBackend">class <strong>LocalServerBackend</strong></a>(<a href="__builtin__.html#object">__builtin__.object</a>)</font></td></tr> 91 92 <tr><td bgcolor="#ffc8d8"><tt> </tt></td><td> </td> 93 <td width="100%">Methods defined here:<br> 94 <dl><dt><a name="LocalServerBackend-ServeForever"><strong>ServeForever</strong></a>(self)</dt></dl> 95 96 <dl><dt><a name="LocalServerBackend-StartAndGetNamedPorts"><strong>StartAndGetNamedPorts</strong></a>(self, args)</dt><dd><tt>Starts the actual server and obtains any sockets on which it<br> 97 should listen.<br> 98 <br> 99 Returns a list of <a href="#NamedPort">NamedPort</a> on which this backend is listening.</tt></dd></dl> 100 101 <dl><dt><a name="LocalServerBackend-__init__"><strong>__init__</strong></a>(self)</dt></dl> 102 103 <hr> 104 Data descriptors defined here:<br> 105 <dl><dt><strong>__dict__</strong></dt> 106 <dd><tt>dictionary for instance variables (if defined)</tt></dd> 107 </dl> 108 <dl><dt><strong>__weakref__</strong></dt> 109 <dd><tt>list of weak references to the object (if defined)</tt></dd> 110 </dl> 111 </td></tr></table> <p> 112 <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> 113 <tr bgcolor="#ffc8d8"> 114 <td colspan=3 valign=bottom> <br> 115 <font color="#000000" face="helvetica, arial"><a name="LocalServerController">class <strong>LocalServerController</strong></a>(<a href="__builtin__.html#object">__builtin__.object</a>)</font></td></tr> 116 117 <tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> 118 <td colspan=2><tt>Manages the list of running servers<br> 119 <br> 120 This class manages the running servers, but also provides an isolation layer<br> 121 to prevent <a href="#LocalServer">LocalServer</a> subclasses from accessing the browser backend directly.<br> </tt></td></tr> 122 <tr><td> </td> 123 <td width="100%">Methods defined here:<br> 124 <dl><dt><a name="LocalServerController-Close"><strong>Close</strong></a>(self)</dt></dl> 125 126 <dl><dt><a name="LocalServerController-CreateForwarder"><strong>CreateForwarder</strong></a>(self, port_pairs)</dt></dl> 127 128 <dl><dt><a name="LocalServerController-GetRemotePort"><strong>GetRemotePort</strong></a>(self, port)</dt></dl> 129 130 <dl><dt><a name="LocalServerController-GetRunningServer"><strong>GetRunningServer</strong></a>(self, server_class, default_value)</dt></dl> 131 132 <dl><dt><a name="LocalServerController-ServerDidClose"><strong>ServerDidClose</strong></a>(self, server)</dt></dl> 133 134 <dl><dt><a name="LocalServerController-StartServer"><strong>StartServer</strong></a>(self, server)</dt></dl> 135 136 <dl><dt><a name="LocalServerController-__init__"><strong>__init__</strong></a>(self, platform_backend)</dt></dl> 137 138 <hr> 139 Data descriptors defined here:<br> 140 <dl><dt><strong>__dict__</strong></dt> 141 <dd><tt>dictionary for instance variables (if defined)</tt></dd> 142 </dl> 143 <dl><dt><strong>__weakref__</strong></dt> 144 <dd><tt>list of weak references to the object (if defined)</tt></dd> 145 </dl> 146 <dl><dt><strong>local_servers</strong></dt> 147 </dl> 148 </td></tr></table> <p> 149 <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> 150 <tr bgcolor="#ffc8d8"> 151 <td colspan=3 valign=bottom> <br> 152 <font color="#000000" face="helvetica, arial"><a name="NamedPort">class <strong>NamedPort</strong></a>(<a href="__builtin__.html#tuple">__builtin__.tuple</a>)</font></td></tr> 153 154 <tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> 155 <td colspan=2><tt><a href="#NamedPort">NamedPort</a>(name, port)<br> </tt></td></tr> 156 <tr><td> </td> 157 <td width="100%"><dl><dt>Method resolution order:</dt> 158 <dd><a href="telemetry.core.local_server.html#NamedPort">NamedPort</a></dd> 159 <dd><a href="__builtin__.html#tuple">__builtin__.tuple</a></dd> 160 <dd><a href="__builtin__.html#object">__builtin__.object</a></dd> 161 </dl> 162 <hr> 163 Methods defined here:<br> 164 <dl><dt><a name="NamedPort-__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> 165 166 <dl><dt><a name="NamedPort-__getstate__"><strong>__getstate__</strong></a>(self)</dt><dd><tt>Exclude the OrderedDict from pickling</tt></dd></dl> 167 168 <dl><dt><a name="NamedPort-__repr__"><strong>__repr__</strong></a>(self)</dt><dd><tt>Return a nicely formatted representation string</tt></dd></dl> 169 170 <dl><dt><a name="NamedPort-_asdict"><strong>_asdict</strong></a>(self)</dt><dd><tt>Return a new OrderedDict which maps field names to their values</tt></dd></dl> 171 172 <dl><dt><a name="NamedPort-_replace"><strong>_replace</strong></a>(_self, **kwds)</dt><dd><tt>Return a new <a href="#NamedPort">NamedPort</a> <a href="__builtin__.html#object">object</a> replacing specified fields with new values</tt></dd></dl> 173 174 <hr> 175 Class methods defined here:<br> 176 <dl><dt><a name="NamedPort-_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="#NamedPort">NamedPort</a> <a href="__builtin__.html#object">object</a> from a sequence or iterable</tt></dd></dl> 177 178 <hr> 179 Static methods defined here:<br> 180 <dl><dt><a name="NamedPort-__new__"><strong>__new__</strong></a>(_cls, name, port)</dt><dd><tt>Create new instance of <a href="#NamedPort">NamedPort</a>(name, port)</tt></dd></dl> 181 182 <hr> 183 Data descriptors defined here:<br> 184 <dl><dt><strong>__dict__</strong></dt> 185 <dd><tt>Return a new OrderedDict which maps field names to their values</tt></dd> 186 </dl> 187 <dl><dt><strong>name</strong></dt> 188 <dd><tt>Alias for field number 0</tt></dd> 189 </dl> 190 <dl><dt><strong>port</strong></dt> 191 <dd><tt>Alias for field number 1</tt></dd> 192 </dl> 193 <hr> 194 Data and other attributes defined here:<br> 195 <dl><dt><strong>_fields</strong> = ('name', 'port')</dl> 196 197 <hr> 198 Methods inherited from <a href="__builtin__.html#tuple">__builtin__.tuple</a>:<br> 199 <dl><dt><a name="NamedPort-__add__"><strong>__add__</strong></a>(...)</dt><dd><tt>x.<a href="#NamedPort-__add__">__add__</a>(y) <==> x+y</tt></dd></dl> 200 201 <dl><dt><a name="NamedPort-__contains__"><strong>__contains__</strong></a>(...)</dt><dd><tt>x.<a href="#NamedPort-__contains__">__contains__</a>(y) <==> y in x</tt></dd></dl> 202 203 <dl><dt><a name="NamedPort-__eq__"><strong>__eq__</strong></a>(...)</dt><dd><tt>x.<a href="#NamedPort-__eq__">__eq__</a>(y) <==> x==y</tt></dd></dl> 204 205 <dl><dt><a name="NamedPort-__ge__"><strong>__ge__</strong></a>(...)</dt><dd><tt>x.<a href="#NamedPort-__ge__">__ge__</a>(y) <==> x>=y</tt></dd></dl> 206 207 <dl><dt><a name="NamedPort-__getattribute__"><strong>__getattribute__</strong></a>(...)</dt><dd><tt>x.<a href="#NamedPort-__getattribute__">__getattribute__</a>('name') <==> x.name</tt></dd></dl> 208 209 <dl><dt><a name="NamedPort-__getitem__"><strong>__getitem__</strong></a>(...)</dt><dd><tt>x.<a href="#NamedPort-__getitem__">__getitem__</a>(y) <==> x[y]</tt></dd></dl> 210 211 <dl><dt><a name="NamedPort-__getslice__"><strong>__getslice__</strong></a>(...)</dt><dd><tt>x.<a href="#NamedPort-__getslice__">__getslice__</a>(i, j) <==> x[i:j]<br> 212 <br> 213 Use of negative indices is not supported.</tt></dd></dl> 214 215 <dl><dt><a name="NamedPort-__gt__"><strong>__gt__</strong></a>(...)</dt><dd><tt>x.<a href="#NamedPort-__gt__">__gt__</a>(y) <==> x>y</tt></dd></dl> 216 217 <dl><dt><a name="NamedPort-__hash__"><strong>__hash__</strong></a>(...)</dt><dd><tt>x.<a href="#NamedPort-__hash__">__hash__</a>() <==> hash(x)</tt></dd></dl> 218 219 <dl><dt><a name="NamedPort-__iter__"><strong>__iter__</strong></a>(...)</dt><dd><tt>x.<a href="#NamedPort-__iter__">__iter__</a>() <==> iter(x)</tt></dd></dl> 220 221 <dl><dt><a name="NamedPort-__le__"><strong>__le__</strong></a>(...)</dt><dd><tt>x.<a href="#NamedPort-__le__">__le__</a>(y) <==> x<=y</tt></dd></dl> 222 223 <dl><dt><a name="NamedPort-__len__"><strong>__len__</strong></a>(...)</dt><dd><tt>x.<a href="#NamedPort-__len__">__len__</a>() <==> len(x)</tt></dd></dl> 224 225 <dl><dt><a name="NamedPort-__lt__"><strong>__lt__</strong></a>(...)</dt><dd><tt>x.<a href="#NamedPort-__lt__">__lt__</a>(y) <==> x<y</tt></dd></dl> 226 227 <dl><dt><a name="NamedPort-__mul__"><strong>__mul__</strong></a>(...)</dt><dd><tt>x.<a href="#NamedPort-__mul__">__mul__</a>(n) <==> x*n</tt></dd></dl> 228 229 <dl><dt><a name="NamedPort-__ne__"><strong>__ne__</strong></a>(...)</dt><dd><tt>x.<a href="#NamedPort-__ne__">__ne__</a>(y) <==> x!=y</tt></dd></dl> 230 231 <dl><dt><a name="NamedPort-__rmul__"><strong>__rmul__</strong></a>(...)</dt><dd><tt>x.<a href="#NamedPort-__rmul__">__rmul__</a>(n) <==> n*x</tt></dd></dl> 232 233 <dl><dt><a name="NamedPort-__sizeof__"><strong>__sizeof__</strong></a>(...)</dt><dd><tt>T.<a href="#NamedPort-__sizeof__">__sizeof__</a>() -- size of T in memory, in bytes</tt></dd></dl> 234 235 <dl><dt><a name="NamedPort-count"><strong>count</strong></a>(...)</dt><dd><tt>T.<a href="#NamedPort-count">count</a>(value) -> integer -- return number of occurrences of value</tt></dd></dl> 236 237 <dl><dt><a name="NamedPort-index"><strong>index</strong></a>(...)</dt><dd><tt>T.<a href="#NamedPort-index">index</a>(value, [start, [stop]]) -> integer -- return first index of value.<br> 238 Raises ValueError if the value is not present.</tt></dd></dl> 239 240 </td></tr></table></td></tr></table> 241 </body></html>