Changeset 80

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.

Location:
WingDBG/trunk/WingDBG
Files:
3 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, 
  • WingDBG/trunk/WingDBG/WingDBG.py

    r78 r80  
    100100        {'id': 'auto_start', 'type': 'boolean', 'mode': 'w'}, 
    101101        {'id': 'connect_at_start', 'type': 'boolean', 'mode': 'w'}, 
     102        {'id': 'auto_reconnect_ide', 'type': 'boolean', 'mode': 'w'}, 
    102103        # Remotely initiated IDE connections 
    103104        {'id': 'allow_attach', 'type': 'boolean', 'mode': 'w'}, 
     
    124125    auto_start = 0 
    125126    connect_at_start = 1 
     127    auto_reconnect_ide = 0 
    126128     
    127129    allow_attach = 0 
  • WingDBG/trunk/WingDBG/www/advanced.pt

    r77 r80  
    6767    <div class="form-help"> 
    6868      Connect to IDE when debugger is started. 
     69    </div> 
     70  </td> 
     71</tr> 
     72 
     73<tr> 
     74  <td align="left" valign="top" style="width: 10em;"> 
     75    <label for="auto_reconnect_ide" class="form-label">Auto re-connect</label> 
     76  </td><td> 
     77    <input class="form-element" type="checkbox" name="auto_reconnect_ide:bool" 
     78           tabindex="" id="auto_reconnect_ide" 
     79           tal:attributes="checked here/auto_reconnect_ide; 
     80                           tabindex python:tabindex.next() and tabindex.item" /> 
     81    <input type="hidden" name="auto_reconnect_ide:bool:default" value="" /> 
     82    <div class="form-help"> 
     83      Try to reconnect to IDE when the debug server is handling a request but 
     84      the IDE is not connected. The reconnect is attempted on every request, 
     85      so use with caution. 
    6986    </div> 
    7087  </td>