# HG changeset patch # User Sylvain Thénault # Date 1282722175 -7200 # Node ID 65f5e488f983ad1045f3b53681192abd1d3d7ad7 # Parent 440df442d70583664116d8b60848ef1012d04fca update to lgc.clcommands 0.51 api diff -r 440df442d705 -r 65f5e488f983 __pkginfo__.py --- a/__pkginfo__.py Fri Aug 20 17:08:08 2010 +0200 +++ b/__pkginfo__.py Wed Aug 25 09:42:55 2010 +0200 @@ -40,7 +40,7 @@ ] __depends__ = { - 'logilab-common': '>= 0.50.2', + 'logilab-common': '>= 0.51.0', 'logilab-mtconverter': '>= 0.8.0', 'rql': '>= 0.26.2', 'yams': '>= 0.29.1', diff -r 440df442d705 -r 65f5e488f983 cwconfig.py --- a/cwconfig.py Fri Aug 20 17:08:08 2010 +0200 +++ b/cwconfig.py Wed Aug 25 09:42:55 2010 +0200 @@ -297,7 +297,6 @@ # nor remove appobjects based on unused interface [???] cleanup_interface_sobjects = True - if (CWDEV and _forced_mode != 'system'): mode = 'user' _CUBES_DIR = join(CW_SOFTWARE_ROOT, '../cubes') diff -r 440df442d705 -r 65f5e488f983 cwctl.py --- a/cwctl.py Fri Aug 20 17:08:08 2010 +0200 +++ b/cwctl.py Wed Aug 25 09:42:55 2010 +0200 @@ -37,12 +37,15 @@ from os.path import exists, join, isfile, isdir, dirname, abspath -from logilab.common.clcommands import register_commands, pop_arg +from logilab.common.clcommands import CommandLine from logilab.common.shellutils import ASK from cubicweb import ConfigurationError, ExecutionError, BadCommandUsage from cubicweb.cwconfig import CubicWebConfiguration as cwcfg, CWDEV, CONFIGURATIONS -from cubicweb.toolsutils import Command, main_run, rm, create_dir, underline_title +from cubicweb.toolsutils import Command, rm, create_dir, underline_title +from cubicweb.__pkginfo__ import version + +CWCTL = CommandLine('cubicweb-ctl', 'The CubicWeb swiss-knife.', version=version) def wait_process_end(pid, maxtry=10, waittime=1): """wait for a process to actually die""" @@ -301,6 +304,7 @@ """ name = 'create' arguments = ' ' + min_args = max_args = 2 options = ( ("config-level", {'short': 'l', 'type' : 'int', 'metavar': '', @@ -325,8 +329,8 @@ """run the command with its specific arguments""" from logilab.common.textutils import splitstrip configname = self.config.config - cubes = splitstrip(pop_arg(args, 1)) - appid = pop_arg(args) + appid, cubes = args + cubes = splitstrip(cubes) # get the configuration and helper config = cwcfg.config_for(appid, configname) config.set_language = False @@ -415,12 +419,12 @@ """ name = 'delete' arguments = '' - + min_args = max_args = 1 options = () def run(self, args): """run the command with its specific arguments""" - appid = pop_arg(args, msg="No instance specified !") + appid = args[0] configs = [cwcfg.config_for(appid, configname) for configname in cwcfg.possible_configurations(appid)] if not configs: @@ -796,6 +800,7 @@ """ name = 'shell' arguments = ' [batch command file(s)] [--