[Zope-Checkins] CVS: Packages/OFS - Application.py:1.191.2.12

Tino Wildenhain tino at wildenhain.de
Fri Nov 26 04:58:06 EST 2004


Update of /cvs-repository/Packages/OFS
In directory cvs.zope.org:/tmp/cvs-serv16357/lib/python/OFS

Modified Files:
      Tag: Zope-2_7-branch
	Application.py 
Log Message:
Default creation of Virtual Host Monster as 'virtual_hosting'
during App initializing. 
Added test
Fixed test of SiteAccess product
Part of collector issue #1568


=== Packages/OFS/Application.py 1.191.2.11 => 1.191.2.12 ===
--- Packages/OFS/Application.py:1.191.2.11	Sat May 22 23:51:55 2004
+++ Packages/OFS/Application.py	Fri Nov 26 04:57:36 2004
@@ -290,7 +290,7 @@
     def commit(self, note):
         get_transaction().note(note)
         get_transaction().commit()
-        
+
     def initialize(self):
         app = self.getApp()
         # make sure to preserve relative ordering of calls below.
@@ -302,8 +302,9 @@
         self.install_zglobals()
         self.install_inituser()
         self.install_errorlog()
-        self.install_products() 
+        self.install_products()
         self.install_standards()
+        self.install_virtual_hosting()
         self.check_zglobals()
 
     def install_cp_and_products(self):
@@ -315,7 +316,7 @@
             cpl._init()
             app._setObject('Control_Panel', cpl)
             self.commit('Added Control_Panel')
-        
+
         # b/c: Ensure that a ProductFolder exists.
         if not hasattr(aq_base(app.Control_Panel), 'Products'):
             app.Control_Panel.Products=App.Product.ProductFolder()
@@ -377,7 +378,7 @@
             default_limit = 1000
             default_period_secs = 20
             default_timeout_mins = 20
-            
+
             limit = (getattr(config, 'maximum_number_of_session_objects', None)
                      or default_limit)
             timeout_spec = getattr(config, 'session_timeout_minutes',
@@ -451,7 +452,7 @@
 
     def install_required_roles(self):
         app = self.getApp()
-        
+
         # Ensure that Owner role exists.
         if hasattr(app, '__ac_roles__') and not ('Owner' in app.__ac_roles__):
             app.__ac_roles__=app.__ac_roles__ + ('Owner',)
@@ -497,6 +498,18 @@
             app._setInitializerFlag('error_log')
             self.commit('Added site error_log at /error_log')
 
+    def install_virtual_hosting(self):
+        app = self.getApp()
+        if app._getInitializerFlag('virtual_hosting'):
+            return
+        if not hasattr(app, 'virtual_hosting'):
+            from Products.SiteAccess.VirtualHostMonster import VirtualHostMonster
+            vhm=VirtualHostMonster()
+            vhm.id='virtual_hosting'
+            vhm.addToContainer(app)
+            app._setInitializerFlag('virtual_hosting')
+            self.commit('Added virtual_hosting')
+
     def check_zglobals(self):
         if not doInstall():
             return
@@ -610,7 +623,7 @@
                      os.path.exists(os.path.join(fullpath, '__init__.pyo')) or
                      os.path.exists(os.path.join(fullpath, '__init__.pyc')) ):
                     # import PluginIndexes 1st (why?)
-                    priority = (name != 'PluginIndexes') 
+                    priority = (name != 'PluginIndexes')
                     # i is used as sort ordering in case a conflict exists
                     # between Product names.  Products will be found as
                     # per the ordering of Products.__path__



More information about the Zope-Checkins mailing list