web/views/debug.py
changeset 5849 9db65b381028
parent 5825 2daf1ac79d5c
child 5963 4d75f743ed49
equal deleted inserted replaced
5840:60880c81e32e 5849:9db65b381028
    13 # FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more
    13 # FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more
    14 # details.
    14 # details.
    15 #
    15 #
    16 # You should have received a copy of the GNU Lesser General Public License along
    16 # You should have received a copy of the GNU Lesser General Public License along
    17 # with CubicWeb.  If not, see <http://www.gnu.org/licenses/>.
    17 # with CubicWeb.  If not, see <http://www.gnu.org/licenses/>.
    18 """management and error screens
    18 """management and error screens"""
    19 
    19 
    20 
       
    21 """
       
    22 __docformat__ = "restructuredtext en"
    20 __docformat__ = "restructuredtext en"
    23 
    21 
    24 from time import strftime, localtime
    22 from time import strftime, localtime
    25 
    23 
    26 from logilab.mtconverter import xml_escape
    24 from logilab.mtconverter import xml_escape
    43     """display various web server /repository information"""
    41     """display various web server /repository information"""
    44     __regid__ = 'info'
    42     __regid__ = 'info'
    45     __select__ = none_rset() & match_user_groups('managers')
    43     __select__ = none_rset() & match_user_groups('managers')
    46 
    44 
    47     title = _('server information')
    45     title = _('server information')
       
    46     cache_max_age = 0
    48 
    47 
    49     def call(self, **kwargs):
    48     def call(self, **kwargs):
    50         req = self._cw
    49         req = self._cw
    51         dtformat = req.property_value('ui.datetime-format')
    50         dtformat = req.property_value('ui.datetime-format')
    52         _ = req._
    51         _ = req._
   126 class RegistryView(StartupView):
   125 class RegistryView(StartupView):
   127     """display vregistry content"""
   126     """display vregistry content"""
   128     __regid__ = 'registry'
   127     __regid__ = 'registry'
   129     __select__ = StartupView.__select__ & match_user_groups('managers')
   128     __select__ = StartupView.__select__ & match_user_groups('managers')
   130     title = _('registry')
   129     title = _('registry')
       
   130     cache_max_age = 0
   131 
   131 
   132     def call(self, **kwargs):
   132     def call(self, **kwargs):
   133         self.w(u'<h1>%s</h1>' % _("Registry's content"))
   133         self.w(u'<h1>%s</h1>' % _("Registry's content"))
   134         keys = sorted(self._cw.vreg)
   134         keys = sorted(self._cw.vreg)
   135         url = xml_escape(self._cw.url())
   135         url = xml_escape(self._cw.url())
   148 class GCView(StartupView):
   148 class GCView(StartupView):
   149     """display garbage collector information"""
   149     """display garbage collector information"""
   150     __regid__ = 'gc'
   150     __regid__ = 'gc'
   151     __select__ = StartupView.__select__ & match_user_groups('managers')
   151     __select__ = StartupView.__select__ & match_user_groups('managers')
   152     title = _('memory leak debugging')
   152     title = _('memory leak debugging')
       
   153     cache_max_age = 0
   153 
   154 
   154     def call(self, **kwargs):
   155     def call(self, **kwargs):
   155         from cubicweb._gcdebug import gc_info
   156         from cubicweb._gcdebug import gc_info
   156         from rql.stmts import Union
   157         from rql.stmts import Union
   157         from cubicweb.appobject import AppObject
   158         from cubicweb.appobject import AppObject