Skip to content
Snippets Groups Projects
Commit 25ba012b authored by André Anjos's avatar André Anjos :speech_balloon:
Browse files

Fix verbosity flag behavior

parent 096a685a
No related branches found
No related tags found
No related merge requests found
...@@ -158,7 +158,8 @@ def create_tables(args): ...@@ -158,7 +158,8 @@ def create_tables(args):
from bob.db.utils import connection_string from bob.db.utils import connection_string
from sqlalchemy import create_engine 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) Client.metadata.create_all(engine)
RealAccess.metadata.create_all(engine) RealAccess.metadata.create_all(engine)
Attack.metadata.create_all(engine) Attack.metadata.create_all(engine)
...@@ -174,8 +175,6 @@ def create(args): ...@@ -174,8 +175,6 @@ def create(args):
dbfile = args.files[0] dbfile = args.files[0]
args.verbose = 0 if args.verbose is None else sum(args.verbose)
if args.recreate: if args.recreate:
if args.verbose and os.path.exists(dbfile): if args.verbose and os.path.exists(dbfile):
print('unlinking %s...' % dbfile) print('unlinking %s...' % dbfile)
...@@ -203,7 +202,7 @@ def add_command(subparsers): ...@@ -203,7 +202,7 @@ def add_command(subparsers):
parser.add_argument('-R', '--recreate', action='store_true', default=False, parser.add_argument('-R', '--recreate', action='store_true', default=False,
help="If set, I'll first erase the current database") 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") help="Do SQL operations in a verbose way")
parser.add_argument('-D', '--protodir', action='store', parser.add_argument('-D', '--protodir', action='store',
default='/idiap/group/replay/database/protocols/replayattack-database/protocols', default='/idiap/group/replay/database/protocols/replayattack-database/protocols',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment