[Checkins] SVN: Products.Five/trunk/zcml.py Replaced error when missing site.zcml with a warning.

Rocky Burt rocky at serverzen.com
Wed May 31 11:12:30 EDT 2006


Log message for revision 68410:
  Replaced error when missing site.zcml with a warning.

Changed:
  U   Products.Five/trunk/zcml.py

-=-
Modified: Products.Five/trunk/zcml.py
===================================================================
--- Products.Five/trunk/zcml.py	2006-05-31 13:38:24 UTC (rev 68409)
+++ Products.Five/trunk/zcml.py	2006-05-31 15:12:29 UTC (rev 68410)
@@ -15,6 +15,7 @@
 
 $Id$
 """
+import warnings
 import os
 from zope.configuration import xmlconfig
 
@@ -33,6 +34,7 @@
     # load instance site configuration file
     site_zcml = os.path.join(INSTANCE_HOME, "etc", "site.zcml")
     skel_site_zcml = os.path.join(INSTANCE_HOME, "skel", "etc", "site.zcml")
+    skel_site2_zcml = os.path.join(ZOPE_HOME, "skel", "etc", "site.zcml")
     
     if os.path.exists(site_zcml):
         file = site_zcml
@@ -40,11 +42,12 @@
         # check for zope installation home skel during running unit tests
         file = skel_site_zcml
     else:
-        msg = "site.zcml is now required to live at '%s', for " \
-              "sites upgraded from Zope 2.9 please copy site.zcml " \
-              "from your installed Zope's skel/etc directory" \
-              % site_zcml 
-        raise IOError(msg)
+        file = skel_site2_zcml
+        msg = "site.zcml should now live at '%s', for " \
+              "sites upgraded from Zope 2.9 please copy '%s' " \
+              "to '%s'" \
+              % (site_zcml, skel_site2_zcml, site_zcml)
+        warnings.warn(msg, DeprecationWarning)
 
     global _context
     _context = xmlconfig.file(file)



More information about the Checkins mailing list