Пример #1
0
 def outputPackage(self, Package):
     self._outputDict.clear()
     outputDict = self._outputDict
     outputDict['name'] = Package.getName()
     outputDict['routines'] = [x for x in Package.getAllRoutines().iterkeys()]
     outputDict['non_fileman_globals'] = []
     outputDict['fileman_globals'] = []
     for globalVar in Package.getAllGlobals().itervalues():
         globalName = globalVar.getName()
         if globalVar.isFileManFile():
             fileNo = globalVar.getFileNo()
             fileName = globalVar.getFileManName()
             outputDict['fileman_globals'].append(dict({'name': globalName,
                                                        'file_no': fileNo,
                                                        'file_name': fileName}))
         else:
             outputDict['non_fileman_globals'].append(globalName)
     outputDict['original_name'] = Package.getOriginalName()
     outputDict['namespace'] = Package.getNamespaces()
     outputDict['globalspace'] = Package.getGlobalNamespace()
     outputDict['docLink'] = Package.getDocLink()
     outputDict['mirrorLink'] = Package.getDocMirrorLink()
     outputDict['dependency'] = self.__outputDependency__(Package)
     outputDict['dependent'] = self.__outputDependent__(Package)
     return json.dumps(outputDict)
Пример #2
0
 def outputPackage(self, Package):
     self._outputDict.clear()
     outputDict = self._outputDict
     outputDict['name'] = Package.getName()
     outputDict['routines'] = [
         x for x in Package.getAllRoutines().iterkeys()
     ]
     outputDict['non_fileman_globals'] = []
     outputDict['fileman_globals'] = []
     for globalVar in Package.getAllGlobals().itervalues():
         globalName = globalVar.getName()
         if globalVar.isFileManFile():
             fileNo = globalVar.getFileNo()
             fileName = globalVar.getFileManName()
             outputDict['fileman_globals'].append(
                 dict({
                     'name': globalName,
                     'file_no': fileNo,
                     'file_name': fileName
                 }))
         else:
             outputDict['non_fileman_globals'].append(globalName)
     outputDict['original_name'] = Package.getOriginalName()
     outputDict['namespace'] = Package.getNamespaces()
     outputDict['globalspace'] = Package.getGlobalNamespace()
     outputDict['docLink'] = Package.getDocLink()
     outputDict['mirrorLink'] = Package.getDocMirrorLink()
     outputDict['dependency'] = self.__outputDependency__(Package)
     outputDict['dependent'] = self.__outputDependent__(Package)
     return json.dumps(outputDict)
Пример #3
0
 def __outputIndividualPackage__(self, outDir, Package):
     logger.info("Writing Package %s" % Package)
     outputFile = open(
         os.path.join(
             outDir, "Package_%s.json" %
             (Package.getName().replace(' ', '_').replace('-', '_'))), 'wb')
     outputFile.write(self._packageEncoder.outputPackage(Package))
     outputFile.write("\n")
     outputFile.close()
Пример #4
0
 def __handleAllGlobals__(self, Package, PackageJson):
     crossRef = self._crossRef
     for globalName in PackageJson['non_fileman_globals']:
         crossRef.addGlobalToPackageByName(globalName, Package.getName())
     packageName = PackageJson["name"]
     package = crossRef.getPackageByName(packageName)
     for fileManGlobalDict in PackageJson['fileman_globals']:
         globalName = fileManGlobalDict['name']
         fileNo = fileManGlobalDict['file_no']
         fileName = fileManGlobalDict['file_name']
         GlobalVar = Global(globalName, fileNo, fileName, package)
         crossRef.addGlobalToPackage(GlobalVar, packageName)
Пример #5
0
 def __handleAllGlobals__(self, Package, PackageJson):
     crossRef = self._crossRef
     for globalName in PackageJson['non_fileman_globals']:
         crossRef.addGlobalToPackageByName(globalName, Package.getName())
     packageName = PackageJson["name"]
     package = crossRef.getPackageByName(packageName)
     for fileManGlobalDict in PackageJson['fileman_globals']:
         globalName = fileManGlobalDict['name']
         fileNo = fileManGlobalDict['file_no']
         fileName = fileManGlobalDict['file_name']
         GlobalVar = Global(globalName, fileNo, fileName, package)
         crossRef.addGlobalToPackage(GlobalVar, packageName)
Пример #6
0
 def __handleAllRoutines__(self, Package, PackageJson):
     assert "routines" in PackageJson
     crossRef = self._crossRef
     for routineName in PackageJson['routines']:
         crossRef.addRoutineToPackageByName(routineName, Package.getName())
Пример #7
0
 def __outputIndividualPackage__(self, outDir, Package):
     logger.info("Writing Package %s" % Package)
     outputFile = open(os.path.join(outDir,"Package_%s.json" % (Package.getName().replace(' ','_').replace('-','_'))),'wb')
     outputFile.write(self._packageEncoder.outputPackage(Package))
     outputFile.write("\n")
     outputFile.close()
Пример #8
0
 def __handleAllRoutines__(self, Package, PackageJson):
     assert "routines" in PackageJson
     crossRef = self._crossRef
     for routineName in PackageJson['routines']:
         crossRef.addRoutineToPackageByName(routineName, Package.getName())