def varExists(self, varName, autoCall=False, useDottedNotation=True): """Test if a variable name exists in the searchList.""" try: valueFromSearchList(self.searchList(), varName.replace('$', ''), autoCall, useDottedNotation) return True except NotFound: return False
def getVar(self, varName, default=Unspecified, autoCall=True, useDottedNotation=True): """Get a variable from the searchList. If the variable can't be found in the searchList, it returns the default value if one was given, or raises NameMapper.NotFound. """ try: return valueFromSearchList(self.searchList(), varName.replace('$', ''), autoCall, useDottedNotation) except NotFound: if default is not Unspecified: return default else: raise
def getVar(self, varName, default=UNSPECIFIED, autoCall=True, useDottedNotation=True): """Get a variable from the searchList. If the variable can't be found in the searchList, it returns the default value if one was given, or raises NameMapper.NotFound. """ assert '$' not in varName, varName try: return valueFromSearchList(self.searchList(), varName, autoCall, useDottedNotation) except NotFound: if default is not UNSPECIFIED: return default else: raise
def VFS(self, searchList, name, autocall=True): return valueFromSearchList(searchList, name, autocall)