cubicweb/pyramid/pyramidctl.py
changeset 12780 8caa109dfe94
parent 12751 30b205676182
equal deleted inserted replaced
12779:44147dab9d27 12780:8caa109dfe94
    35 from logilab.common.configuration import merge_options
    35 from logilab.common.configuration import merge_options
    36 
    36 
    37 from cubicweb.cwctl import CWCTL, InstanceCommand, init_cmdline_log_threshold
    37 from cubicweb.cwctl import CWCTL, InstanceCommand, init_cmdline_log_threshold
    38 from cubicweb.pyramid import wsgi_application_from_cwconfig
    38 from cubicweb.pyramid import wsgi_application_from_cwconfig
    39 from cubicweb.pyramid.config import get_random_secret_key
    39 from cubicweb.pyramid.config import get_random_secret_key
       
    40 from cubicweb.view import inject_html_generating_call_on_w
    40 from cubicweb.server import serverctl
    41 from cubicweb.server import serverctl
    41 from cubicweb.web.webctl import WebCreateHandler
    42 from cubicweb.web.webctl import WebCreateHandler
    42 from cubicweb.toolsutils import fill_templated_file
    43 from cubicweb.toolsutils import fill_templated_file
    43 
    44 
    44 import waitress
    45 import waitress
   269                       "'pip install pyramid_debugtoolbar'.\nYou can find more information on the "
   270                       "'pip install pyramid_debugtoolbar'.\nYou can find more information on the "
   270                       "official documentation: "
   271                       "official documentation: "
   271                       "https://docs.pylonsproject.org/projects/pyramid_debugtoolbar/en/latest/")
   272                       "https://docs.pylonsproject.org/projects/pyramid_debugtoolbar/en/latest/")
   272                 sys.exit(1)
   273                 sys.exit(1)
   273 
   274 
       
   275         if self['debug']:
       
   276             # this is for injecting those into generated html:
       
   277             # > cubicweb-generated-by="module.Class" cubicweb-from-source="/path/to/file.py:42"
       
   278             inject_html_generating_call_on_w()
       
   279 
   274         app = wsgi_application_from_cwconfig(
   280         app = wsgi_application_from_cwconfig(
   275             cwconfig, profile=self['profile'],
   281             cwconfig, profile=self['profile'],
   276             profile_output=self['profile-output'],
   282             profile_output=self['profile-output'],
   277             profile_dump_every=self['profile-dump-every'],
   283             profile_dump_every=self['profile-dump-every'],
   278             debugtoolbar=self['toolbar']
   284             debugtoolbar=self['toolbar']