Shortcuts

mmedit.utils.cli 源代码

# Copyright (c) OpenMMLab. All rights reserved.
import re
import sys
import warnings


[文档]def modify_args(): """Modify args of argparse.ArgumentParser.""" for i, v in enumerate(sys.argv): if i == 0: assert v.endswith('.py') elif re.match(r'--\w+_.*', v): new_arg = v.replace('_', '-') warnings.warn( f'command line argument {v} is deprecated, ' f'please use {new_arg} instead.', category=DeprecationWarning, ) sys.argv[i] = new_arg
Read the Docs v: latest
Versions
master
latest
stable
zyh-doc-notfound-extend
Downloads
pdf
epub
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.