Show
Ignore:
Timestamp:
04/07/05 23:21:33 (7 years ago)
Author:
mj
Message:

W00t, super hack mode. Add auto-reconnect-to-ide mode. If not connected to the IDE, but a debug request comes in, attempt to connect to the IDE before handling the request.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • WingDBG/trunk/WingDBG/DebugHttpServer.py

    r70 r80  
    7878                # Else publish through standard publisher 
    7979                else: 
     80                    if name == 'Zope' and debugger.ChannelClosed(): 
     81                        # We are about to run a Zope module, but we have no IDE 
     82                        # connection. See if we need to auto-reconnect, and do 
     83                        # so if necessary. 
     84                        import Zope 
     85                        from config import CONTROL_PANEL_ID 
     86                        odb = Zope.bobo_application() 
     87                        try: 
     88                            wds = odb.Control_Panel._getOb(CONTROL_PANEL_ID) 
     89                            ari = wds.auto_reconnect_ide 
     90                        finally: 
     91                            # Make sure we close the connection, otherwise 
     92                            # we'll run out. 
     93                            odb._p_jar.close() 
     94                        if ari: 
     95                            # Wrap in bare accept and raise to avoid exception 
     96                            # detection. 
     97                            try: 
     98                                debugger.ConnectToClient() 
     99                            except: 
     100                                raise 
    80101                    if hasattr(ZServerPublisher, 'publish_module'): 
    81102                        ZServerPublisher.publish_module(name, request=request,