Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
bob
bob.db.biosecure
Commits
c95e1b48
Commit
c95e1b48
authored
Sep 01, 2012
by
André Anjos
💬
Browse files
Fix verbosity flag behavior
parent
e40e9e1f
Changes
1
Hide whitespace changes
Inline
Side-by-side
xbob/db/biosecure/create.py
View file @
c95e1b48
...
...
@@ -292,7 +292,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
)
File
.
metadata
.
create_all
(
engine
)
Protocol
.
metadata
.
create_all
(
engine
)
...
...
@@ -308,8 +309,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
)
...
...
@@ -334,7 +333,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/temp/cmccool/databases/biosecure/raw'
,
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment