def reloadPackages_cb(self, event=None):
     self.packages = findAllPackages()
     packNames = self.packages.keys()
     packNames.sort()
     self.packageGUI.setlist(packNames)
     self.moduleGUI.clear()
     self.libraryGUI.clear()
    def findDefaultPackages(self):
        packages = findAllPackages()
        default =  [
            'ARTK', 'DejaVu', 'FlexTree', 'MolKit', 'Pmv', 'Vision',
            'Volume', 'symserv', 'WebServices']

        # do these default values exist?
        tmp = []
        for k in default:
            if k in packages.keys():
                tmp.append(k)
        default = tmp

        # add the user libs to default
        from mglutil.util.packageFilePath import getResourceFolderWithVersion
        userResourceFolder = getResourceFolderWithVersion()
        if userResourceFolder is not None:
            userLibsDir = userResourceFolder + os.sep + 'Vision' + os.sep + 'UserLibs'
            from Vision import __path__
            lVisionLibrariesPath = __path__[0]+'Libraries'
            for k,v in packages.items():
                if v.startswith(userLibsDir):
                    default.append(k)
                elif v.startswith(lVisionLibrariesPath):
                    default.append(k)

        # now build the default list
        for k in packages.keys():
            if k not in default:
                del packages[k]
        self.packages = packages
Exemple #3
0
    def findDefaultPackages(self):
        packages = findAllPackages()
        default = [
            'ARTK', 'DejaVu', 'FlexTree', 'MolKit', 'Pmv', 'Vision', 'Volume',
            'symserv', 'WebServices'
        ]

        # do these default values exist?
        tmp = []
        for k in default:
            if k in packages.keys():
                tmp.append(k)
        default = tmp

        # add the user libs to default
        from mglutil.util.packageFilePath import getResourceFolderWithVersion
        userResourceFolder = getResourceFolderWithVersion()
        if userResourceFolder is not None:
            userLibsDir = userResourceFolder + os.sep + 'Vision' + os.sep + 'UserLibs'
            from Vision import __path__
            lVisionLibrariesPath = __path__[0] + 'Libraries'
            for k, v in packages.items():
                if v.startswith(userLibsDir):
                    default.append(k)
                elif v.startswith(lVisionLibrariesPath):
                    default.append(k)

        # now build the default list
        for k in packages.keys():
            if k not in default:
                del packages[k]
        self.packages = packages
Exemple #4
0
 def reloadPackages_cb(self, event=None):
     self.packages = findAllPackages()
     packNames = self.packages.keys()
     packNames.sort()
     self.packageGUI.setlist(packNames)
     self.moduleGUI.clear()
     self.libraryGUI.clear()
Exemple #5
0
 def searchDisk(self):
     libraries = []
     packages = findAllPackages()
     for packName, packNameWithPath in packages.items():
         modNames = self.getModules(packName, packNameWithPath)
         if len(modNames):
             for modName in modNames:
                 moduleName =  packName+'.'+modName
                 try:
                     mod = __import__(
                         moduleName, globals(), locals(),
                         modName.split('.')[-1])
                     libs = self.getLibraries(mod)
                     for name,lib in libs.items():
                         lib.modName = moduleName
                         libraries.append( (name,lib) )
                 except:
                     print "Could not import module %s from %s!"%(
                         modName, os.getcwd() )
                     
     return libraries
Exemple #6
0
 def __init__(self, func=None):
     Command.__init__(self, func)
     self.allPack = findAllPackages()
     self.packModCmd = {}
Exemple #7
0
    def guiCallback(self):

        if self.allPack == {}:
            self.allPack = findAllPackages()
        val = self.showForm('showCmds', force=1, modal=0, blocking=0)
 def __init__(self, func=None):
     Command.__init__(self, func)
     self.allPack = findAllPackages()
     self.packModCmd = {}
 def guiCallback(self):
     
     if self.allPack == {}:
         self.allPack = findAllPackages()
     val = self.showForm('showCmds', force=1,modal=0,blocking=0)