Esempio n. 1
0
def dispatch_database_inspector(args):
    """
    Dispatch the database inspection tool
    :param args: Arguments passed to the script
    :return: None
    """
    inspector = Inspector(args)
    inspector.run()
Esempio n. 2
0
                    action='store_true',
                    help="Use this option to run the inspector")
    ap.add_argument("-c",
                    "--clear",
                    required=False,
                    action='store_true',
                    help="Clear the branches information file.")

    args = ap.parse_args()

    if args.clear:
        try:
            shutil.rmtree(Constants.dir_logs)
            shutil.rmtree(Constants.dir_bank)
            print("bank/ and logs/ directories were removed.")
        except FileNotFoundError:
            print("directories do not exist. They were already removed.")

        exit(0)

    if args.bank and args.inspector:
        raise "You must only use one option."
    elif args.bank:
        branch = Bank()
        branch.run()
    elif args.inspector:
        inspector = Inspector()
        inspector.run()
    else:
        raise "Use one of the options (-b or -i)"