Changeset 170

Show
Ignore:
Timestamp:
12/08/06 17:19:17 (4 years ago)
Author:
lazaridis_com
Message:

re #105 and 106, corrected loader, removde generation of egg_infos from within code.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • infra/tracx/tracx/loader.py

    r156 r170  
    1010import os.path 
    1111import os 
     12import sys 
    1213        
    1314#------------------------------------------------------------------------------ 
     
    4243                subdirs.append(fullname) 
    4344         
    44         # create the egg-info for each subdir 
    45         curdir = os.getcwd() 
     45        # create a list of setup.py containing folders 
     46        setupdirs = [] 
    4647        for dir in subdirs: 
    47             os.chdir(dir) 
    48             if os.path.exists( os.path.join(dir,'setup.py')): 
    49                 import sys                 
    50                 #TODO: pass argv in the global dict of the execfile function 
    51                 sys.argv = ["setup.py", "egg_info"] 
    52                 execfile( os.path.join(dir,'setup.py')) 
    53                 self.log.debug(dir) 
     48            if os.path.exists(os.path.join(dir,'setup.py')): 
     49                setupdirs.append(dir) 
     50                sys.path.append(dir ) 
     51                self.log.debug("setupdir %s", dir) 
    5452 
    55         os.chdir(curdir) 
    56          
    5753        # call plugin loader       
    5854#TODO: trac:#4317 - replace next line with below after fixing 
    5955        from tracx.modified.loader import load_components 
    60         #trac.loader import load_components 
     56        #from trac.loader import load_components 
    6157#         
    62         load_components(self.env, subdirs) 
     58        load_components(self.env, setupdirs)        
    6359         
    6460#TODO trac:$4190 - replace dummies to force component initialization