Commit 2bf29cd0 authored by André Anjos's avatar André Anjos 💬

Fix verbosity flag behavior

parent 5a4930f9
......@@ -153,7 +153,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))
File.metadata.create_all(engine)
Client.metadata.create_all(engine)
Subworld.metadata.create_all(engine)
......@@ -170,8 +171,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)
......@@ -197,7 +196,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', '--imagedir', action='store', metavar='DIR',
default='/idiap/group/vision/visidiap/databases/banca/english/images_gray',
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment