Show
Ignore:
Timestamp:
08/25/06 19:49:05 (6 years ago)
Author:
mj
Message:

Convert the bootstrap code to using zope.app.generations; more efficient and future proof

Location:
z3wingdbg/trunk/generations
Files:
1 added
1 moved

Legend:

Unmodified
Added
Removed
  • z3wingdbg/trunk/generations/install.py

    r292 r319  
    22# This program is open source.  For license terms, see the LICENSE.txt file. 
    33 
    4 import transaction 
     4from zope.app.appsetup.bootstrap import ensureUtility 
    55 
    6 from zope.app.appsetup.bootstrap import ensureUtility, getInformationFromEvent 
     6from z3wingdbg.interfaces import IWingConfiguration 
     7from z3wingdbg.configuration import WingConfiguration, ensureConfiguration 
     8from z3wingdbg.generations import getRootFolder 
     9from z3wingdbg.server.configuration import DebugServerConfiguration 
    710 
    8 from interfaces import IWingConfiguration 
    9 from configuration import WingConfiguration, ensureConfiguration 
    10 from server.configuration import DebugServerConfiguration 
     11def evolve(context): 
     12    """Create configuration utility if not yet present""" 
    1113 
    12 def bootStrapSubscriber(event): 
    13     """Subscriber to the IDataBaseOpenedEvent 
    14  
    15     Create configuration utility at that time if not yet present 
    16     """ 
    17  
    18     db, connection, root, root_folder = getInformationFromEvent(event) 
     14    root_folder = getRootFolder(context) 
    1915 
    2016    ensureUtility(root_folder, IWingConfiguration, 'WingConfiguration',  
     
    2319    ensureConfiguration(root_folder, u'http', DebugServerConfiguration, 
    2420                        port=50080) 
    25      
    26     transaction.commit() 
    27     connection.close()