diff --git a/xbob/db/replay/create.py b/xbob/db/replay/create.py index ef31716d87e94e4c6aa553a3e3a97afaccea2191..a0b4c89bae1d49e31decf400cc7936f73a13ce61 100644 --- a/xbob/db/replay/create.py +++ b/xbob/db/replay/create.py @@ -158,7 +158,8 @@ def create_tables(args): from bob.db.utils import connection_string from sqlalchemy import create_engine - engine = create_engine(connection_string(args.type, args.files[0]), echo=args.verbose) + engine = create_engine(connection_string(args.type, args.files[0]), + echo=(args.verbose >= 2)) Client.metadata.create_all(engine) RealAccess.metadata.create_all(engine) Attack.metadata.create_all(engine) @@ -174,8 +175,6 @@ def create(args): dbfile = args.files[0] - args.verbose = 0 if args.verbose is None else sum(args.verbose) - if args.recreate: if args.verbose and os.path.exists(dbfile): print('unlinking %s...' % dbfile) @@ -203,7 +202,7 @@ def add_command(subparsers): parser.add_argument('-R', '--recreate', action='store_true', default=False, help="If set, I'll first erase the current database") - parser.add_argument('-v', '--verbose', action='append_const', const=1, + parser.add_argument('-v', '--verbose', action='count', help="Do SQL operations in a verbose way") parser.add_argument('-D', '--protodir', action='store', default='/idiap/group/replay/database/protocols/replayattack-database/protocols',