"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "Cheetah/ImportHooks.py" between
cheetah3-3.2.2.tar.gz and cheetah3-3.2.3.tar.gz

About: Cheetah3 is a template engine and code generation tool for e.g. for Web development or Java, SQL, LaTeX, form email ... (written in Python).

ImportHooks.py  (cheetah3-3.2.2):ImportHooks.py  (cheetah3-3.2.3)
skipping to change at line 123 skipping to change at line 123
def install(templateFileExtensions=('.tmpl',)): def install(templateFileExtensions=('.tmpl',)):
"""Install the Cheetah Import Hooks""" """Install the Cheetah Import Hooks"""
global _installed global _installed
if not _installed: if not _installed:
CheetahDirOwner.templateFileExtensions = templateFileExtensions CheetahDirOwner.templateFileExtensions = templateFileExtensions
if isinstance(builtin.__import__, types.BuiltinFunctionType): if isinstance(builtin.__import__, types.BuiltinFunctionType):
global __oldimport__ global __oldimport__
__oldimport__ = builtin.__import__ ImportManager.__oldimport__ = __oldimport__ = builtin.__import__
ImportManager._globalOwnerTypes.insert(0, CheetahDirOwner) ImportManager._globalOwnerTypes.insert(0, CheetahDirOwner)
# ImportManager._globalOwnerTypes.append(CheetahDirOwner)
global _manager global _manager
_manager = ImportManager.ImportManager() _manager = ImportManager.ImportManager()
_manager.setThreaded() _manager.setThreaded()
_manager.install() _manager.install()
_installed = True _installed = True
def uninstall(): def uninstall():
"""Uninstall the Cheetah Import Hooks""" """Uninstall the Cheetah Import Hooks"""
global _installed global _installed
if _installed: if _installed:
if isinstance(builtin.__import__, types.MethodType): if isinstance(builtin.__import__, types.MethodType):
builtin.__import__ = __oldimport__ builtin.__import__ = __oldimport__
if ImportManager._globalOwnerTypes[0] is CheetahDirOwner:
del ImportManager._globalOwnerTypes[0]
del ImportManager.__oldimport__
global _manager global _manager
del _manager del _manager
_installed = False _installed = False
 End of changes. 3 change blocks. 
2 lines changed or deleted 4 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)