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']
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
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
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
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
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
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