# HG changeset patch # User Denis Laxalde # Date 1430300375 -7200 # Node ID f9473eb6a8a9a3187bec6bd0069871874c6d07a5 # Parent a49f08423f02c6f32d8fadc3467a25519d071e60 Make debug mode usable without pyramid_debugtoolbar Add the latter in Debian recommends along the way. Closes #5310434. diff -r a49f08423f02 -r f9473eb6a8a9 debian/control --- a/debian/control Thu Feb 26 00:56:32 2015 +0100 +++ b/debian/control Wed Apr 29 11:39:35 2015 +0200 @@ -22,6 +22,8 @@ python-waitress (>= 0.8.9), cubicweb-common (>= 3.19.3), # XXX wsgicors? +Recommends: + python-pyramid_debugtoolbar Description: Integrate CubicWeb with a Pyramid application Provides pyramid extensions to load a CubicWeb instance and serve it through the pyramid stack. diff -r a49f08423f02 -r f9473eb6a8a9 pyramid_cubicweb/__init__.py --- a/pyramid_cubicweb/__init__.py Thu Feb 26 00:56:32 2015 +0100 +++ b/pyramid_cubicweb/__init__.py Wed Apr 29 11:39:35 2015 +0200 @@ -1,4 +1,5 @@ import os +from warnings import warn import wsgicors from cubicweb.cwconfig import CubicWebConfiguration as cwcfg @@ -43,7 +44,11 @@ config = Configurator(settings=settings) if cwconfig.debugmode: - config.include('pyramid_debugtoolbar') + try: + config.include('pyramid_debugtoolbar') + except ImportError: + warn('pyramid_debugtoolbar package not available, install it to ' + 'get UI debug features', RuntimeWarning) config.registry['cubicweb.config'] = cwconfig config.registry['cubicweb.repository'] = repo = cwconfig.repository() config.registry['cubicweb.registry'] = repo.vreg