Show
Ignore:
Timestamp:
07/31/07 10:09:19 (5 years ago)
Author:
mj
Message:

Merge Wing 3b1 changes.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • WingDBG/trunk/WingDBG.py

    r152 r358  
    2727__doc__ = """Wing Debugger Service Module""" 
    2828 
    29 __version__ = '2.1.0' 
     29__version__ = '3.0.0' 
    3030 
    3131 
     
    6868         
    6969        self.reason = reason 
     70        sys.stderr.write(reason + '\n') 
    7071         
    7172class IDEConnectionTimeOut(Exception): 
     
    165166    def __init__(self):  
    166167        if sys.platform == 'win32': 
    167             self.wing_home = r'c:\Program Files\Wing IDE 2.1' 
     168            self.wing_home = r'c:\Program Files\Wing IDE 3.0' 
    168169        elif sys.platform.startswith('darwin'): 
    169170            self.wing_home = '/Applications/WingIDE.app/Contents/MacOS' 
    170171        else: 
    171             self.wing_home = '/usr/lib/wingide2.1' 
     172            self.wing_home = '/usr/lib/wingide3.0' 
    172173         
    173174        winghome_file = os.path.join(PRODUCT_DIR, '.winghome') 
     
    234235    security.declareProtected(VIEW_PERMISSION, 'wingDebugPwIsValid') 
    235236    def wingDebugPwIsValid(self): 
    236         """Return true if .wingdebugpw can be found""" 
     237        """Return true if wingdebugpw can be found""" 
    237238        dir = self.getProfileDir() 
    238         return dir and os.path.isfile(os.path.join(dir, '.wingdebugpw')) 
     239        return dir and os.path.isfile(os.path.join(dir, 'wingdebugpw')) 
    239240 
    240241    # 
     
    316317            gHttpServer.RunOnDebugThread(cb) 
    317318             
    318             # Wait up to 3 seconds for connection 
     319            # Wait up for connection 
    319320            start_time = time.time() 
    320321            while time.time() < start_time + 5 and not status['completed']: 
     
    335336            raise CannotStartDebugger('Cannot find wingdb.py in $(WINGHOME)/src or' 
    336337                                     ' $(WINGHOME)/bin') 
    337              
     338         
     339        try: 
     340            exec_dict = {} 
     341            execfile(os.path.join(winghome, 'bin', '_patchsupport.py'), exec_dict) 
     342            find_matching = exec_dict['FindMatching'] 
     343            dir_list = find_matching('bin', internal_home, user_settings=None) 
     344        except Exception: 
     345            dir_list = [] 
     346 
     347        dir_list.extend([os.path.join(internal_home, 'bin'),  
     348                         os.path.join(internal_home, 'src')]) 
    338349        wingdb = None 
    339         for path in [os.path.join(internal_home, 'bin'),  
    340                      os.path.join(internal_home, 'src')]: 
     350        for path in dir_list: 
    341351            try: 
    342352                f, p, d = imp.find_module('wingdb', [path]) 
     
    371381        tracer.set_always_stop_excepts(()) 
    372382        tracer.set_never_stop_excepts(()) 
     383         
     384        # Stop tracing 
     385        tracer.stop_trace() 
     386         
    373387        # Unload modules 
    374388        for name in ('wingdb', 'netserver'): 
     
    434448                   ' Advanced Settings page.') 
    435449            if pw_path: # Always either empty or length 1 
    436                pathname = os.path.join(pw_path[0], '.wingdebugpw') 
     450               pathname = os.path.join(pw_path[0], 'wingdebugpw') 
    437451               if not os.access(pathname, os.R_OK): 
    438452                   msg = ('Cannot create debugger because "%s"' 
    439453                          ' cannot be read.\nPlease make sure the user %s' 
    440454                          ' can read the file or change the directory that' 
    441                           ' .wingdebugpw is read from via the Connection' 
     455                          ' wingdebugpw is read from via the Connection' 
    442456                          ' Security options in the Advanced Settings page.'  
    443457                          % (pathname, getUsername(gNetServer) or '<unknown>')) 
     
    669683    def getDisplayValue(self, field, value): 
    670684        if field == 'pw_mode': 
    671             return ('From $WINGHOME', 'From custom directory',  
     685            return ('From User Settings Directory', 'From custom directory',  
    672686                    'Custom password and scrambling mode')[value] 
    673687        if field == 'custom_encrypt_type':