[CMF-checkins] SVN: CMF_Extras/trunk/CMFCollector/__init__.py Register GS extension profile.

Tres Seaver tseaver at palladion.com
Tue May 22 14:45:51 EDT 2007


Log message for revision 75897:
  Register GS extension profile.

Changed:
  U   CMF_Extras/trunk/CMFCollector/__init__.py

-=-
Modified: CMF_Extras/trunk/CMFCollector/__init__.py
===================================================================
--- CMF_Extras/trunk/CMFCollector/__init__.py	2007-05-22 18:45:30 UTC (rev 75896)
+++ CMF_Extras/trunk/CMFCollector/__init__.py	2007-05-22 18:45:51 UTC (rev 75897)
@@ -16,10 +16,14 @@
 collector_globals = globals()
 
 def initialize(context):
-    from Products.CMFCore.interfaces import ISiteRoot
+    try:
+        from Products.CMFCore.interfaces import ISiteRoot
+    except ImportError:
+        ISiteRoot = None
+    else:
+        from Products.GenericSetup import EXTENSION
+        from Products.GenericSetup import profile_registry
     from Products.CMFCore.DirectoryView import registerDirectory
-    from Products.GenericSetup import EXTENSION
-    from Products.GenericSetup import profile_registry
 
     import Collector
     import CollectorIssue
@@ -93,10 +97,11 @@
     registerDirectory('skins', globals())
     registerDirectory('skins/collector', globals())
 
-    profile_registry.registerProfile('CMFCollector',
-                                     'CMF Collector',
-                                     'Types, skins, workflow for collector.',
-                                     'profiles/collector',
-                                     'CMFCollector',
-                                     EXTENSION,
-                                     for_=ISiteRoot)
+    if ISiteRoot is not None:
+        profile_registry.registerProfile('CMFCollector',
+                                        'CMF Collector',
+                                        'Types, skins, workflow for collector.',
+                                        'profiles/collector',
+                                        'CMFCollector',
+                                        EXTENSION,
+                                        for_=ISiteRoot)



More information about the CMF-checkins mailing list