Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
open-source
logilab-common
Commits
856f78eb256f
Commit
b49fd084
authored
Jun 23, 2021
by
Simon Chabot
Browse files
refactor: use callable_deprecated() instead of deprecated()
parent
4e491912fc70
Changes
1
Hide whitespace changes
Inline
Side-by-side
logilab/common/clcommands.py
View file @
856f78eb
...
...
@@ -32,7 +32,7 @@ from os.path import basename
from
logilab.common.configuration
import
Configuration
from
logilab.common.logging_ext
import
init_log
,
get_threshold
from
logilab.common.deprecation
import
deprecated
from
logilab.common.deprecation
import
callable_
deprecated
class
BadCommandUsage
(
Exception
):
...
...
@@ -330,14 +330,14 @@ Copyright (c) 2004-2011 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
http://www.logilab.fr/ -- mailto:contact@logilab.fr"""
@
deprecated
(
"use cls.register(cli)"
)
@
callable_
deprecated
(
"use cls.register(cli)"
)
def
register_commands
(
commands
):
"""register existing commands"""
for
command_klass
in
commands
:
_COMMANDS
.
register
(
command_klass
)
@
deprecated
(
"use args.pop(0)"
)
@
callable_
deprecated
(
"use args.pop(0)"
)
def
main_run
(
args
,
doc
=
None
,
copyright
=
None
,
version
=
None
):
"""command line tool: run command specified by argument list (without the
program name). Raise SystemExit with status 0 if everything went fine.
...
...
@@ -350,7 +350,7 @@ def main_run(args, doc=None, copyright=None, version=None):
_COMMANDS
.
run
(
args
)
@
deprecated
(
"use args.pop(0)"
)
@
callable_
deprecated
(
"use args.pop(0)"
)
def
pop_arg
(
args_list
,
expected_size_after
=
None
,
msg
=
"Missing argument"
):
"""helper function to get and check command line arguments"""
try
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment