本文整理汇总了Python中argh.ArghParser类的典型用法代码示例。如果您正苦于以下问题:Python ArghParser类的具体用法?Python ArghParser怎么用?Python ArghParser使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ArghParser类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: main
def main():
logging_helper.logging_config(detail="high")
parser = ArghParser()
parser.add_commands([
remove_missing_seqs
]
)
parser.dispatch()
示例2: main
def main():
logging_config(detail="high")
parser = ArghParser(description="Utilities for manipulating FASTA files")
parser.add_commands([
rec_filter
]
)
parser.dispatch()
示例3: main
def main():
"""Use argh to dispatch to your subcommands."""
from argh import ArghParser # sudo apt-get install python3-argh
parser = ArghParser()
# Sorting makes the output of --help better:
parser.add_commands(sorted(subcommand.s, key=lambda f: f.__name__))
# parser.add_commands(subcommand.s)
parser.dispatch()
示例4: main
def main():
logging_config(detail="high")
parser = ArghParser(description="Utilities for working with tabular files")
parser.add_commands([
filter_rows
]
)
parser.dispatch()
示例5: main
def main(argv=None):
""" Main method / entry point """
if argv is None:
argv = sys.argv[1:]
description = "SSL Karttarekisteri KML tool"
parser = ArghParser(description=description)
parser.add_commands([convert, download])
parser.dispatch(argv=argv)
示例6: main
def main():
logging_config(detail="high")
parser = ArghParser(description="Utilities for analysing output of annotation consensus classifier")
parser.add_commands([
as_tab
]
)
parser.dispatch()
示例7: main
def main():
from snaptastic import __version__
if '--version' in sys.argv:
print 'Snaptastic version %s' % __version__
p = ArghParser()
commands = [make_snapshots, mount_snapshots, check_backups,
list_volumes, unmount_snapshots, clean, test]
p.add_commands(commands)
p.dispatch()
示例8: __call__
def __call__(self, **kwargs):
parser = ArghParser()
commands = [
full_release,
publish_cfg_files,
update_distribution_changelog,
]
parser.add_commands(commands)
parser.dispatch()
示例9: main
def main():
l18n.init()
parser = ArghParser()
parser.add_argument('-a', '--auth',
action='store_true',
help=_('Authenticate and show all problems'
' on this machine'))
parser.add_argument('-v', '--version',
action='version',
version=config.VERSION)
parser.add_commands([
backtrace,
di_install,
gdb,
info,
list_problems,
remove,
report,
retrace,
status,
])
argcomplete.autocomplete(parser)
try:
parser.dispatch()
except KeyboardInterrupt:
sys.exit(1)
sys.exit(0)
示例10: main
def main():
parser = ArghParser()
parser.add_commands(
(
module_list,
module_install,
module_uninstall,
module_enable,
module_disable
),
namespace='module',
title='Module commands',
description='Group of commands related to listing or (un)installing modules'
)
ini_file='production.ini'
if 'NP_INI_FILE' in os.environ:
ini_file = os.environ['NP_INI_FILE']
ini_name='netprofile'
if 'NP_INI_NAME' in os.environ:
ini_name = os.environ['NP_INI_NAME']
parser.add_argument('--ini-file', '-i', default=ini_file, help='Specify .ini file to use')
parser.add_argument('--application', '-a', default=ini_name, help='Default app section of .ini file to use')
parser.dispatch()
示例11: __call__
def __call__(self, **kwargs):
parser = ArghParser()
parser.add_commands(
[checkPypi,
checkPackageForUpdates,
checkAllPackagesForUpdates,
pulls,
changelog,
create_launchpad_release,
check_checkout])
parser.dispatch()
示例12: __call__
def __call__(self, **kwargs):
parser = ArghParser()
parser.add_commands(
[checkPypi,
checkPackageForUpdates,
checkAllPackagesForUpdates,
pulls,
changelog,
create_launchpad_release,
check_checkout,
append_jenkins_build_number_to_package_version])
parser.dispatch()
示例13: main
def main():
"""Shell entry point for execution"""
try:
argparser = ArghParser()
argparser.add_commands([
phase1_install,
phase2_install,
])
argparser.dispatch()
except KeyboardInterrupt:
sys.exit(0)
示例14: main
def main():
hc.setup()
opt = "stdin_buffer_lines"
buffer = 0
buffering = False
#if opt in CONFIG:
# buffering = True
# buffer = int(CONFIG[opt])
if not sys.stdin.isatty():
db = get_database()
cbuffer = 0
# FIXME: should handle g-code & stuff
while True:
line = sys.stdin.readline()
if not line:
break
path, value = line.split(' ', 1)
if ' ' in value: # timestamp present
dt_in, value = value.split()
dt = parse_timestamp(dt_in)
else:
dt = now()
#print(o)
cbuffer += 1
sys.exit(0)
#logging.basicConfig(level=logging.DEBUG)
#logging.getLogger('sqlalchemy.engine').setLevel(logging.INFO)
logging.basicConfig(level=logging.INFO)
parser = ArghParser()
parser.add_commands([
send,
shell,
server,
monitor,
uimon,
uipcb,
uiprobe,
])
argcomplete.autocomplete(parser)
try:
parser.dispatch()
except KeyboardInterrupt:
sys.exit(1)
示例15: get_base_parser
def get_base_parser():
dist = pkg_resources.get_distribution("awstools")
parser = ArghParser(version=dist.version)
parser.add_argument(
'--config',
default=None,
help="path of an alternative configuration file")
parser.add_argument(
'--settings',
default=None,
help="path of the application settings configuration file")
return parser