web/views/debug.py
changeset 10923 846e5676ca39
parent 10922 7d01c8c675a0
child 10924 2125def9498b
equal deleted inserted replaced
10922:7d01c8c675a0 10923:846e5676ca39
    71     def call(self, **kwargs):
    71     def call(self, **kwargs):
    72         req = self._cw
    72         req = self._cw
    73         dtformat = req.property_value('ui.datetime-format')
    73         dtformat = req.property_value('ui.datetime-format')
    74         _ = req._
    74         _ = req._
    75         w = self.w
    75         w = self.w
       
    76         repo = req.cnx.repo
    76         # generic instance information
    77         # generic instance information
    77         w(u'<h2>%s</h2>' % _('Instance'))
    78         w(u'<h2>%s</h2>' % _('Instance'))
    78         w(u'<table>')
    79         w(u'<table>')
    79         w(u'<tr><th align="left">%s</th><td>%s</td></tr>' % (
    80         w(u'<tr><th align="left">%s</th><td>%s</td></tr>' % (
    80             _('config type'), self._cw.vreg.config.name))
    81             _('config type'), self._cw.vreg.config.name))
    81         w(u'<tr><th align="left">%s</th><td>%s</td></tr>' % (
    82         w(u'<tr><th align="left">%s</th><td>%s</td></tr>' % (
    82             _('config mode'), self._cw.vreg.config.mode))
    83             _('config mode'), self._cw.vreg.config.mode))
    83         w(u'<tr><th align="left">%s</th><td>%s</td></tr>' % (
    84         w(u'<tr><th align="left">%s</th><td>%s</td></tr>' % (
    84             _('instance home'), self._cw.vreg.config.apphome))
    85             _('instance home'), self._cw.vreg.config.apphome))
    85         w(u'</table>')
    86         w(u'</table>')
    86         vcconf = req.cnx.repo.get_versions()
    87         vcconf = repo.get_versions()
    87         w(u'<h3>%s</h3>' % _('versions configuration'))
    88         w(u'<h3>%s</h3>' % _('versions configuration'))
    88         w(u'<table>')
    89         w(u'<table>')
    89         w(u'<tr><th align="left">%s</th><td>%s</td></tr>' % (
    90         w(u'<tr><th align="left">%s</th><td>%s</td></tr>' % (
    90             'CubicWeb', vcconf.get('cubicweb', _('no version information'))))
    91             'CubicWeb', vcconf.get('cubicweb', _('no version information'))))
    91         for cube in sorted(self._cw.vreg.config.cubes()):
    92         for cube in sorted(self._cw.vreg.config.cubes()):
    92             cubeversion = vcconf.get(cube, _('no version information'))
    93             cubeversion = vcconf.get(cube, _('no version information'))
    93             w(u'<tr><th align="left">%s</th><td>%s</td></tr>' % (
    94             w(u'<tr><th align="left">%s</th><td>%s</td></tr>' % (
    94                 cube, cubeversion))
    95                 cube, cubeversion))
    95         w(u'</table>')
    96         w(u'</table>')
    96         # repository information
    97         # repository information
    97         repo = req.vreg.config.repository(None)
       
    98         w(u'<h2>%s</h2>' % _('Repository'))
    98         w(u'<h2>%s</h2>' % _('Repository'))
    99         w(u'<h3>%s</h3>' % _('resources usage'))
    99         w(u'<h3>%s</h3>' % _('resources usage'))
   100         w(u'<table>')
   100         w(u'<table>')
   101         stats = self._cw.call_service('repo_stats')
   101         stats = self._cw.call_service('repo_stats')
   102         stats['looping_tasks'] = ', '.join('%s (%s seconds)' % (n, i) for n, i in stats['looping_tasks'])
   102         stats['looping_tasks'] = ', '.join('%s (%s seconds)' % (n, i) for n, i in stats['looping_tasks'])