--- a/web/views/cwproperties.py Mon Oct 19 17:53:53 2009 +0200
+++ b/web/views/cwproperties.py Mon Oct 19 18:15:24 2009 +0200
@@ -79,7 +79,7 @@
return self._cw.build_url('view', vid=self.__regid__)
def _cookie_name(self, somestr):
- return str('%s_property_%s' % (self._cw.config.appid, somestr))
+ return str('%s_property_%s' % (self._cw.vreg.config.appid, somestr))
def _group_status(self, group, default=u'hidden'):
"""return css class name 'hidden' (collapsed), or '' (open)"""
--- a/web/views/management.py Mon Oct 19 17:53:53 2009 +0200
+++ b/web/views/management.py Mon Oct 19 18:15:24 2009 +0200
@@ -212,7 +212,7 @@
else:
exclass = ex.__class__.__name__
ex = exc_message(ex, req.encoding)
- if excinfo is not None and self._cw.config['print-traceback']:
+ if excinfo is not None and self._cw.vreg.config['print-traceback']:
if exclass is None:
w(u'<div class="tb">%s</div>'
% xml_escape(ex).replace("\n","<br />"))
@@ -226,19 +226,19 @@
# if excinfo is not None, it's probably not a bug
if excinfo is None:
return
- vcconf = self._cw.config.vc_config()
+ vcconf = self._cw.vreg.config.vc_config()
w(u"<div>")
eversion = vcconf.get('cubicweb', self._cw._('no version information'))
# NOTE: tuple wrapping needed since eversion is itself a tuple
w(u"<b>CubicWeb version:</b> %s<br/>\n" % (eversion,))
cversions = []
- for cube in self._cw.config.cubes():
+ for cube in self._cw.vreg.config.cubes():
cubeversion = vcconf.get(cube, self._cw._('no version information'))
w(u"<b>Package %s version:</b> %s<br/>\n" % (cube, cubeversion))
cversions.append((cube, cubeversion))
w(u"</div>")
# creates a bug submission link if submit-mail is set
- if self._cw.config['submit-mail']:
+ if self._cw.vreg.config['submit-mail']:
form = self._cw.vreg['forms'].select('base', self._cw, rset=None,
mainform=False)
binfo = text_error_description(ex, excinfo, req, eversion, cversions)
@@ -281,7 +281,7 @@
def call(self, **kwargs):
"""display server information"""
- vcconf = self._cw.config.vc_config()
+ vcconf = self._cw.vreg.config.vc_config()
req = self._cw
_ = req._
# display main information
@@ -289,12 +289,12 @@
self.w(u'<table border="1">')
self.w(u'<tr><th align="left">%s</th><td>%s</td></tr>' % (
'CubicWeb', vcconf.get('cubicweb', _('no version information'))))
- for pkg in self._cw.config.cubes():
+ for pkg in self._cw.vreg.config.cubes():
pkgversion = vcconf.get(pkg, _('no version information'))
self.w(u'<tr><th align="left">%s</th><td>%s</td></tr>' % (
pkg, pkgversion))
self.w(u'<tr><th align="left">%s</th><td>%s</td></tr>' % (
- _('home'), self._cw.config.apphome))
+ _('home'), self._cw.vreg.config.apphome))
self.w(u'<tr><th align="left">%s</th><td>%s</td></tr>' % (
_('base url'), req.base_url()))
self.w(u'<tr><th align="left">%s</th><td>%s</td></tr>' % (
--- a/web/views/owl.py Mon Oct 19 17:53:53 2009 +0200
+++ b/web/views/owl.py Mon Oct 19 18:15:24 2009 +0200
@@ -66,7 +66,7 @@
def call(self, writeprefix=True):
skipmeta = int(self._cw.form.get('skipmeta', True))
if writeprefix:
- self.w(OWL_OPENING_ROOT % {'appid': self._cw.schema.name})
+ self.w(OWL_OPENING_ROOT % {'appid': self._cw.vreg.schema.name})
self.visit_schema(skiptypes=skipmeta and schema.SKIP_TYPES or ())
if writeprefix:
self.w(OWL_CLOSING_ROOT)
@@ -79,7 +79,7 @@
def visit_schema(self, skiptypes):
"""get a layout for a whole schema"""
self.skiptypes = skiptypes
- entities = sorted(eschema for eschema in self._cw.schema.entities()
+ entities = sorted(eschema for eschema in self._cw.vreg.schema.entities()
if not eschema.final or eschema in skiptypes)
self.w(u'<!-- classes definition -->')
for eschema in entities:
@@ -151,7 +151,7 @@
content_type = 'application/xml' # 'text/xml'
def call(self):
- self.w(OWL_OPENING_ROOT % {'appid': self._cw.schema.name})
+ self.w(OWL_OPENING_ROOT % {'appid': self._cw.vreg.schema.name})
for i in xrange(self.cw_rset.rowcount):
self.cell_call(i, 0)
self.w(OWL_CLOSING_ROOT)
--- a/web/views/tabs.py Mon Oct 19 17:53:53 2009 +0200
+++ b/web/views/tabs.py Mon Oct 19 18:15:24 2009 +0200
@@ -92,7 +92,7 @@
tabkwargs = tabkwargs.copy()
except ValueError:
tabid, tabkwargs = tab, {}
- tabkwargs.setdefault('rset', self.rset)
+ tabkwargs.setdefault('rset', self.cw_rset)
vid = tabkwargs.get('vid', tabid)
try:
viewsvreg.select(vid, self._cw, **tabkwargs)
@@ -136,7 +136,7 @@
w(u'<div id="%s">' % tabid)
tabkwargs.setdefault('tabid', tabid)
tabkwargs.setdefault('vid', tabid)
- tabkwargs.setdefault('rset', self.rset)
+ tabkwargs.setdefault('rset', self.cw_rset)
self.lazyview(**tabkwargs)
w(u'</div>')
# call the set_tab() JS function *after* each tab is generated
--- a/web/views/wdoc.py Mon Oct 19 17:53:53 2009 +0200
+++ b/web/views/wdoc.py Mon Oct 19 18:15:24 2009 +0200
@@ -91,15 +91,16 @@
def call(self):
fid = self._cw.form['fid']
- for lang in chain((self._cw.lang, self._cw.vreg.property_value('ui.language')),
- self._cw.config.available_languages()):
+ vreg = self._cw.vreg
+ for lang in chain((self._cw.lang, vreg.property_value('ui.language')),
+ vreg.config.available_languages()):
rid = '%s_%s.rst' % (fid, lang)
- resourcedir = self._cw.config.locate_doc_file(rid)
+ resourcedir = vreg.config.locate_doc_file(rid)
if resourcedir:
break
else:
raise NotFound
- self.tocindex = build_toc(self._cw.config)
+ self.tocindex = build_toc(vreg.config)
try:
node = self.tocindex[fid]
except KeyError: