[CMF-checkins] CVS: CMF/CMFCore - __init__.py:1.13.2.1

Tres Seaver tseaver@zope.com
Fri, 21 Dec 2001 00:44:44 -0500


Update of /cvs-repository/CMF/CMFCore
In directory cvs.zope.org:/tmp/cvs-serv1853/CMFCore

Modified Files:
      Tag: CMF-1_2-branch
	__init__.py 
Log Message:


  - Hardened CMFCore to initialize correctly in the absence of
    the PageTemplates product (Tracker #430).



=== CMF/CMFCore/__init__.py 1.13 => 1.13.2.1 ===
 import ContentTypeRegistry
 import utils
-import FSPageTemplate
+
+try:
+    import FSPageTemplate
+except ImportError:
+    HAS_PAGE_TEMPLATES = 0
+else:
+    HAS_PAGE_TEMPLATES = 1
+
 
 ADD_FOLDERS_PERMISSION = 'Add portal folders'
 
@@ -87,8 +94,9 @@
         icon = 'images/registry.gif'
         )
 
-    utils.registerIcon(FSPageTemplate.FSPageTemplate,
-                      'images/fspt.gif', globals())
+    if HAS_PAGE_TEMPLATES:
+        utils.registerIcon(FSPageTemplate.FSPageTemplate,
+                        'images/fspt.gif', globals())
     utils.registerIcon(FSDTMLMethod.FSDTMLMethod,
                        'images/fsdtml.gif', globals())
     utils.registerIcon(FSPythonScript.FSPythonScript,