Changeset 279
- Timestamp:
- 08/11/06 12:25:19 (2 years ago)
- Files:
-
- z3wingdbg/trunk/debugger/networkdebugger.py (modified) (3 diffs)
- z3wingdbg/trunk/interfaces.py (modified) (2 diffs)
- z3wingdbg/trunk/wingdebugservice.py (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
z3wingdbg/trunk/debugger/networkdebugger.py
r276 r279 1 1 import logging 2 2 3 from zope import component, event,interface3 from zope import component, interface 4 4 5 5 from z3wingdbg.interfaces import INetworkDebugger, INetworkDebuggerFactory 6 from z3wingdbg.interfaces import IWingPathInformation, IDEConnectedEvent 7 from z3wingdbg.interfaces import IDEDisconnectedEvent 6 from z3wingdbg.interfaces import IWingPathInformation 8 7 from netservermodule import INetServerModule 9 8 from randomstring import IRandomString … … 70 69 def connectClient(self): 71 70 self._networkserver.ConnectToClient() 72 # Send events through a reactor.threadpool event so they are not73 # processed on the debug thread74 from twisted.internet import reactor75 reactor.callInThread(event.notify, (IDEConnectedEvent(),))76 71 77 72 def disconnectClient(self): … … 80 75 # results in the same method being called. 81 76 self._networkserver._CNetworkServer__CloseChannel() 82 # Send events through a reactor.threadpool event so they are not83 # processed on the debug thread84 from twisted.internet import reactor85 reactor.callInThread(event.notify, (IDEDisconnectedEvent(),))86 77 87 78 @property z3wingdbg/trunk/interfaces.py
r277 r279 180 180 # Events 181 181 class IDebugStateChangedEvent(interface.Interface): 182 """Indicates that the debugger states changed. 183 184 Note that these events may be fired from a thread that does not have 185 a request context! Do not rely on a correct security context or context- 186 sensitive api methods like getSite to work! 187 188 """ 182 """Indicates that the debugger states changed.""" 189 183 service = interface.Attribute('The debug service') 190 184 … … 196 190 197 191 class IIDEConnectedEvent(IDebugStateChangedEvent): 198 """The debugger connected to the IDE""" 192 """The debugger connected to the IDE 193 194 Note that this event is only fired when the connection is started by the 195 Zope3 service, not when the IDE starts the connection. 196 197 """ 199 198 200 199 class IIDEDisconnectedEvent(IDebugStateChangedEvent): 201 """The debugger disconnected from the IDE""" 200 """The debugger disconnected from the IDE 201 202 Note that this event is only fired when the connection is closed by the 203 Zope3 service, not when the IDE closes the connection. 204 205 """ 202 206 203 207 class DebugStateChangedEvent(object): z3wingdbg/trunk/wingdebugservice.py
r278 r279 1 1 import time 2 2 3 from zope import component, interface3 from zope import component, event, interface 4 4 from zope.i18nmessageid import MessageFactory 5 5 … … 9 9 from interfaces import IDebugServerConfiguration, INetworkDebuggerFactory 10 10 from interfaces import IDebugServerFactory, DebugServerStartError 11 from interfaces import IDEConnectionError 11 from interfaces import IDEConnectionError, IDEConnectedEvent 12 from interfaces import IDEDisconnectedEvent 12 13 13 14 _ = MessageFactory('z3wingdbg') … … 87 88 u'Connection to IDE timed out') 88 89 raise IDEConnectionError(message) 90 else: 91 event.notify(IDEConnectedEvent()) 89 92 90 93 def disconnectIDE(self): … … 98 101 except: 99 102 pass 103 else: 104 event.notify(IDEDisconnectedEvent()) 100 105 101 106 @property
