Skip to content
GitLab
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.fv3d
Commits
a36b35e4
Commit
a36b35e4
authored
Jun 12, 2017
by
André Anjos
💬
Browse files
Fix model-file association
parent
aac5ab5e
Changes
1
Hide whitespace changes
Inline
Side-by-side
bob/db/fv3d/create.py
View file @
a36b35e4
...
...
@@ -117,6 +117,7 @@ def add_protocols(session, verbose):
protocol_dir
=
pkg_resources
.
resource_filename
(
__name__
,
os
.
path
.
join
(
'data'
,
'protocols'
))
for
name
in
os
.
listdir
(
protocol_dir
):
protocol
=
Protocol
(
name
)
session
.
add
(
protocol
)
...
...
@@ -138,7 +139,8 @@ def add_protocols(session, verbose):
for
row
in
f
:
filename
,
model_ref
=
row
.
split
()
file_
=
retrieve_file
(
session
,
filename
.
decode
())
model
=
session
.
query
(
Model
).
filter
(
Model
.
name
==
model_ref
.
decode
())
model
=
session
.
query
(
Model
).
filter
(
Model
.
name
==
model_ref
.
decode
(),
Model
.
protocol
==
protocol
)
if
model
.
count
()
==
0
:
model
=
Model
(
model_ref
.
decode
(),
'dev'
,
file_
.
finger
,
protocol
)
if
verbose
:
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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