当前位置: 首页>>代码示例>>Python>>正文


Python OptionParser.defaults["disable"]方法代码示例

本文整理汇总了Python中smart.option.OptionParser.defaults["disable"]方法的典型用法代码示例。如果您正苦于以下问题:Python OptionParser.defaults["disable"]方法的具体用法?Python OptionParser.defaults["disable"]怎么用?Python OptionParser.defaults["disable"]使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在smart.option.OptionParser的用法示例。


在下文中一共展示了OptionParser.defaults["disable"]方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: option_parser

# 需要导入模块: from smart.option import OptionParser [as 别名]
# 或者: from smart.option.OptionParser import defaults["disable"] [as 别名]
def option_parser():
    description = DESCRIPTION % {"types": build_types()}
    parser = OptionParser(usage=USAGE,
                          description=description,
                          examples=EXAMPLES)
    parser.defaults["add"] = None
    parser.defaults["set"] = None
    parser.defaults["remove"] = None
    parser.defaults["enable"] = None
    parser.defaults["disable"] = None
    parser.defaults["list"] = None
    parser.defaults["show"] = None
    parser.defaults["yaml"] = None
    parser.add_option("--add", action="callback", callback=append_all,
                      help=_("argument is an alias and one or more "
                             "key=value pairs defining a channel, or a "
                             "filename/url pointing to a channel description "
                             "in the same format used by --show, or a "
                             "directory path where autodetection will be "
                             "tried"))
    parser.add_option("--set", action="callback", callback=append_all,
                      help=_("argument is an alias, and one or more key=value "
                             "pairs modifying a channel"))
    parser.add_option("--remove", action="callback", callback=append_all,
                      help=_("arguments are channel aliases to be removed"))
    parser.add_option("--remove-all", action="store_true",
                      help=_("remove all existent channels"))
    parser.add_option("--list", action="callback", callback=append_all,
                      help=_("list all known channel aliases"))
    parser.add_option("--show", action="callback", callback=append_all,
                      help=_("show channels with given aliases, or all "
                           "channels if no arguments were given"))
    parser.add_option("--yaml", action="callback", callback=append_all,
                      help=_("show given channels in YAML format"))
    parser.add_option("--edit", action="store_true",
                      help=_("edit channels in editor set by $EDITOR"))
    parser.add_option("--enable", action="callback", callback=append_all,
                      help=_("enable channels with given aliases"))
    parser.add_option("--disable", action="callback", callback=append_all,
                      help=_("disable channels with given aliases"))
    parser.add_option("-y", "--yes", action="store_true",
                      help=_("execute without asking"))
    parser.add_option("--help-type", action="store", metavar="TYPE",
                      help=_("show further information about given type"))
    return parser
开发者ID:bluelightning,项目名称:smart,代码行数:47,代码来源:channel.py


注:本文中的smart.option.OptionParser.defaults["disable"]方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。