This commit is contained in:
Miroslav Stampar 2011-07-27 08:25:51 +00:00
parent f7eaffcec5
commit 107089c00b
2 changed files with 20 additions and 16 deletions

View File

@ -524,7 +524,7 @@ Thierry Zoller <thierry@zoller.lu>
for reporting a minor bug
1ndr4 joe <c0d3w4st3r@gmail.com>
for reporting a minor bug
for reporting a couple of bugs
abc abc <biedimc@gmx.net>
for reporting a minor bug

View File

@ -1957,27 +1957,31 @@ def getPartRun():
retVal = None
commonPartsDict = optDict["Enumeration"]
stack = [item[4][0] if isinstance(item[4], list) else '' for item in inspect.stack()]
reobj1 = getCompiledRegex('conf\.dbmsHandler\.([^(]+)\(\)')
reobj2 = getCompiledRegex('self\.(get[^(]+)\(\)')
# Goes backwards through the stack to find the conf.dbmsHandler method
# calling this function
for i in xrange(0, len(stack)-1):
for reobj in (reobj2, reobj1):
match = reobj.search(stack[i])
try:
stack = [item[4][0] if isinstance(item[4], list) else '' for item in inspect.stack()]
if match:
# This is the calling conf.dbmsHandler or self method
# (e.g. 'getDbms')
retVal = match.groups()[0]
# Goes backwards through the stack to find the conf.dbmsHandler method
# calling this function
for i in xrange(0, len(stack)-1):
for regex in (getCompiledRegex('self\.(get[^(]+)\(\)'), getCompiledRegex('conf\.dbmsHandler\.([^(]+)\(\)')):
match = regex.search(stack[i])
if match:
# This is the calling conf.dbmsHandler or self method
# (e.g. 'getDbms')
retVal = match.groups()[0]
break
if retVal is not None:
break
if retVal is not None:
break
# Reference: http://coding.derkeiler.com/Archive/Python/comp.lang.python/2004-06/2267.html
except TypeError:
pass
# Return the INI tag to consider for common outputs (e.g. 'Databases')
return commonPartsDict[retVal][1] if retVal in commonPartsDict else retVal
return commonPartsDict[retVal][1] if isinstance(commonPartsDict.get(retVal), tuple) else retVal
def getUnicode(value, encoding=None, system=False):
"""