cubicweb/pyramid/pyramidctl.py
changeset 12053 c3c9f2e1424c
parent 12003 5236ce988805
child 12216 4de5927871f9
--- a/cubicweb/pyramid/pyramidctl.py	Fri Mar 10 12:02:41 2017 +0100
+++ b/cubicweb/pyramid/pyramidctl.py	Thu Mar 09 16:36:33 2017 +0100
@@ -41,7 +41,8 @@
 from cubicweb.cwconfig import CubicWebConfiguration as cwcfg
 from cubicweb.cwctl import CWCTL, InstanceCommand, init_cmdline_log_threshold
 from cubicweb.pyramid import wsgi_application_from_cwconfig
-from cubicweb.server import set_debug
+from cubicweb.server import serverctl, set_debug
+from cubicweb.web.webctl import WebCreateHandler
 
 import waitress
 
@@ -51,6 +52,17 @@
 LOG_LEVELS = ('debug', 'info', 'warning', 'error')
 
 
+class PyramidCreateHandler(serverctl.RepositoryCreateHandler,
+                           WebCreateHandler):
+    cfgname = 'pyramid'
+
+    def bootstrap(self, cubes, automatic=False, inputlevel=0):
+        serverctl.RepositoryCreateHandler.bootstrap(self, cubes, automatic, inputlevel)
+        # Call WebCreateHandler.bootstrap to prompt about get anonymous-user.
+        WebCreateHandler.bootstrap(self, cubes, automatic, inputlevel)
+        self.config.write_development_ini(cubes)
+
+
 class PyramidStartHandler(InstanceCommand):
     """Start an interactive pyramid server.