Home | History | Annotate | Download | only in pydoc
      1 
      2 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
      3 <html><head><title>Python: module telemetry.internal.backends.chrome_inspector.inspector_websocket</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.internal.html"><font color="#ffffff">internal</font></a>.<a href="telemetry.internal.backends.html"><font color="#ffffff">backends</font></a>.<a href="telemetry.internal.backends.chrome_inspector.html"><font color="#ffffff">chrome_inspector</font></a>.inspector_websocket</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/internal/backends/chrome_inspector/inspector_websocket.py">telemetry/internal/backends/chrome_inspector/inspector_websocket.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="errno.html">errno</a><br>
     24 <a href="telemetry.core.exceptions.html">telemetry.core.exceptions</a><br>
     25 </td><td width="25%" valign=top><a href="json.html">json</a><br>
     26 <a href="logging.html">logging</a><br>
     27 </td><td width="25%" valign=top><a href="socket.html">socket</a><br>
     28 <a href="time.html">time</a><br>
     29 </td><td width="25%" valign=top><a href="telemetry.internal.backends.chrome_inspector.websocket.html">telemetry.internal.backends.chrome_inspector.websocket</a><br>
     30 </td></tr></table></td></tr></table><p>
     31 <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
     32 <tr bgcolor="#ee77aa">
     33 <td colspan=3 valign=bottom>&nbsp;<br>
     34 <font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr>
     35     
     36 <tr><td bgcolor="#ee77aa"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
     37 <td width="100%"><dl>
     38 <dt><font face="helvetica, arial"><a href="__builtin__.html#object">__builtin__.object</a>
     39 </font></dt><dd>
     40 <dl>
     41 <dt><font face="helvetica, arial"><a href="telemetry.internal.backends.chrome_inspector.inspector_websocket.html#InspectorWebsocket">InspectorWebsocket</a>
     42 </font></dt></dl>
     43 </dd>
     44 <dt><font face="helvetica, arial"><a href="telemetry.core.exceptions.html#Error">telemetry.core.exceptions.Error</a>(<a href="exceptions.html#Exception">exceptions.Exception</a>)
     45 </font></dt><dd>
     46 <dl>
     47 <dt><font face="helvetica, arial"><a href="telemetry.internal.backends.chrome_inspector.inspector_websocket.html#WebSocketDisconnected">WebSocketDisconnected</a>
     48 </font></dt></dl>
     49 </dd>
     50 </dl>
     51  <p>
     52 <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
     53 <tr bgcolor="#ffc8d8">
     54 <td colspan=3 valign=bottom>&nbsp;<br>
     55 <font color="#000000" face="helvetica, arial"><a name="InspectorWebsocket">class <strong>InspectorWebsocket</strong></a>(<a href="__builtin__.html#object">__builtin__.object</a>)</font></td></tr>
     56     
     57 <tr><td bgcolor="#ffc8d8"><tt>&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
     58 <td width="100%">Methods defined here:<br>
     59 <dl><dt><a name="InspectorWebsocket-AsyncRequest"><strong>AsyncRequest</strong></a>(self, req, callback)</dt><dd><tt>Sends&nbsp;an&nbsp;async&nbsp;request&nbsp;and&nbsp;returns&nbsp;immediately.<br>
     60 &nbsp;<br>
     61 Response&nbsp;will&nbsp;be&nbsp;handled&nbsp;in&nbsp;the&nbsp;|callback|&nbsp;later&nbsp;when&nbsp;DispatchNotifications<br>
     62 is&nbsp;invoked.<br>
     63 &nbsp;<br>
     64 Args:<br>
     65 &nbsp;&nbsp;callback:&nbsp;a&nbsp;function&nbsp;that&nbsp;takes&nbsp;inspector's&nbsp;response&nbsp;as&nbsp;the&nbsp;argument.</tt></dd></dl>
     66 
     67 <dl><dt><a name="InspectorWebsocket-Connect"><strong>Connect</strong></a>(self, url, timeout<font color="#909090">=10</font>)</dt><dd><tt>Connects&nbsp;the&nbsp;websocket.<br>
     68 &nbsp;<br>
     69 Raises:<br>
     70 &nbsp;&nbsp;websocket.WebSocketException<br>
     71 &nbsp;&nbsp;socket.error</tt></dd></dl>
     72 
     73 <dl><dt><a name="InspectorWebsocket-Disconnect"><strong>Disconnect</strong></a>(self)</dt><dd><tt>Disconnects&nbsp;the&nbsp;inspector&nbsp;websocket.<br>
     74 &nbsp;<br>
     75 Raises:<br>
     76 &nbsp;&nbsp;websocket.WebSocketException<br>
     77 &nbsp;&nbsp;socket.error</tt></dd></dl>
     78 
     79 <dl><dt><a name="InspectorWebsocket-DispatchNotifications"><strong>DispatchNotifications</strong></a>(self, timeout<font color="#909090">=10</font>)</dt><dd><tt>Waits&nbsp;for&nbsp;responses&nbsp;from&nbsp;the&nbsp;websocket,&nbsp;dispatching&nbsp;them&nbsp;as&nbsp;necessary.<br>
     80 &nbsp;<br>
     81 Raises:<br>
     82 &nbsp;&nbsp;websocket.WebSocketException:&nbsp;<a href="telemetry.core.exceptions.html#Error">Error</a>&nbsp;from&nbsp;websocket&nbsp;library.<br>
     83 &nbsp;&nbsp;socket.error:&nbsp;<a href="telemetry.core.exceptions.html#Error">Error</a>&nbsp;from&nbsp;websocket&nbsp;library.<br>
     84 &nbsp;&nbsp;exceptions.<a href="#WebSocketDisconnected">WebSocketDisconnected</a>:&nbsp;The&nbsp;socket&nbsp;was&nbsp;disconnected.</tt></dd></dl>
     85 
     86 <dl><dt><a name="InspectorWebsocket-RegisterDomain"><strong>RegisterDomain</strong></a>(self, domain_name, notification_handler)</dt><dd><tt>Registers&nbsp;a&nbsp;given&nbsp;domain&nbsp;for&nbsp;handling&nbsp;notification&nbsp;methods.<br>
     87 &nbsp;<br>
     88 For&nbsp;example,&nbsp;given&nbsp;inspector_backend:<br>
     89 &nbsp;&nbsp;&nbsp;def&nbsp;OnConsoleNotification(msg):<br>
     90 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;msg['method']&nbsp;==&nbsp;'Console.messageAdded':<br>
     91 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print&nbsp;msg['params']['message']<br>
     92 &nbsp;&nbsp;&nbsp;inspector_backend.<a href="#InspectorWebsocket-RegisterDomain">RegisterDomain</a>('Console',&nbsp;OnConsoleNotification)<br>
     93 &nbsp;<br>
     94 Args:<br>
     95 &nbsp;&nbsp;domain_name:&nbsp;The&nbsp;devtools&nbsp;domain&nbsp;name.&nbsp;E.g.,&nbsp;'Tracing',&nbsp;'Memory',&nbsp;'Page'.<br>
     96 &nbsp;&nbsp;notification_handler:&nbsp;Handler&nbsp;for&nbsp;devtools&nbsp;notification.&nbsp;Will&nbsp;be<br>
     97 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;called&nbsp;if&nbsp;a&nbsp;devtools&nbsp;notification&nbsp;with&nbsp;matching&nbsp;domain&nbsp;is&nbsp;received<br>
     98 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;via&nbsp;DispatchNotifications.&nbsp;The&nbsp;handler&nbsp;accepts&nbsp;a&nbsp;single&nbsp;paramater:<br>
     99 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;the&nbsp;JSON&nbsp;<a href="__builtin__.html#object">object</a>&nbsp;representing&nbsp;the&nbsp;notification.</tt></dd></dl>
    100 
    101 <dl><dt><a name="InspectorWebsocket-SendAndIgnoreResponse"><strong>SendAndIgnoreResponse</strong></a>(self, req)</dt><dd><tt>Sends&nbsp;a&nbsp;request&nbsp;without&nbsp;waiting&nbsp;for&nbsp;a&nbsp;response.<br>
    102 &nbsp;<br>
    103 Raises:<br>
    104 &nbsp;&nbsp;websocket.WebSocketException:&nbsp;<a href="telemetry.core.exceptions.html#Error">Error</a>&nbsp;from&nbsp;websocket&nbsp;library.<br>
    105 &nbsp;&nbsp;socket.error:&nbsp;<a href="telemetry.core.exceptions.html#Error">Error</a>&nbsp;from&nbsp;websocket&nbsp;library.<br>
    106 &nbsp;&nbsp;exceptions.<a href="#WebSocketDisconnected">WebSocketDisconnected</a>:&nbsp;The&nbsp;socket&nbsp;was&nbsp;disconnected.</tt></dd></dl>
    107 
    108 <dl><dt><a name="InspectorWebsocket-SyncRequest"><strong>SyncRequest</strong></a>(self, req, timeout<font color="#909090">=10</font>)</dt><dd><tt>Sends&nbsp;a&nbsp;request&nbsp;and&nbsp;waits&nbsp;for&nbsp;a&nbsp;response.<br>
    109 &nbsp;<br>
    110 Raises:<br>
    111 &nbsp;&nbsp;websocket.WebSocketException:&nbsp;<a href="telemetry.core.exceptions.html#Error">Error</a>&nbsp;from&nbsp;websocket&nbsp;library.<br>
    112 &nbsp;&nbsp;socket.error:&nbsp;<a href="telemetry.core.exceptions.html#Error">Error</a>&nbsp;from&nbsp;websocket&nbsp;library.<br>
    113 &nbsp;&nbsp;exceptions.<a href="#WebSocketDisconnected">WebSocketDisconnected</a>:&nbsp;The&nbsp;socket&nbsp;was&nbsp;disconnected.</tt></dd></dl>
    114 
    115 <dl><dt><a name="InspectorWebsocket-UnregisterDomain"><strong>UnregisterDomain</strong></a>(self, domain_name)</dt><dd><tt>Unregisters&nbsp;a&nbsp;previously&nbsp;registered&nbsp;domain.</tt></dd></dl>
    116 
    117 <dl><dt><a name="InspectorWebsocket-__init__"><strong>__init__</strong></a>(self)</dt><dd><tt>Create&nbsp;a&nbsp;websocket&nbsp;handler&nbsp;for&nbsp;communicating&nbsp;with&nbsp;Inspectors.</tt></dd></dl>
    118 
    119 <hr>
    120 Data descriptors defined here:<br>
    121 <dl><dt><strong>__dict__</strong></dt>
    122 <dd><tt>dictionary&nbsp;for&nbsp;instance&nbsp;variables&nbsp;(if&nbsp;defined)</tt></dd>
    123 </dl>
    124 <dl><dt><strong>__weakref__</strong></dt>
    125 <dd><tt>list&nbsp;of&nbsp;weak&nbsp;references&nbsp;to&nbsp;the&nbsp;object&nbsp;(if&nbsp;defined)</tt></dd>
    126 </dl>
    127 <hr>
    128 Data and other attributes defined here:<br>
    129 <dl><dt><strong>METHOD_NOT_FOUND_CODE</strong> = -32601</dl>
    130 
    131 </td></tr></table> <p>
    132 <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
    133 <tr bgcolor="#ffc8d8">
    134 <td colspan=3 valign=bottom>&nbsp;<br>
    135 <font color="#000000" face="helvetica, arial"><a name="WebSocketDisconnected">class <strong>WebSocketDisconnected</strong></a>(<a href="telemetry.core.exceptions.html#Error">telemetry.core.exceptions.Error</a>)</font></td></tr>
    136     
    137 <tr bgcolor="#ffc8d8"><td rowspan=2><tt>&nbsp;&nbsp;&nbsp;</tt></td>
    138 <td colspan=2><tt>An&nbsp;attempt&nbsp;was&nbsp;made&nbsp;to&nbsp;use&nbsp;a&nbsp;web&nbsp;socket&nbsp;after&nbsp;it&nbsp;had&nbsp;been&nbsp;disconnected.<br>&nbsp;</tt></td></tr>
    139 <tr><td>&nbsp;</td>
    140 <td width="100%"><dl><dt>Method resolution order:</dt>
    141 <dd><a href="telemetry.internal.backends.chrome_inspector.inspector_websocket.html#WebSocketDisconnected">WebSocketDisconnected</a></dd>
    142 <dd><a href="telemetry.core.exceptions.html#Error">telemetry.core.exceptions.Error</a></dd>
    143 <dd><a href="exceptions.html#Exception">exceptions.Exception</a></dd>
    144 <dd><a href="exceptions.html#BaseException">exceptions.BaseException</a></dd>
    145 <dd><a href="__builtin__.html#object">__builtin__.object</a></dd>
    146 </dl>
    147 <hr>
    148 Methods inherited from <a href="telemetry.core.exceptions.html#Error">telemetry.core.exceptions.Error</a>:<br>
    149 <dl><dt><a name="WebSocketDisconnected-AddDebuggingMessage"><strong>AddDebuggingMessage</strong></a>(self, msg)</dt><dd><tt>Adds&nbsp;a&nbsp;message&nbsp;to&nbsp;the&nbsp;description&nbsp;of&nbsp;the&nbsp;exception.<br>
    150 &nbsp;<br>
    151 Many&nbsp;Telemetry&nbsp;exceptions&nbsp;arise&nbsp;from&nbsp;failures&nbsp;in&nbsp;another&nbsp;application.&nbsp;These<br>
    152 failures&nbsp;are&nbsp;difficult&nbsp;to&nbsp;pinpoint.&nbsp;This&nbsp;method&nbsp;allows&nbsp;Telemetry&nbsp;classes&nbsp;to<br>
    153 append&nbsp;useful&nbsp;debugging&nbsp;information&nbsp;to&nbsp;the&nbsp;exception.&nbsp;This&nbsp;method&nbsp;also&nbsp;logs<br>
    154 information&nbsp;about&nbsp;the&nbsp;location&nbsp;from&nbsp;where&nbsp;it&nbsp;was&nbsp;called.</tt></dd></dl>
    155 
    156 <dl><dt><a name="WebSocketDisconnected-__init__"><strong>__init__</strong></a>(self, msg<font color="#909090">=''</font>)</dt></dl>
    157 
    158 <dl><dt><a name="WebSocketDisconnected-__str__"><strong>__str__</strong></a>(self)</dt></dl>
    159 
    160 <hr>
    161 Data descriptors inherited from <a href="telemetry.core.exceptions.html#Error">telemetry.core.exceptions.Error</a>:<br>
    162 <dl><dt><strong>__weakref__</strong></dt>
    163 <dd><tt>list&nbsp;of&nbsp;weak&nbsp;references&nbsp;to&nbsp;the&nbsp;object&nbsp;(if&nbsp;defined)</tt></dd>
    164 </dl>
    165 <hr>
    166 Data and other attributes inherited from <a href="exceptions.html#Exception">exceptions.Exception</a>:<br>
    167 <dl><dt><strong>__new__</strong> = &lt;built-in method __new__ of type object&gt;<dd><tt>T.<a href="#WebSocketDisconnected-__new__">__new__</a>(S,&nbsp;...)&nbsp;-&gt;&nbsp;a&nbsp;new&nbsp;<a href="__builtin__.html#object">object</a>&nbsp;with&nbsp;type&nbsp;S,&nbsp;a&nbsp;subtype&nbsp;of&nbsp;T</tt></dl>
    168 
    169 <hr>
    170 Methods inherited from <a href="exceptions.html#BaseException">exceptions.BaseException</a>:<br>
    171 <dl><dt><a name="WebSocketDisconnected-__delattr__"><strong>__delattr__</strong></a>(...)</dt><dd><tt>x.<a href="#WebSocketDisconnected-__delattr__">__delattr__</a>('name')&nbsp;&lt;==&gt;&nbsp;del&nbsp;x.name</tt></dd></dl>
    172 
    173 <dl><dt><a name="WebSocketDisconnected-__getattribute__"><strong>__getattribute__</strong></a>(...)</dt><dd><tt>x.<a href="#WebSocketDisconnected-__getattribute__">__getattribute__</a>('name')&nbsp;&lt;==&gt;&nbsp;x.name</tt></dd></dl>
    174 
    175 <dl><dt><a name="WebSocketDisconnected-__getitem__"><strong>__getitem__</strong></a>(...)</dt><dd><tt>x.<a href="#WebSocketDisconnected-__getitem__">__getitem__</a>(y)&nbsp;&lt;==&gt;&nbsp;x[y]</tt></dd></dl>
    176 
    177 <dl><dt><a name="WebSocketDisconnected-__getslice__"><strong>__getslice__</strong></a>(...)</dt><dd><tt>x.<a href="#WebSocketDisconnected-__getslice__">__getslice__</a>(i,&nbsp;j)&nbsp;&lt;==&gt;&nbsp;x[i:j]<br>
    178 &nbsp;<br>
    179 Use&nbsp;of&nbsp;negative&nbsp;indices&nbsp;is&nbsp;not&nbsp;supported.</tt></dd></dl>
    180 
    181 <dl><dt><a name="WebSocketDisconnected-__reduce__"><strong>__reduce__</strong></a>(...)</dt></dl>
    182 
    183 <dl><dt><a name="WebSocketDisconnected-__repr__"><strong>__repr__</strong></a>(...)</dt><dd><tt>x.<a href="#WebSocketDisconnected-__repr__">__repr__</a>()&nbsp;&lt;==&gt;&nbsp;repr(x)</tt></dd></dl>
    184 
    185 <dl><dt><a name="WebSocketDisconnected-__setattr__"><strong>__setattr__</strong></a>(...)</dt><dd><tt>x.<a href="#WebSocketDisconnected-__setattr__">__setattr__</a>('name',&nbsp;value)&nbsp;&lt;==&gt;&nbsp;x.name&nbsp;=&nbsp;value</tt></dd></dl>
    186 
    187 <dl><dt><a name="WebSocketDisconnected-__setstate__"><strong>__setstate__</strong></a>(...)</dt></dl>
    188 
    189 <dl><dt><a name="WebSocketDisconnected-__unicode__"><strong>__unicode__</strong></a>(...)</dt></dl>
    190 
    191 <hr>
    192 Data descriptors inherited from <a href="exceptions.html#BaseException">exceptions.BaseException</a>:<br>
    193 <dl><dt><strong>__dict__</strong></dt>
    194 </dl>
    195 <dl><dt><strong>args</strong></dt>
    196 </dl>
    197 <dl><dt><strong>message</strong></dt>
    198 </dl>
    199 </td></tr></table></td></tr></table>
    200 </body></html>