Changeset 337
- Timestamp:
- 08/28/06 22:36:20 (2 years ago)
- Files:
-
- z3wingdbg/trunk/TODO.txt (modified) (1 diff)
- z3wingdbg/trunk/wingdebugservice.py (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
z3wingdbg/trunk/TODO.txt
r336 r337 8 8 - Use custom permissions 9 9 - Implement auto-reconnect (YAGNI?) 10 - Disable auto-start when not in debug mode11 - Disable auto-start when attaching is allowed12 10 13 11 Debugger package z3wingdbg/trunk/wingdebugservice.py
r297 r337 2 2 # This program is open source. For license terms, see the LICENSE.txt file. 3 3 4 import logging 4 5 import time 5 6 … … 8 9 from zope.i18n import MessageFactory 9 10 11 from zope.app.appsetup.appsetup import getConfigContext 10 12 from zope.app.component.hooks import getSite 11 13 from zope.app.publication.zopepublication import ZopePublication … … 129 131 root = connection.root() 130 132 root_folder = root.get(ZopePublication.root_name, None) 131 132 if root_folder is None: 133 connection.close() 134 return 133 log = logging.getLogger('z3wingdbg.wingdebugservice') 135 134 136 config = component.queryUtility(IWingConfiguration, context=root_folder) 137 if config and config.autoStart: 135 try: 136 if root_folder is None: 137 return 138 139 debugmode = getConfigContext().hasFeature('devmode') 140 if not debugmode: 141 return 142 143 config = component.queryUtility(IWingConfiguration, 144 context=root_folder) 145 if not config: 146 return 147 148 if not config.autoStart: 149 return 150 151 if config.attachPort is not None: 152 log.warn('Not autostarting the wing debug server when allowing ' 153 'remote connections.') 154 return 155 138 156 service = component.getUtility(IWingDebugService) 139 157 try: 140 try: 141 service.startDebugServer(context=root_folder) 142 except (DebugServerStartError, IDEConnectionError): 143 pass 144 finally: 145 connection.close() 146 else: 158 service.startDebugServer(context=root_folder) 159 except (DebugServerStartError, IDEConnectionError): 160 pass 161 finally: 147 162 connection.close()
