[PATCH 1 of 3 cubicweb update-skel-pkg] [devtools] Allow to specify short desc on `newcube` command line

Jérémy Bobbio jeremy.bobbio at irq7.fr
Sun Jun 23 09:12:39 CEST 2019


# HG changeset patch
# User Jérémy Bobbio <jeremy.bobbio at irq7.fr>
# Date 1560785016 -7200
#      Mon Jun 17 17:23:36 2019 +0200
# Node ID 2ecebc8d87b7dd1c2003ad6c4e45d466fa37a4ad
# Parent  fdd7165fe1f302961bab2c51585890c4c275812a
# EXP-Topic update-skel-pkg
[devtools] Allow to specify short desc on `newcube` command line

In order to implement automated testing of `cubicweb-ctl newcube`, we
need to avoid any user interaction. So we add a `-s` switch to specify
a short description on the command-line instead of requiring an input.

diff -r fdd7165fe1f3 -r 2ecebc8d87b7 cubicweb/devtools/devctl.py
--- a/cubicweb/devtools/devctl.py	Wed Jun 19 16:33:15 2019 +0200
+++ b/cubicweb/devtools/devctl.py	Mon Jun 17 17:23:36 2019 +0200
@@ -612,6 +612,11 @@
           'help': 'verbose mode: will ask all possible configuration questions',
           }
          ),
+        ("short-description",
+         {'short': 's', 'type': 'string', 'metavar': '<short description',
+          'help': 'short description for the cube',
+         }
+         ),
         ("author",
          {'short': 'a', 'type' : 'string', 'metavar': '<author>',
           'default': 'LOGILAB S.A. (Paris, FRANCE)',
@@ -707,7 +712,7 @@
         if osp.exists(cubedir):
             self.fail("%s already exists!" % cubedir)
         skeldir = osp.join(BASEDIR, 'skeleton')
-        longdesc = shortdesc = input(
+        longdesc = shortdesc = self['short-description'] or input(
             'Enter a short description for your cube: ')
         if verbose:
             longdesc = input(


More information about the cubicweb-devel mailing list