Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
bob.pipelines
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
bob
bob.pipelines
Commits
b01323a2
Commit
b01323a2
authored
2 years ago
by
Yannick DAYER
Browse files
Options
Downloads
Patches
Plain Diff
[py] fix issues with listing protocol paths in tar
parent
4ebe5d5b
No related branches found
No related tags found
1 merge request
!109
Add a way to retrieve protocol definition files
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/bob/pipelines/dataset/protocols/retrieve.py
+14
-9
14 additions, 9 deletions
src/bob/pipelines/dataset/protocols/retrieve.py
with
14 additions
and
9 deletions
src/bob/pipelines/dataset/protocols/retrieve.py
+
14
−
9
View file @
b01323a2
...
...
@@ -113,27 +113,32 @@ def list_protocol_paths(
database_name
:
str
,
base_dir
:
Union
[
PathLike
[
str
],
str
,
None
]
=
None
,
subdir
:
Union
[
PathLike
[
str
],
str
]
=
"
protocol
"
,
database_filename
:
Opt
ion
al
[
str
]
=
None
,
database_filename
:
Un
ion
[
str
,
None
]
=
None
,
)
->
list
[
Path
]:
"""
Returns the paths of each protocol in a database definition file.
"""
if
base_dir
is
None
:
base_dir
=
_get_local_data_directory
()
final_dir
=
Path
(
base_dir
)
/
subdir
if
database_filename
is
None
:
final_dir
/=
database_name
else
:
final_dir
/=
database_filename
final_dir
/=
(
database_name
if
database_filename
is
None
else
database_filename
)
if
archive
.
is_archive
(
final_dir
):
protocols
=
archive
.
list_dirs
(
final_dir
,
show_files
=
False
)
archive_path
,
inner_dir
=
archive
.
path_and_subdir
(
final_dir
)
if
len
(
protocols
)
==
1
and
protocols
[
0
]
==
database_name
:
if
len
(
protocols
)
==
1
and
protocols
[
0
].
name
==
database_name
:
protocols
=
archive
.
list_dirs
(
final_dir
,
database_name
,
show_files
=
False
)
inner_dir
/=
database_name
archive_path
,
inner_dir
=
archive
.
path_and_subdir
(
final_dir
)
if
inner_dir
is
None
:
return
[
Path
(
f
"
{
archive_path
.
as_posix
()
}
:
{
p
.
as_posix
().
lstrip
(
'
/
'
)
}
"
)
for
p
in
protocols
]
return
[
Path
(
f
"
{
archive_path
.
as_posix
()
}
:
{
inner_dir
.
as_posix
}
/
{
p
}
"
)
Path
(
f
"
{
archive_path
.
as_posix
()
}
:
{
inner_dir
.
as_posix
()
}
/
{
p
.
name
}
"
)
for
p
in
protocols
]
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment