def convertJson(inputJsonFile, date, MRepositDir, patchRepositDir, generateHTML, generatePDF, outDir=None, pdfOutDir=None, local=False): if not generateHTML and not generatePDF: raise Exception("Nothing to generate!") global DOX_URL global VIVIAN_URL DOX_URL = getDOXURL(local) VIVIAN_URL = getViViaNURL(local) if generateHTML: if not outDir: raise Exception("Must specify Output directory") if not os.path.exists(outDir): # Will also create intermediate directories if needed os.makedirs(outDir) if generatePDF: if not pdfOutDir: raise Exception("Must specify PDF Output directory") # Will also create intermediate directories if needed if not os.path.exists(pdfOutDir): os.makedirs(pdfOutDir) crossRef = parseCrossReferenceGeneratorArgs(MRepositDir, patchRepositDir) global RPC_NAME_TO_IEN_MAPPING RPC_NAME_TO_IEN_MAPPING = generateSingleFileFieldToIenMappingBySchema(MRepositDir, crossRef, RPC_FILE_NO, RPC_NAME_FIELD_NO) with open(inputJsonFile, 'r') as inputFile: pkgJson = {} # group by package allpkgJson = [] inputJson = json.load(inputFile) for icrEntry in inputJson: if 'NUMBER' not in icrEntry: logger.error("Could not parse entry: " + str(icrEntry)) continue if generatePDF: _generateICRIndividualPagePDF(icrEntry, date, pdfOutDir) if generateHTML: _generateICRIndividualPage(icrEntry, date, outDir, crossRef) summaryInfo = _convertICREntryToSummaryInfo(icrEntry, crossRef) allpkgJson.append(summaryInfo) if 'CUSTODIAL PACKAGE' in icrEntry: pkgJson.setdefault(icrEntry['CUSTODIAL PACKAGE'],[]).append(summaryInfo) if generateHTML: _generateICRSummaryPageImpl(allpkgJson, 'ICR List', 'All', date, outDir, isForAll=True) for pkgName, outJson in pkgJson.iteritems(): _generateICRSummaryPageImpl(outJson, 'ICR List', pkgName, date, outDir) logger.warn('Total # entry in PACKAGE_MAP is [%s]', len(PACKAGE_MAP)) logger.warn('Total # entry in pkgJson is [%s]', len(pkgJson)) _generatePkgDepSummaryPage(inputJson, date, outDir, crossRef)
def convertJson(inputJsonFile, date, MRepositDir, patchRepositDir, generateHTML, generatePDF, outDir=None, pdfOutDir=None, local=False): if not generateHTML and not generatePDF: raise Exception("Nothing to generate!") global DOX_URL global VIVIAN_URL DOX_URL = getDOXURL(local) VIVIAN_URL = getViViaNURL(local) if generateHTML: if not outDir: raise Exception("Must specify Output directory") if not os.path.exists(outDir): # Will also create intermediate directories if needed os.makedirs(outDir) if generatePDF: if not pdfOutDir: raise Exception("Must specify PDF Output directory") # Will also create intermediate directories if needed if not os.path.exists(pdfOutDir): os.makedirs(pdfOutDir) crossRef = parseCrossReferenceGeneratorArgs(MRepositDir, patchRepositDir) global RPC_NAME_TO_IEN_MAPPING RPC_NAME_TO_IEN_MAPPING = generateSingleFileFieldToIenMappingBySchema(MRepositDir, crossRef, RPC_FILE_NO, RPC_NAME_FIELD_NO) with open(inputJsonFile, 'r') as inputFile: pkgJson = {} # group by package allpkgJson = [] inputJson = json.load(inputFile) for icrEntry in inputJson: if generatePDF: _generateICRIndividualPagePDF(icrEntry, date, pdfOutDir) if generateHTML: _generateICRIndividualPage(icrEntry, date, outDir, crossRef) summaryInfo = _convertICREntryToSummaryInfo(icrEntry, crossRef) allpkgJson.append(summaryInfo) if 'CUSTODIAL PACKAGE' in icrEntry: pkgJson.setdefault(icrEntry['CUSTODIAL PACKAGE'],[]).append(summaryInfo) if generateHTML: _generateICRSummaryPageImpl(allpkgJson, 'ICR List', 'All', date, outDir, isForAll=True) for pkgName, outJson in pkgJson.iteritems(): _generateICRSummaryPageImpl(outJson, 'ICR List', pkgName, date, outDir) logger.warn('Total # entry in PACKAGE_MAP is [%s]', len(PACKAGE_MAP)) logger.warn('Total # entry in pkgJson is [%s]', len(pkgJson)) _generatePkgDepSummaryPage(inputJson, date, outDir, crossRef)
def run(args): crossRef = parseCrossReferenceGeneratorArgs(args.MRepositDir, args.patchRepositDir) rpcNameToIenMapping = createRemoteProcedureMapping(args.MRepositDir, crossRef) icrJsonToHtml = ICRJsonToHtml(crossRef, args.outdir) if hasattr(args, 'date'): date = args.date else: date = None icrJsonToHtml.convertJsonToHtml(args.icrJsonFile, date)
def run(args): crossRef = parseCrossReferenceGeneratorArgs(args.MRepositDir, args.patchRepositDir) rpcNameToIenMapping = createRemoteProcedureMapping(args.MRepositDir, crossRef) icrJsonToHtml = ICRJsonToHtml(crossRef, args.outDir) if hasattr(args, 'date'): date = args.date else: date = None icrJsonToHtml.convertJsonToHtml(args.icrJsonFile, date)
def run(args): global DOX_URL global VIVIAN_URL global rpcNameToIenMapping crossRef = parseCrossReferenceGeneratorArgs(args.MRepositDir, args.patchRepositDir) rpcNameToIenMapping = createRemoteProcedureMapping(args.MRepositDir, crossRef) icrJsonToHtml = ICRJsonToHtml(crossRef, args.outdir, args.pdfOutdir, args.pdf) DOX_URL = getDOXURL(args.local) VIVIAN_URL = getViViaNURL(args.local) if hasattr(args, 'date'): date = args.date else: date = None icrJsonToHtml.convertJsonToHtml(args.icrJsonFile, date)
def buildCrossReference(self, xindexLogDir, MRepositDir, patchRepositDir, fileSchemaDir=None, filemanDbJson=None, pkgDepJson=None, icrJson=None): crossRef = parseCrossReferenceGeneratorArgs(MRepositDir, patchRepositDir) if xindexLogDir: crossRef = parseAllCallGraphLog(xindexLogDir, crossRef, icrJson).getCrossReference() if fileSchemaDir: crossRef = parseDataDictionaryLogFile(crossRef, fileSchemaDir).getCrossReference() if filemanDbJson: crossRef = parseFileManDBJSONFile(crossRef, filemanDbJson).getCrossReference() crossRef.generateAllPackageDependencies(pkgDepJson) return crossRef
def buildCrossReference(self, xindexLogDir, MRepositDir, patchRepositDir, fileSchemaDir=None, filemanDbJson=None, pkgDepJson=None, icrJson=None): crossRef = parseCrossReferenceGeneratorArgs(MRepositDir, patchRepositDir) if xindexLogDir: crossRef = parseAllCallGraphLog(xindexLogDir, crossRef, icrJson).getCrossReference() if fileSchemaDir: crossRef = parseDataDictionaryLogFile(crossRef, fileSchemaDir).getCrossReference() if filemanDbJson: crossRef = parseFileManDBJSONFile(crossRef, filemanDbJson).getCrossReference() crossRef.generateAllPackageDependencies(pkgDepJson) return crossRef
def buildCrossReference(self, xindexLogDir, MRepositDir, patchRepositDir, fileSchemaDir, filemanDbJson, icrJson, outdir, inputTemplateDeps, sortTemplateDeps, printTemplateDeps): crossRef = parseCrossReferenceGeneratorArgs(MRepositDir, patchRepositDir) crossRef.outDir = outdir crossRef._inputTemplateDeps = inputTemplateDeps crossRef._sortTemplateDeps = sortTemplateDeps crossRef._printTemplateDeps = printTemplateDeps crossRef = parseDataDictionaryLogFile(crossRef, fileSchemaDir).getCrossReference() crossRef = parseAllCallGraphLog(xindexLogDir, crossRef, icrJson).getCrossReference() crossRef = parseFileManDBJSONFile(crossRef, filemanDbJson).getCrossReference() crossRef.generateAllPackageDependencies() return crossRef
def buildCrossReference(self, xindexLogDir, MRepositDir, patchRepositDir, fileSchemaDir, filemanDbJson, icrJson, outdir, inputTemplateDeps, sortTemplateDeps, printTemplateDeps): crossRef = parseCrossReferenceGeneratorArgs(MRepositDir, patchRepositDir) crossRef.outDir = outdir crossRef._inputTemplateDeps = inputTemplateDeps crossRef._sortTemplateDeps = sortTemplateDeps crossRef._printTemplateDeps = printTemplateDeps crossRef = parseDataDictionaryLogFile( crossRef, fileSchemaDir).getCrossReference() crossRef = parseAllCallGraphLog(xindexLogDir, crossRef, icrJson).getCrossReference() crossRef = parseFileManDBJSONFile(crossRef, filemanDbJson).getCrossReference() crossRef.generateAllPackageDependencies() return crossRef
def convertJson(inputJsonFile, date, MRepositDir, patchRepositDir, generateHTML, generatePDF, outDir=None, pdfOutDir=None, local=False): if not generateHTML and not generatePDF: raise Exception("Nothing to generate!") global DOX_URL global VIVIAN_URL DOX_URL = getDOXURL(local) VIVIAN_URL = getViViaNURL(local) if generateHTML: if not outDir: raise Exception("Must specify Output directory") if not os.path.exists(outDir): # Will also create intermediate directories if needed os.makedirs(outDir) if generatePDF: if not pdfOutDir: raise Exception("Must specify PDF Output directory") # Will also create intermediate directories if needed if not os.path.exists(pdfOutDir): os.makedirs(pdfOutDir) from InitCrossReferenceGenerator import parseCrossReferenceGeneratorArgs crossRef = parseCrossReferenceGeneratorArgs(MRepositDir, patchRepositDir) global RPC_NAME_TO_IEN_MAPPING RPC_NAME_TO_IEN_MAPPING = generateSingleFileFieldToIenMappingBySchema(MRepositDir, crossRef) with open(inputJsonFile, 'r') as inputFile: pkgJson = {} # group by package allpkgJson = [] inputJson = json.load(inputFile) for icrEntry in inputJson: if 'NUMBER' not in icrEntry: logger.error("Could not parse entry: " + str(icrEntry)) continue if 'CUSTODIAL PACKAGE' in icrEntry: pkgName = icrEntry['CUSTODIAL PACKAGE'] if crossRef.getMappedPackageName(pkgName) is None: crossRef.addMappedPackage(pkgName, crossRef.normalizePackageName(pkgName).title()) logger.warning("Adding package " + pkgName + " to package name map.") if generatePDF: _generateICRIndividualPagePDF(icrEntry, date, pdfOutDir) if generateHTML: _generateICRIndividualPage(icrEntry, date, outDir, crossRef) summaryInfo = _convertICREntryToSummaryInfo(icrEntry, crossRef) allpkgJson.append(summaryInfo) if 'CUSTODIAL PACKAGE' in icrEntry: pkgJson.setdefault(icrEntry['CUSTODIAL PACKAGE'], []).append(summaryInfo) if generateHTML: _generateICRSummaryPageImpl(allpkgJson, 'ICR List', 'All', date, outDir, crossRef, isForAll=True) for pkgName, outJson in iteritems(pkgJson): _generateICRSummaryPageImpl(outJson, 'ICR List', pkgName, date, outDir, crossRef) logger.warn('Total # entry in pkgJson is [%s]', len(pkgJson)) _generatePkgDepSummaryPage(inputJson, date, outDir, crossRef)