~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp_sitecustomize.py

  • Committer: Gary Poster
  • Date: 2010-10-08 14:40:00 UTC
  • mto: This revision was merged to the branch mainline in revision 11704.
  • Revision ID: gary.poster@canonical.com-20101008144000-dvo0xdlb89sk0ici
Allow .lpconfig to be honored if initial configuration is "development"

Show diffs side-by-side

added added

removed removed

Lines of Context:
87
87
        module="Crypto")
88
88
 
89
89
 
90
 
def main():
91
 
    # Note that we configure the LPCONFIG environmental variable in the
92
 
    # custom buildout-generated sitecustomize.py in
93
 
    # parts/scripts/sitecustomize.py rather than here.  This is because
94
 
    # the instance name, ${configuration:instance_name}, is dynamic,
95
 
    # sent to buildout from the Makefile.  See buildout.cfg in the
96
 
    # initialization value of the [scripts] section for the code that
97
 
    # goes into this custom sitecustomize.py.  We do as much other
98
 
    # initialization as possible here, in a more visible place.
 
90
def main(instance_name):
 
91
    # This is called by our custom buildout-generated sitecustomize.py
 
92
    # in parts/scripts/sitecustomize.py. The instance name is sent to
 
93
    # buildout from the Makefile, and then inserted into
 
94
    # sitecustomize.py.  See buildout.cfg in the "initialization" value
 
95
    # of the [scripts] section for the code that goes into this custom
 
96
    # sitecustomize.py.  We do all actual initialization here, in a more
 
97
    # visible place.
 
98
    if instance_name and instance_name != 'development':
 
99
        # See bug 656213 for why we do this carefully.
 
100
        os.environ.setdefault('LPCONFIG', instance_name)
99
101
    os.environ['STORM_CEXTENSIONS'] = '1'
100
102
    add_custom_loglevels()
101
103
    customizeMimetypes()
109
111
    silence_bzr_logger()
110
112
    silence_zcml_logger()
111
113
    silence_transaction_logger()
112
 
 
113
 
main()