[cig-commits] r7799 - in cs/pythia/trunk/opal: components conf sites
leif at geodynamics.org
leif at geodynamics.org
Thu Aug 9 19:13:13 PDT 2007
Author: leif
Date: 2007-08-09 19:13:13 -0700 (Thu, 09 Aug 2007)
New Revision: 7799
Modified:
cs/pythia/trunk/opal/components/WebComponent.py
cs/pythia/trunk/opal/conf/__init__.py
cs/pythia/trunk/opal/sites/WebSite.py
Log:
Minor tweaks while OOP/Opal-izing SeismoWebPortal.
Modified: cs/pythia/trunk/opal/components/WebComponent.py
===================================================================
--- cs/pythia/trunk/opal/components/WebComponent.py 2007-08-09 22:57:28 UTC (rev 7798)
+++ cs/pythia/trunk/opal/components/WebComponent.py 2007-08-10 02:13:13 UTC (rev 7799)
@@ -68,12 +68,12 @@
# generic views -- CRUD
- def genericCreateObject(self, request, model, query, post_save_redirect=None, follow=None, **kwds):
+ def genericCreateObject(self, request, model, post_save_redirect=None, follow=None, **kwds):
controller = controllers.CreationController(
post_redirect = post_save_redirect,
follow = follow,
)
- view = views.DetailView(model, query, controller = controller, **kwds)
+ view = views.DetailView(model, None, controller = controller, **kwds)
return view.response(request)
Modified: cs/pythia/trunk/opal/conf/__init__.py
===================================================================
--- cs/pythia/trunk/opal/conf/__init__.py 2007-08-09 22:57:28 UTC (rev 7798)
+++ cs/pythia/trunk/opal/conf/__init__.py 2007-08-10 02:13:13 UTC (rev 7799)
@@ -10,9 +10,16 @@
curator.config(registry)
site.setCurator(curator)
curator.depositories += site.inventory.getDepositories()
+
+ context = site.newConfigContext()
site.initializeConfiguration()
- site.applyConfiguration()
+ site.applyConfiguration(context)
+
+ if not context.verifyConfiguration(site, 'strict'):
+ raise RuntimeError("%s: configuration error(s)" % site.name)
+
site.init()
+
return site
settings = getWebSite()
Modified: cs/pythia/trunk/opal/sites/WebSite.py
===================================================================
--- cs/pythia/trunk/opal/sites/WebSite.py 2007-08-09 22:57:28 UTC (rev 7798)
+++ cs/pythia/trunk/opal/sites/WebSite.py 2007-08-10 02:13:13 UTC (rev 7799)
@@ -351,13 +351,14 @@
#########
SITE_ID = pyre.int("site-id", default=1)
- rootUrlconf = pyre.str("root-urlconf", default=None)
+ #rootUrlconf = pyre.str("root-urlconf", default=None)
+ rootUrlconf = pyre.facility("root", default=None)
def _configure(self):
super(WebSite, self)._configure()
- if self.rootUrlconf is None:
+ if False and self.rootUrlconf is None:
raise ValueError("root-urlconf is not set")
# convert to seconds
@@ -387,8 +388,7 @@
from opal.core import urlresolvers
if self.ROOT_URLCONF is None:
- factory = loadObject(self.rootUrlconf)
- self.ROOT_URLCONF = factory()
+ self.ROOT_URLCONF = self.rootUrlconf
return urlresolvers.RegexURLResolver(r'^/', self.ROOT_URLCONF)
More information about the cig-commits
mailing list