Changeset 3115

Show
Ignore:
Timestamp:
07/09/08 14:24:25 (5 years ago)
Author:
nopper
Message:

Fixing umit-console loading on windows.

Location:
branch/UmitPlugins
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • branch/UmitPlugins/source-plugins/umit-console/sources/console/console.py

    r3093 r3115  
    395395        iter = self.buffer.get_iter_at_mark(self.buffer.get_insert()) 
    396396        self.buffer.insert_with_tags_by_name(iter, 
    397                 'Welcome to UMIT Python Shell (running on %s)\n' % os.uname()[0], 
     397                'Welcome to UMIT Python Shell (running on %s)\n' % os.name, 
    398398                'center', 'extern' 
    399399        ) 
  • branch/UmitPlugins/umitPlugin/Tree.py

    r3114 r3115  
    4848            path = os.path.join(Path.config_dir, "plugins-temp", \ 
    4949                                lib.split('.')[-1] + get_config_vars("SO")[0]) 
    50              
    51             out = open(path, 'wb') 
    52              
    53             out.write(reader.file.read( \ 
    54                 'lib/%s%s' % (lib.replace(".", "/"), get_config_vars("SO")[0])) \ 
    55             ) 
    56             out.close() 
     50 
     51            try: 
     52                out = open(path, 'wb') 
     53                 
     54                out.write(reader.file.read( \ 
     55                    'lib/%s%s' % (lib.replace(".", "/"), get_config_vars("SO")[0])) \ 
     56                ) 
     57                out.close() 
     58            except Exception, exc: 
     59                continue 
    5760             
    5861            path = os.path.dirname(out.name) 
     
    6265                sys.path.insert(0, path) 
    6366                 
    64                 module = original_import(name.replace(get_config_vars("SO")[0], ""), \ 
     67                return original_import(name.replace(get_config_vars("SO")[0], ""), \ 
    6568                                         level=0) 
    66                  
     69            except Exception, exc: 
     70                continue 
    6771            finally: 
    6872                sys.path.pop(0) 
    69              
    70             return module 
    71          
     73 
    7274        raise err 
    7375