Skip to content

Commit

Permalink
Merge pull request #29 from BetsyMcPhail/component-colors
Browse files Browse the repository at this point in the history
Package component table was no longer color-coded
  • Loading branch information
josephsnyder authored Dec 20, 2018
2 parents dc58823 + 427437a commit 13880dc
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 15 deletions.
16 changes: 12 additions & 4 deletions Utilities/Dox/PythonScripts/CrossReference.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,11 @@ def __init__(self, routineName, package=None):
self._originalName = routineName
self._hasSourceCode = True
self._structuredCode = []
self._objType="Routine"
self._objType = "Routine"

def getObjectType(self):
return self._objType

def setName(self, routineName):
self._name = routineName
def getName(self):
Expand Down Expand Up @@ -766,6 +770,8 @@ def __init__(self, globalName,
self._totalReferencedRoutines = 0
self._totalReferencedGlobals = 0
self._totalReferredGlobals = 0
self._objType = "Global"

def setName(self, globalName):
self._name = globalName
def getName(self):
Expand Down Expand Up @@ -843,8 +849,10 @@ def isFileManFile(self):
return self.getFileNo() != None
def getPackage(self):
return self._package

def getObjectType(self):
return "Global"
return self._objType

#===========================================================================
# operator
#===========================================================================
Expand Down Expand Up @@ -1454,11 +1462,11 @@ def __categorizeVariableNameByNamespace__(self, variableName, isGlobal = False):
if hasMatch:
return (matchNamespace, package)
return (None, None)

def routineHasSourceCodeByName(self, routineName):
routine = self.getRoutineByName(routineName)
if "getObjectType" in dir(routine):
return True
return routine and routine.hasSourceCode()

def __generatePlatformDependentRoutineDependencies__(self):
for genericRoutine in self._platformDepRoutines.itervalues():
genericRoutine.setHasSourceCode(False)
Expand Down
26 changes: 15 additions & 11 deletions Utilities/Dox/PythonScripts/WebPageGenerator.py
Original file line number Diff line number Diff line change
Expand Up @@ -2193,10 +2193,11 @@ def generateAllSourceCodePage(self):
def getPackageComponentDisplayName(self, routine):
routineName = routine.getName()
if "componentType" in dir(routine):
componentType = routine.componentType.strip()
if componentType in COMPONENT_TYPE_DICT:
return "%s<sup>(%s)</sup>" % (routineName, componentType)
componentType = routine.componentType.strip()
if componentType in COMPONENT_TYPE_DICT:
return "%s<sup>(%s)</sup>" % (routineName, COMPONENT_TYPE_DICT[componentType])
return routineName

#===============================================================================
# utility method to show routine name
#===============================================================================
Expand Down Expand Up @@ -2447,7 +2448,7 @@ def generateTablizedItemList(self, sortedItemList, outputFile, htmlMappingFunc,
linkName = htmlMappingFunc(displayName, keyVal)
if nameFunc:
displayName = nameFunc(displayName)
outputFile.write("<td style=\"border: 2px solid color=%s;\" class=\"indexkey\"><a class=\"e1\" href=\"%s\">%s</a>&nbsp;&nbsp;&nbsp;&nbsp;</td>"
outputFile.write("<td style=\"border: 2px solid %s;\" class=\"indexkey\"><a class=\"e1\" href=\"%s\">%s</a>&nbsp;&nbsp;&nbsp;&nbsp;</td>"
% (borderColorString, linkName, displayName))
if self._generatePDFBundle:
# format name for pdf
Expand Down Expand Up @@ -2603,7 +2604,7 @@ def generateIndividualPackagePage(self):
else:
globalList.append(globalVar)
#
routinesList = package.getAllRoutines().keys()
routinesList = package.getAllRoutines().values()

# Build list of sections with data
indexList = ["Namespace", "Doc"]
Expand Down Expand Up @@ -2668,7 +2669,8 @@ def generateIndividualPackagePage(self):
sortedICRList = sorted(icrList, key=lambda item: float(item["NUMBER"]))
self.generatePackageSection("ICR Entries", getICRHtmlFileName,
getICRDisplayName, "icrVals",
sortedICRList, outputFile, pdf)
sortedICRList, outputFile, pdf,
useColor=False)

# FileMan files
if len(fileManList) > 0:
Expand All @@ -2692,8 +2694,10 @@ def generateIndividualPackagePage(self):

# Routines
if len(routinesList) > 0:
sortedRoutinesList = sorted(routinesList)
self.generatePackageSection("Routines", getRoutineHtmlFileName,
# sorted by routine Name
sortedRoutinesList = sorted(routinesList, key=lambda item: item.getName())
self.generatePackageSection("Routines",
getRoutineHtmlFileName,
self.getRoutineDisplayNameByName,
"rtns", sortedRoutinesList,
outputFile, pdf)
Expand All @@ -2720,7 +2724,7 @@ def generateIndividualPackagePage(self):
def generatePackageSection(self, sectionName, htmlMappingFunction,
nameFunction, classid, sortedDataList,
outputFile, pdf, pdfColumnWidths=None,
keyVal=None):
keyVal=None, useColor=True):
if self._generatePDFBundle:
pdfSection = []
else:
Expand All @@ -2731,9 +2735,9 @@ def generatePackageSection(self, sectionName, htmlMappingFunction,
pdfData = self.generateTablizedItemList(sortedDataList, outputFile,
htmlMappingFunction,
nameFunction,
keyVal = keyVal,
classid=classid,
useColor=False)
keyVal = keyVal,
useColor=useColor)
if pdfData and self._generatePDFBundle:
table = self.__generatePDFTable__(pdfData, pdfColumnWidths)
pdfSection.append(table)
Expand Down

0 comments on commit 13880dc

Please sign in to comment.