예제 #1
0
def getPackageUrlFromName(packageName):
    for packageListPath in getPackageLists():
        if not os.path.isfile(packageListPath):
            print('packageFile does not exist: '+packageListPath)
            continue
        packagesData = install_utils.parseJson(packageListPath)
        if packageName in packagesData:
            return packagesData[packageName]['path']
예제 #2
0
 def getTargets(self):
     packageFilePath = self.getPackageFilePath()
     json = install_utils.parseJson(packageFilePath)
     if 'targets' in json:
         return json['targets']
     targets = list()
     targets.append(self.name)
     return targets
예제 #3
0
def getPackageList():
    data = dict()
    for packageListPath in getPackageLists():
        if not os.path.isfile(packageListPath):
            print('packageFile does not exist: '+packageListPath)
            continue
        data[packageListPath] = install_utils.parseJson(packageListPath)
    return data
예제 #4
0
파일: package.py 프로젝트: lms-org/lpm
 def getTargets(self):
     packageFilePath = self.getPackageFilePath()
     json = install_utils.parseJson(packageFilePath)
     if 'targets' in json:
         return json['targets']
     targets = list()
     targets.append(self.name)
     return targets
예제 #5
0
 def getPackageDependencies(self):
     res = list()
     packageFile = self.getPackageFilePath()
     if not os.path.isdir(self.getDir()):
         print('package does not exist: ' + self.getDir())
         return
     if not os.path.isfile(packageFile):
         print('lms_package.json does not exist in: ' + self.getDir())
         return
     packageData = install_utils.parseJson(packageFile) #TODO error handling
     if 'dependencies' in packageData:
         names = packageData['dependencies']
         for tmp in names:
             res.append(Package(tmp,self.workingDir))
     return res
예제 #6
0
 def getPackageIncludes(self,absPath=True):
     packageFilePath = self.getPackageFilePath()
     json = install_utils.parseJson(packageFilePath)
     if 'includes' in json:
         includes = json['includes']
     else:
         includes = list()
         includes.add('include')
         
     result = list()
     for include in includes:
         if absPath:
             result.append(os.path.abspath(os.path.join(self.getDir(),include)))
         else:
             result.append(include)
     return result
예제 #7
0
파일: package.py 프로젝트: lms-org/lpm
 def getPackageDependencies(self):
     res = list()
     packageFile = self.getPackageFilePath()
     if not os.path.isdir(self.getDir()):
         print('package does not exist: ' + self.getDir())
         return
     if not os.path.isfile(packageFile):
         print('lms_package.json does not exist in: ' + self.getDir())
         return
     packageData = install_utils.parseJson(
         packageFile)  #TODO error handling
     if 'dependencies' in packageData:
         names = packageData['dependencies']
         for tmp in names:
             res.append(Package(tmp, self.workingDir))
     return res
예제 #8
0
파일: package.py 프로젝트: lms-org/lpm
    def getPackageIncludes(self, absPath=True):
        packageFilePath = self.getPackageFilePath()
        json = install_utils.parseJson(packageFilePath)
        if 'includes' in json:
            includes = json['includes']
        else:
            includes = list()
            includes.add('include')

        result = list()
        for include in includes:
            if absPath:
                result.append(
                    os.path.abspath(os.path.join(self.getDir(), include)))
            else:
                result.append(include)
        return result