本文整理汇总了Python中modtool_base.ModTool.setup_parser方法的典型用法代码示例。如果您正苦于以下问题:Python ModTool.setup_parser方法的具体用法?Python ModTool.setup_parser怎么用?Python ModTool.setup_parser使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类modtool_base.ModTool
的用法示例。
在下文中一共展示了ModTool.setup_parser方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: setup_parser
# 需要导入模块: from modtool_base import ModTool [as 别名]
# 或者: from modtool_base.ModTool import setup_parser [as 别名]
def setup_parser(self):
" Initialise the option parser for 'gr_modtool.py newmod' "
parser = ModTool.setup_parser(self)
#parser.usage = '%prog rm [options]. \n Call %prog without any options to run it interactively.'
#ogroup = OptionGroup(parser, "New out-of-tree module options")
#parser.add_option_group(ogroup)
return parser
示例2: setup_parser
# 需要导入模块: from modtool_base import ModTool [as 别名]
# 或者: from modtool_base.ModTool import setup_parser [as 别名]
def setup_parser(self):
parser = ModTool.setup_parser(self)
ogroup = OptionGroup(parser, "Rename module options")
ogroup.add_option("-o", "--old-name", type="string", default=None, help="Current name of the block to rename.")
ogroup.add_option("-u", "--new-name", type="string", default=None, help="New name of the block.")
parser.add_option_group(ogroup)
return parser
示例3: setup_parser
# 需要导入模块: from modtool_base import ModTool [as 别名]
# 或者: from modtool_base.ModTool import setup_parser [as 别名]
def setup_parser(self):
""" Initialise the option parser for 'gr_modtool makexml' """
parser = ModTool.setup_parser(self)
parser.usage = """%prog info [options]. \n Call %prog without any options to run it interactively.
Note: This does not work on Python blocks!
"""
return parser
示例4: setup_parser
# 需要导入模块: from modtool_base import ModTool [as 别名]
# 或者: from modtool_base.ModTool import setup_parser [as 别名]
def setup_parser(self):
" Initialise the option parser for 'gr_modtool newmod' "
parser = ModTool.setup_parser(self)
parser.usage = '%prog nm [options]. \n Call %prog without any options to run it interactively.'
ogroup = OptionGroup(parser, "New out-of-tree module options")
ogroup.add_option("--srcdir", type="string",
help="Source directory for the module template.")
parser.add_option_group(ogroup)
return parser
示例5: setup_parser
# 需要导入模块: from modtool_base import ModTool [as 别名]
# 或者: from modtool_base.ModTool import setup_parser [as 别名]
def setup_parser(self):
" Initialise the option parser for 'gr_modtool.py rm' "
parser = ModTool.setup_parser(self)
parser.usage = '%prog rm [options]. \n Call %prog without any options to run it interactively.'
ogroup = OptionGroup(parser, "Remove module options")
ogroup.add_option("-p", "--pattern", type="string", default=None,
help="Filter possible choices for blocks to be deleted.")
ogroup.add_option("-y", "--yes", action="store_true", default=False,
help="Answer all questions with 'yes'.")
parser.add_option_group(ogroup)
return parser
示例6: setup_parser
# 需要导入模块: from modtool_base import ModTool [as 别名]
# 或者: from modtool_base.ModTool import setup_parser [as 别名]
def setup_parser(self):
""" Initialise the option parser for 'gr_modtool info' """
parser = ModTool.setup_parser(self)
parser.usage = '%prog info [options]. \n Call %prog without any options to run it interactively.'
ogroup = OptionGroup(parser, "Info options")
ogroup.add_option("--python-readable", action="store_true", default=None,
help="Return the output in a format that's easier to read for Python scripts.")
ogroup.add_option("--suggested-dirs", default=None, type="string",
help="Suggest typical include dirs if nothing better can be detected.")
parser.add_option_group(ogroup)
return parser
示例7: setup_parser
# 需要导入模块: from modtool_base import ModTool [as 别名]
# 或者: from modtool_base.ModTool import setup_parser [as 别名]
def setup_parser(self):
parser = ModTool.setup_parser(self)
parser.usage = '%prog add [options]. \n Call %prog without any options to run it interactively.'
ogroup = OptionGroup(parser, "Add module options")
ogroup.add_option("-t", "--block-type", type="choice",
choices=self._block_types, default=None, help="One of %s." % ', '.join(self._block_types))
ogroup.add_option("--license-file", type="string", default=None,
help="File containing the license header for every source code file.")
ogroup.add_option("--argument-list", type="string", default=None,
help="The argument list for the constructor and make functions.")
ogroup.add_option("--add-python-qa", action="store_true", default=None,
help="If given, Python QA code is automatically added if possible.")
ogroup.add_option("--add-cpp-qa", action="store_true", default=None,
help="If given, C++ QA code is automatically added if possible.")
ogroup.add_option("--skip-cmakefiles", action="store_true", default=False,
help="If given, only source files are written, but CMakeLists.txt files are left unchanged.")
parser.add_option_group(ogroup)
return parser
示例8: setup_parser
# 需要导入模块: from modtool_base import ModTool [as 别名]
# 或者: from modtool_base.ModTool import setup_parser [as 别名]
def setup_parser(self):
parser = ModTool.setup_parser(self)
ogroup = OptionGroup(parser, "Add module options")
ogroup.add_option("-t", "--block-type", type="choice",
choices=self._block_types, default=None, help="One of %s." % ', '.join(self._block_types))
ogroup.add_option("--license-file", type="string", default=None,
help="File containing the license header for every source code file.")
ogroup.add_option("--copyright", type="string", default=None,
help="Name of the copyright holder (you or your company) MUST be a quoted string.")
ogroup.add_option("--argument-list", type="string", default=None,
help="The argument list for the constructor and make functions.")
ogroup.add_option("--add-python-qa", action="store_true", default=None,
help="If given, Python QA code is automatically added if possible.")
ogroup.add_option("--add-cpp-qa", action="store_true", default=None,
help="If given, C++ QA code is automatically added if possible.")
ogroup.add_option("--skip-cmakefiles", action="store_true", default=False,
help="If given, only source files are written, but CMakeLists.txt files are left unchanged.")
ogroup.add_option("-l", "--lang", type="choice", choices=('cpp', 'c++', 'python'),
default=None, help="Language (cpp or python)")
parser.add_option_group(ogroup)
return parser