本文整理汇总了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