[c-c] lgc 0.54 check for duplicated commands, this may occurs with cw where plugins are automaticall (re)loaded stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Fri, 28 Jan 2011 15:12:13 +0100
branchstable
changeset 6914 5be96d9cbedc
parent 6913 ab85124dc0eb
child 6915 99eb71b311e4
[c-c] lgc 0.54 check for duplicated commands, this may occurs with cw where plugins are automaticall (re)loaded
cwctl.py
--- a/cwctl.py	Fri Jan 28 15:11:26 2011 +0100
+++ b/cwctl.py	Fri Jan 28 15:12:13 2011 +0100
@@ -42,11 +42,18 @@
 from logilab.common.shellutils import ASK
 
 from cubicweb import ConfigurationError, ExecutionError, BadCommandUsage
+from cubicweb.utils import support_args
 from cubicweb.cwconfig import CubicWebConfiguration as cwcfg, CWDEV, CONFIGURATIONS
 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)
+if support_args(CommandLine, 'check_duplicated_command'):
+    # don't check duplicated commands, it occurs when reloading site_cubicweb
+    CWCTL = CommandLine('cubicweb-ctl', 'The CubicWeb swiss-knife.',
+                        version=version, check_duplicated_command=False)
+else:
+    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"""