Esempio n. 1
0
def main():
    """Execute QDarkStyle helper."""
    parser = argparse.ArgumentParser(
        description="QDarkStyle helper. Use the option --all to report bugs",
        formatter_class=argparse.RawDescriptionHelpFormatter)
    parser.add_argument('-i',
                        '--information',
                        action='store_true',
                        help="Show information about environment")
    parser.add_argument('-b',
                        '--bindings',
                        action='store_true',
                        help="Show available bindings for Qt")
    parser.add_argument(
        '-a',
        '--abstractions',
        action='store_true',
        help="Show available abstraction layers for Qt bindings")
    parser.add_argument('-d',
                        '--dependencies',
                        action='store_true',
                        help="Show information about dependencies")

    parser.add_argument('--all',
                        action='store_true',
                        help="Show all information options at once")

    parser.add_argument('--version',
                        '-v',
                        action='version',
                        version='v{}'.format(jam_darkstyle.__version__))

    # parsing arguments from command line
    args = parser.parse_args()
    no_args = not len(sys.argv) > 1
    info = {}

    if no_args:
        parser.print_help()

    if args.information or args.all:
        info.update(helpdev.check_os())
        info.update(helpdev.check_python())

    if args.bindings or args.all:
        info.update(helpdev.check_qt_bindings())

    if args.abstractions or args.all:
        info.update(helpdev.check_qt_abstractions())

    if args.dependencies or args.all:
        info.update(
            helpdev.check_python_packages(packages='helpdev,jam_darkstyle'))

    helpdev.print_output(info)
Esempio n. 2
0
def main():
    """Execute QDarkStyle helper."""
    parser = argparse.ArgumentParser(description="QDarkStyle helper. Use the option --all to report bugs",
                                     formatter_class=argparse.RawDescriptionHelpFormatter)
    parser.add_argument('-i', '--information', action='store_true',
                        help="Show information about environment")
    parser.add_argument('-b', '--bindings', action='store_true',
                        help="Show available bindings for Qt")
    parser.add_argument('-a', '--abstractions', action='store_true',
                        help="Show available abstraction layers for Qt bindings")
    parser.add_argument('-d', '--dependencies', action='store_true',
                        help="Show information about dependencies")

    parser.add_argument('--all', action='store_true',
                        help="Show all information options at once")

    parser.add_argument('--version', '-v', action='version',
                        version='v{}'.format(qdarkstyle.__version__))

    # parsing arguments from command line
    args = parser.parse_args()
    no_args = not len(sys.argv) > 1
    info = {}

    if no_args:
        parser.print_help()

    if args.information or args.all:
        info.update(helpdev.check_os())
        info.update(helpdev.check_python())

    if args.bindings or args.all:
        info.update(helpdev.check_qt_bindings())

    if args.abstractions or args.all:
        info.update(helpdev.check_qt_abstractions())

    if args.dependencies or args.all:
        info.update(helpdev.check_python_packages(packages='helpdev'))

    helpdev.print_output(info)
Esempio n. 3
0
def main():  # noqa:R701,R0912
    """Main function."""
    args = parse_args()

    info = {}

    # To not repeat the test
    if args.all_for_sure:
        args.all = True

    no_args = len(sys.argv) <= 1

    # Commom hardware, OS and Thread info
    if args.hardware or args.all or no_args:
        info.update(helpdev.check_hardware())
    if args.os or args.all or no_args:
        info.update(helpdev.check_os())
    if args.thread or args.all or no_args:
        info.update(helpdev.check_thread())

    # Network info
    if args.network:
        info.update(helpdev.check_network(args.network))

    # Distribution info
    if args.python or args.all or no_args or args.distributions:
        info.update(helpdev.check_python())
    if args.conda or args.all or no_args or args.distributions:
        info.update(helpdev.check_conda())

    # Qt, binding and abstraction info
    if args.qt_bindings or args.qt or args.all or no_args:
        info.update(helpdev.check_qt_bindings())
    if args.qt_abstractions or args.qt or args.all or no_args:
        info.update(helpdev.check_qt_abstractions())

    # Numbers info
    if args.float or args.all or args.numbers:
        info.update(helpdev.check_float())
    if args.int or args.all or args.numbers:
        info.update(helpdev.check_int())

    # Packages, PIP and Conda info
    if args.packages_pip or args.all or args.packages or args.packages == '':
        info.update(helpdev.check_python_packages(packages=args.packages))
    if args.packages_pip_e:
        info.update(
            helpdev.check_python_packages(edit_mode=True,
                                          packages=args.packages))
    if args.packages_conda or args.all or args.packages or args.packages == '':
        info.update(helpdev.check_conda_packages(packages=args.packages))
    if args.packages_conda_e or args.all:
        info.update(
            helpdev.check_conda_packages(edit_mode=True,
                                         packages=args.packages))

    # Personal info for self-check, not executed when --all is passed
    # Needs to use all-for-sure to be listed
    # This may contains personal folder adresses, be carefull sharing
    if args.path or args.all_for_sure or args.personal:
        info.update(helpdev.check_path())
    if args.scope or args.all_for_sure or args.personal:
        info.update(helpdev.check_scope())

    helpdev.print_output(info)
Esempio n. 4
0
def main():
    """Execute QDarkStyle helper."""
    parser = argparse.ArgumentParser(
        description=
        "QDarkStyle helper. Use the option --all to report bugs (requires 'helpdev')",
        formatter_class=argparse.RawDescriptionHelpFormatter)
    parser.add_argument('-i',
                        '--information',
                        action='store_true',
                        help="Show information about environment")
    parser.add_argument('-b',
                        '--bindings',
                        action='store_true',
                        help="Show available bindings for Qt")
    parser.add_argument(
        '-a',
        '--abstractions',
        action='store_true',
        help="Show available abstraction layers for Qt bindings")
    parser.add_argument('-d',
                        '--dependencies',
                        action='store_true',
                        help="Show information about dependencies")

    parser.add_argument('--all',
                        action='store_true',
                        help="Show all information options at once")

    parser.add_argument('--version',
                        '-v',
                        action='version',
                        version='v{}'.format(qdarkstyle.__version__))

    # parsing arguments from command line
    args = parser.parse_args()
    no_args = not len(sys.argv) > 1
    info = {}

    if no_args:
        parser.print_help()

    try:
        import helpdev

    except (ModuleNotFoundError, ImportError):
        print(
            "You need to install the package helpdev to retrieve detailed information (e.g pip install helpdev)"
        )

    else:
        if args.information or args.all:
            info.update(helpdev.check_os())
            info.update(helpdev.check_python())

        if args.bindings or args.all:
            info.update(helpdev.check_qt_bindings())

        if args.abstractions or args.all:
            info.update(helpdev.check_qt_abstractions())

        if args.dependencies or args.all:
            info.update(
                helpdev.check_python_packages(packages='helpdev,qdarkstyle'))

        helpdev.print_output(info)