Changeset 343
- Timestamp:
- 09/01/06 14:24:45 (2 years ago)
- Files:
-
- z3wingdbg/trunk/TODO.txt (modified) (2 diffs)
- z3wingdbg/trunk/debugger/networkdebugger.py (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
z3wingdbg/trunk/TODO.txt
r342 r343 11 11 ---------------- 12 12 13 - Implement connection accepting14 13 - Raise exceptions with message ids 15 14 … … 26 25 - Add a configuration view to the wing debugger management views 27 26 - Show server url in status screen 27 - Show attachment port status in status screen 28 28 - Deal with import errors from wing z3wingdbg/trunk/debugger/networkdebugger.py
r329 r343 3 3 4 4 import logging 5 import os 5 6 6 7 from zope import component, interface 8 from zope.i18n import MessageFactory 7 9 8 10 from z3wingdbg.interfaces import INetworkDebugger, INetworkDebuggerFactory 9 from z3wingdbg.interfaces import IWingPathInformation 11 from z3wingdbg.interfaces import IWingPathInformation, DebugServerStartError 12 from z3wingdbg.interfaces import PWD_PROFILE, PWD_PATH, PWD_MANUAL 10 13 from netservermodule import INetServerModule 14 15 _ = MessageFactory('z3wingdbg') 11 16 12 17 class LogWrapper(object): … … 43 48 _networkserver = None 44 49 45 def __init__(self, wing_home, host, port, attachport): 50 def __init__(self, wing_home, host, port, attachport, pwsource=PWD_PROFILE, 51 pwpath=None, pw=None): 46 52 pathinfo = component.getUtility(IWingPathInformation) 47 53 nsmodule = component.getUtility(INetServerModule) … … 54 60 'supports one active debugger per process.') 55 61 56 attach = (attachport is None) and -1 or attachport 57 62 attach = -1 63 pwdir = (netserver.abstract.kPWFilePathUserProfileDir,) 64 pwfile = '.wingdebugpw' 65 if attachport is not None: 66 attach = attachport 67 if pwsource == PWD_PATH: 68 if not os.path.exists(pwpath or ''): 69 raise DebugServerStartError( 70 _(u'No valid password source path specified')) 71 if os.path.isfile(pwpath): 72 pwpath, pwfile = os.path.split(pwpath) 73 pwdir = (pwpath,) 74 58 75 logger = netserver.abstract.CErrStream((LogWrapper(),)) 59 76 server = netserver.CNetworkServer( 60 host, port, attach, logger, 61 pwfile_path=(netserver.abstract.kPWFilePathUserProfileDir,)) 77 host, port, attach, logger, pwfile_path=pwdir, pwfile_name=pwfile) 62 78 63 # netserver insists we set a non-empty string, but securechannel 64 # ignores it completely when the channel is set to NoEncryption 65 if attachport is None: 79 if attachport is None or pwsource == PWD_MANUAL: 80 # netserver insists we set a non-empty string, but only uses 81 # the password for verifying incoming attachment requests. 82 password = (pwsource != PWD_MANUAL) and 'ignored' or pw 66 83 server.SetSecurityInfo( 67 netserver.abstract.securechannel.kNoEncryption, 'ignored') 68 84 netserver.abstract.securechannel.kNoEncryption, password) 85 86 if attachport is not None and not server.IsSecurityInfoValid(): 87 raise DebugServerStartError( 88 _(u'No valid password source was provided, please check your ' 89 u'configuration')) 90 69 91 # We set our own sockethook later 70 92 server.SetUseSocketHooksOnImport(False) … … 96 118 def createDebugger(config): 97 119 return NetworkDebugger(config.wingHome, config.ideHost, config.idePort, 98 config.attachPort) 120 config.attachPort, config.attachPasswordSource, 121 config.attachPasswordPath, config.attachPassword) 99 122 100 123 factory = component.factory.Factory(
