dna: Simplify DNALandmarkBuilding.getTitle()

This commit is contained in:
Sam Edwards 2014-04-26 17:55:29 -06:00
parent 8d454e9de0
commit 024bbdee05
2 changed files with 6 additions and 6 deletions

View file

@ -16,7 +16,7 @@ class DNALandmarkBuilding(DNANode):
self.type = type
def getTitle(self):
return DNANode._DNANode__getAttribute(self, DNATitle, 'title', '')
return self._getAttribute(self, DNATitle, 'title', '')
def setupSuitBuildingOrigin(self, nodePathA, nodePathB):
if self.id[0:2] == 'tb' and self.id[2].isdigit() and self.id.find(':') != -1:

View file

@ -12,7 +12,7 @@ class DNANode(DNAGroup):
DEPTH_OFFSET = 3
def __getAttribute(self, type, member, default):
def _getAttribute(self, type, member, default):
children = self.findChildren(type)
if not children:
return default
@ -20,15 +20,15 @@ class DNANode(DNAGroup):
return getattr(children[0], member)
def getPos(self):
return self.__getAttribute(DNAPos, 'pos', (0.0, 0.0, 0.0))
return self._getAttribute(DNAPos, 'pos', (0.0, 0.0, 0.0))
def getHpr(self):
return self.__getAttribute(DNAHpr, 'hpr', (0.0, 0.0, 0.0))
return self._getAttribute(DNAHpr, 'hpr', (0.0, 0.0, 0.0))
def getScale(self):
return self.__getAttribute(DNAScale, 'scale', (1.0, 1.0, 1.0))
return self._getAttribute(DNAScale, 'scale', (1.0, 1.0, 1.0))
def getColor(self):
return self.__getAttribute(DNAColor, 'color', (1.0, 1.0, 1.0, 1.0))
return self._getAttribute(DNAColor, 'color', (1.0, 1.0, 1.0, 1.0))
registerElement(DNANode)