NameMapper.py (cheetah3-3.2.1) | : | NameMapper.py (cheetah3-3.2.2) | ||
---|---|---|---|---|
skipping to change at line 224 | skipping to change at line 224 | |||
nameChunks = name.split('.') | nameChunks = name.split('.') | |||
for key in nameChunks: | for key in nameChunks: | |||
if isinstance(obj, Mapping) and key in obj: | if isinstance(obj, Mapping) and key in obj: | |||
nextObj = obj[key] | nextObj = obj[key] | |||
else: | else: | |||
try: | try: | |||
nextObj = getattr(obj, key) | nextObj = getattr(obj, key) | |||
except AttributeError: | except AttributeError: | |||
_raiseNotFoundException(key, obj) | _raiseNotFoundException(key, obj) | |||
if executeCallables and hasattr(nextObj, '__call__') and \ | if executeCallables and callable(nextObj) and \ | |||
not _isInstanceOrClass(nextObj): | not _isInstanceOrClass(nextObj): | |||
obj = nextObj() | obj = nextObj() | |||
else: | else: | |||
obj = nextObj | obj = nextObj | |||
return obj | return obj | |||
def _namespaces(callerFrame, searchList=None): | def _namespaces(callerFrame, searchList=None): | |||
yield callerFrame.f_locals | yield callerFrame.f_locals | |||
if searchList: | if searchList: | |||
for namespace in searchList: | for namespace in searchList: | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added |