Changeset 8164

Show
Ignore:
Timestamp:
08/13/08 13:17:36 (5 years ago)
Author:
jawil06
Message:

All hardcoded references to site-packages removed. Installation path should no longer matter.

Location:
ossiedev/trunk/tools
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • ossiedev/trunk/tools/WaveDev/wavedev/ComponentFrame.py

    r8162 r8164  
    328328    def __init__(self, parent): 
    329329        # Constructor for ComponentFrame 
    330         self.wavedevPath = os.getcwd() + os.sep 
    331         # NOTE: This is another poor use of the full path 
    332         # a better way is to construct the string to be executed 
    333         availableTemplates = commands.getoutput("ls -I __init__.py* /usr/lib/python2.5/site-packages/WaveDev/wavedev/generate/templates/") 
     330            self.wavedevPath = os.getcwd() + os.sep 
     331 
     332        self.wavedevPath = __file__ 
     333        if os.path.islink (self.wavedevPath): 
     334            self.wavedevPath = os.path.realpath (self.wavedevPath) 
     335        self.wavedevPath = os.path.dirname (os.path.abspath (self.wavedevPath))  
     336 
     337        #NOTE: There still may be a better way to do this, 
     338        # assuming generate/templates always exists below this file, this will work 
     339        path = self.wavedevPath + '/generate/templates' 
     340        availableTemplates = commands.getoutput("ls -I __init__.py* " + path) 
    334341        availableTemplates = availableTemplates.split() 
    335         self._init_ctrls(parent,availableTemplates) 
     342            self._init_ctrls(parent,availableTemplates) 
    336343 
    337344        self.templateChoice.SetSelection(0) 
     
    342349        self.saveComponentPath = None 
    343350        self.calledByParent = False 
    344  
    345         self.wavedevPath = '/usr/lib/python2.5/site-packages/WaveDev/wavedev/'  # NOTE Should really be computed from the install path 
    346351 
    347352        if parent == None:  #OSSIE Component Editor being run in stand-alone mode 
  • ossiedev/trunk/tools/WaveDev/wavedev/MainFrame.py

    r8162 r8164  
    477477#        self.wavedevPath = os.getcwd() + "/" 
    478478# NOTE The wavedevPath string should be constructed, not hard-coded 
    479         self.wavedevPath = "/usr/lib/python2.5/site-packages/WaveDev/wavedev/" 
     479#        self.wavedevPath = "/usr/lib/python2.5/site-packages/WaveDev/wavedev/" 
     480        self.wavedevPath = __file__ 
     481        if os.path.islink (self.wavedevPath): 
     482            self.wavedevPath = os.path.realpath (self.wavedevPath) 
     483        self.wavedevPath = os.path.dirname (os.path.abspath (self.wavedevPath)) + '/' 
    480484 
    481485################################################################################ 
  • ossiedev/trunk/tools/alf/ALFutils.py

    r8159 r8164  
    156156    # NOTE: Tools directory is now now the alf_plugins module in site_packages 
    157157    #tooldir = frame_obj.installpath+"/tools" 
    158     # To do: we should find a way to not load this statically 
    159     tooldir = '/usr/lib/python2.5/site-packages/alf_plugins' 
     158    # NOTE: There may be a better way of finding the alf_plugins directory, but this works 
     159    tooldir = __import__('alf_plugins').__file__ 
     160    if os.path.islink (tooldir): 
     161        root = os.path.realpath (tooldir) 
     162    tooldir = os.path.dirname (os.path.abspath (tooldir)) 
    160163    frame_obj.tools = ToolList(tooldir) 
    161164