[Zope-Checkins] CVS: Zope/lib/python/Controller - __init__.py:1.1.2.4
Fred L. Drake, Jr.
fred@zope.com
Fri, 6 Dec 2002 11:10:07 -0500
Update of /cvs-repository/Zope/lib/python/Controller
In directory cvs.zope.org:/tmp/cvs-serv8300
Modified Files:
Tag: chrism-install-branch
__init__.py
Log Message:
- convert imports to Python Normal Form
- reflect changes in the ZConfig package
- minor changes
=== Zope/lib/python/Controller/__init__.py 1.1.2.3 => 1.1.2.4 ===
--- Zope/lib/python/Controller/__init__.py:1.1.2.3 Tue Dec 3 13:35:12 2002
+++ Zope/lib/python/Controller/__init__.py Fri Dec 6 11:10:07 2002
@@ -1,8 +1,12 @@
""" Controller package. Responsible for startup configuration of Zope """
-from SchemaHandler import ZopeContext
-from ZConfig.SchemaParser import KEY_TYPE
-from ZConfig.Common import ConfigurationError
+
import os
+
+from ZConfig import ConfigurationError
+from ZConfig.SchemaParser import KEY_TYPE
+
+from SchemaHandler import ZopeContext
+
configuration = None
def getSchemaLocation():
@@ -11,16 +15,15 @@
return schema
def getSchemaContext():
- context = ZopeContext()
- return context
+ return ZopeContext()
def getSchemaKeys():
- f = getSchemaLocation()
context = getSchemaContext()
- context.loadschema(f)
+ context.loadschema(getSchemaLocation())
return context.getConfig().keys()
def configure(config_location, overrides):
+ global configuration
schema = getSchemaLocation()
context = getSchemaContext()
context.loadschema(schema)
@@ -29,6 +32,5 @@
for name, value in overrides.items():
key = config.getSub(KEY_TYPE, KEY_TYPE, name)
key.setValue(value)
- global configuration
configuration = config.getValue()
return configuration