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>&nbsp;<br>
10<font color="#ffffff" face="helvetica, arial">&nbsp;<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>#&nbsp;Copyright&nbsp;2014&nbsp;The&nbsp;Chromium&nbsp;Authors.&nbsp;All&nbsp;rights&nbsp;reserved.<br>
14#&nbsp;Use&nbsp;of&nbsp;this&nbsp;source&nbsp;code&nbsp;is&nbsp;governed&nbsp;by&nbsp;a&nbsp;BSD-style&nbsp;license&nbsp;that&nbsp;can&nbsp;be<br>
15#&nbsp;found&nbsp;in&nbsp;the&nbsp;LICENSE&nbsp;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>&nbsp;<br>
20<font color="#ffffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr>
21
22<tr><td bgcolor="#aa55cc"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</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>&nbsp;<br>
35<font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr>
36
37<tr><td bgcolor="#ee77aa"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</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>&nbsp;<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>&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</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&nbsp;whatever&nbsp;arguments&nbsp;are&nbsp;required&nbsp;to&nbsp;start&nbsp;up&nbsp;the&nbsp;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>
77Data descriptors defined here:<br>
78<dl><dt><strong>__dict__</strong></dt>
79<dd><tt>dictionary&nbsp;for&nbsp;instance&nbsp;variables&nbsp;(if&nbsp;defined)</tt></dd>
80</dl>
81<dl><dt><strong>__weakref__</strong></dt>
82<dd><tt>list&nbsp;of&nbsp;weak&nbsp;references&nbsp;to&nbsp;the&nbsp;object&nbsp;(if&nbsp;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>&nbsp;<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>&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</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&nbsp;the&nbsp;actual&nbsp;server&nbsp;and&nbsp;obtains&nbsp;any&nbsp;sockets&nbsp;on&nbsp;which&nbsp;it<br>
97should&nbsp;listen.<br>
98&nbsp;<br>
99Returns&nbsp;a&nbsp;list&nbsp;of&nbsp;<a href="#NamedPort">NamedPort</a>&nbsp;on&nbsp;which&nbsp;this&nbsp;backend&nbsp;is&nbsp;listening.</tt></dd></dl>
100
101<dl><dt><a name="LocalServerBackend-__init__"><strong>__init__</strong></a>(self)</dt></dl>
102
103<hr>
104Data descriptors defined here:<br>
105<dl><dt><strong>__dict__</strong></dt>
106<dd><tt>dictionary&nbsp;for&nbsp;instance&nbsp;variables&nbsp;(if&nbsp;defined)</tt></dd>
107</dl>
108<dl><dt><strong>__weakref__</strong></dt>
109<dd><tt>list&nbsp;of&nbsp;weak&nbsp;references&nbsp;to&nbsp;the&nbsp;object&nbsp;(if&nbsp;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>&nbsp;<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>&nbsp;&nbsp;&nbsp;</tt></td>
118<td colspan=2><tt>Manages&nbsp;the&nbsp;list&nbsp;of&nbsp;running&nbsp;servers<br>
119&nbsp;<br>
120This&nbsp;class&nbsp;manages&nbsp;the&nbsp;running&nbsp;servers,&nbsp;but&nbsp;also&nbsp;provides&nbsp;an&nbsp;isolation&nbsp;layer<br>
121to&nbsp;prevent&nbsp;<a href="#LocalServer">LocalServer</a>&nbsp;subclasses&nbsp;from&nbsp;accessing&nbsp;the&nbsp;browser&nbsp;backend&nbsp;directly.<br>&nbsp;</tt></td></tr>
122<tr><td>&nbsp;</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>
139Data descriptors defined here:<br>
140<dl><dt><strong>__dict__</strong></dt>
141<dd><tt>dictionary&nbsp;for&nbsp;instance&nbsp;variables&nbsp;(if&nbsp;defined)</tt></dd>
142</dl>
143<dl><dt><strong>__weakref__</strong></dt>
144<dd><tt>list&nbsp;of&nbsp;weak&nbsp;references&nbsp;to&nbsp;the&nbsp;object&nbsp;(if&nbsp;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>&nbsp;<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>&nbsp;&nbsp;&nbsp;</tt></td>
155<td colspan=2><tt><a href="#NamedPort">NamedPort</a>(name,&nbsp;port)<br>&nbsp;</tt></td></tr>
156<tr><td>&nbsp;</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>
163Methods defined here:<br>
164<dl><dt><a name="NamedPort-__getnewargs__"><strong>__getnewargs__</strong></a>(self)</dt><dd><tt>Return&nbsp;self&nbsp;as&nbsp;a&nbsp;plain&nbsp;<a href="__builtin__.html#tuple">tuple</a>.&nbsp;&nbsp;Used&nbsp;by&nbsp;copy&nbsp;and&nbsp;pickle.</tt></dd></dl>
165
166<dl><dt><a name="NamedPort-__getstate__"><strong>__getstate__</strong></a>(self)</dt><dd><tt>Exclude&nbsp;the&nbsp;OrderedDict&nbsp;from&nbsp;pickling</tt></dd></dl>
167
168<dl><dt><a name="NamedPort-__repr__"><strong>__repr__</strong></a>(self)</dt><dd><tt>Return&nbsp;a&nbsp;nicely&nbsp;formatted&nbsp;representation&nbsp;string</tt></dd></dl>
169
170<dl><dt><a name="NamedPort-_asdict"><strong>_asdict</strong></a>(self)</dt><dd><tt>Return&nbsp;a&nbsp;new&nbsp;OrderedDict&nbsp;which&nbsp;maps&nbsp;field&nbsp;names&nbsp;to&nbsp;their&nbsp;values</tt></dd></dl>
171
172<dl><dt><a name="NamedPort-_replace"><strong>_replace</strong></a>(_self, **kwds)</dt><dd><tt>Return&nbsp;a&nbsp;new&nbsp;<a href="#NamedPort">NamedPort</a>&nbsp;<a href="__builtin__.html#object">object</a>&nbsp;replacing&nbsp;specified&nbsp;fields&nbsp;with&nbsp;new&nbsp;values</tt></dd></dl>
173
174<hr>
175Class methods defined here:<br>
176<dl><dt><a name="NamedPort-_make"><strong>_make</strong></a>(cls, iterable, new<font color="#909090">=&lt;built-in method __new__ of type object&gt;</font>, len<font color="#909090">=&lt;built-in function len&gt;</font>)<font color="#909090"><font face="helvetica, arial"> from <a href="__builtin__.html#type">__builtin__.type</a></font></font></dt><dd><tt>Make&nbsp;a&nbsp;new&nbsp;<a href="#NamedPort">NamedPort</a>&nbsp;<a href="__builtin__.html#object">object</a>&nbsp;from&nbsp;a&nbsp;sequence&nbsp;or&nbsp;iterable</tt></dd></dl>
177
178<hr>
179Static methods defined here:<br>
180<dl><dt><a name="NamedPort-__new__"><strong>__new__</strong></a>(_cls, name, port)</dt><dd><tt>Create&nbsp;new&nbsp;instance&nbsp;of&nbsp;<a href="#NamedPort">NamedPort</a>(name,&nbsp;port)</tt></dd></dl>
181
182<hr>
183Data descriptors defined here:<br>
184<dl><dt><strong>__dict__</strong></dt>
185<dd><tt>Return&nbsp;a&nbsp;new&nbsp;OrderedDict&nbsp;which&nbsp;maps&nbsp;field&nbsp;names&nbsp;to&nbsp;their&nbsp;values</tt></dd>
186</dl>
187<dl><dt><strong>name</strong></dt>
188<dd><tt>Alias&nbsp;for&nbsp;field&nbsp;number&nbsp;0</tt></dd>
189</dl>
190<dl><dt><strong>port</strong></dt>
191<dd><tt>Alias&nbsp;for&nbsp;field&nbsp;number&nbsp;1</tt></dd>
192</dl>
193<hr>
194Data and other attributes defined here:<br>
195<dl><dt><strong>_fields</strong> = ('name', 'port')</dl>
196
197<hr>
198Methods 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)&nbsp;&lt;==&gt;&nbsp;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)&nbsp;&lt;==&gt;&nbsp;y&nbsp;in&nbsp;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)&nbsp;&lt;==&gt;&nbsp;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)&nbsp;&lt;==&gt;&nbsp;x&gt;=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')&nbsp;&lt;==&gt;&nbsp;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)&nbsp;&lt;==&gt;&nbsp;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,&nbsp;j)&nbsp;&lt;==&gt;&nbsp;x[i:j]<br>
212&nbsp;<br>
213Use&nbsp;of&nbsp;negative&nbsp;indices&nbsp;is&nbsp;not&nbsp;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)&nbsp;&lt;==&gt;&nbsp;x&gt;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>()&nbsp;&lt;==&gt;&nbsp;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>()&nbsp;&lt;==&gt;&nbsp;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)&nbsp;&lt;==&gt;&nbsp;x&lt;=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>()&nbsp;&lt;==&gt;&nbsp;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)&nbsp;&lt;==&gt;&nbsp;x&lt;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)&nbsp;&lt;==&gt;&nbsp;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)&nbsp;&lt;==&gt;&nbsp;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)&nbsp;&lt;==&gt;&nbsp;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>()&nbsp;--&nbsp;size&nbsp;of&nbsp;T&nbsp;in&nbsp;memory,&nbsp;in&nbsp;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)&nbsp;-&gt;&nbsp;integer&nbsp;--&nbsp;return&nbsp;number&nbsp;of&nbsp;occurrences&nbsp;of&nbsp;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,&nbsp;[start,&nbsp;[stop]])&nbsp;-&gt;&nbsp;integer&nbsp;--&nbsp;return&nbsp;first&nbsp;index&nbsp;of&nbsp;value.<br>
238Raises&nbsp;ValueError&nbsp;if&nbsp;the&nbsp;value&nbsp;is&nbsp;not&nbsp;present.</tt></dd></dl>
239
240</td></tr></table></td></tr></table>
241</body></html>