Server IP : 66.29.132.122 / Your IP : 18.116.23.12 Web Server : LiteSpeed System : Linux business142.web-hosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64 User : admazpex ( 531) PHP Version : 7.2.34 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /proc/self/root/proc/self/root/proc/thread-self/root/proc/thread-self/root/opt/cloudlinux/venv/lib64/python3.11/site-packages/lvestats/lib/parsers/ |
Upload File : |
# coding=utf-8 # # Copyright © Cloud Linux GmbH & Cloud Linux Software, Inc 2010-2019 All Rights Reserved # # Licensed under CLOUD LINUX LICENSE AGREEMENT # http://cloudlinux.com/docs/LICENSE.TXT import argparse ALLOWED_DB_TYPES = ("postgresql", "mysql", "sqlite") class VAction(argparse.Action): def __call__(self, parser, args, values, option_string=None): # print 'values: {v!r}'.format(v=values) if values is None: values = '1' try: values = int(values) except ValueError: values = values.count('v') + 1 setattr(args, self.dest, values) def run_tests_parser(): parser = argparse.ArgumentParser(prog="lvestats-run-tests", add_help=True, description="LveStats2 tests") parser.add_argument("-dt", "--db-type", help=f"type of db, should be one of {ALLOWED_DB_TYPES}", dest="dbtype", default="sqlite", required=True) parser.add_argument("-dl", "--db-login", help="database login", dest="login", required=False) parser.add_argument("-dp", "--db-password", help="database password", dest="password", required=False) parser.add_argument("-dh", "--db-host", help="dtabase host", dest="host", default="localhost") parser.add_argument("--db-tests-only", action="store_true", dest="db_only", default=False) parser.add_argument("--with-tap", action="store_true", dest="with_tap", default=None) parser.add_argument("-dn", "--db-name", help="database name; default in memory for sqlite and temporary for mysql/postgresqll", dest="dbname") parser.add_argument("-p", "--pattern", help="running test pattern", dest="pattern", default="test_") parser.add_argument("-w", "--with-path", help="add PYTHONPATH", dest="path") parser.add_argument("--without-coverage", action='store_false', default=True, dest="coverage") verbose_parser = parser.add_mutually_exclusive_group() verbose_parser.add_argument('-q', '--quiet', action="store_true", default=False, help='quiet operation') verbose_parser.add_argument('-v', nargs='?', action=VAction, default=0, dest='verbose', help='verbose operation; for example -v or -vv') return parser