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.bio.base
Commits
180b76ef
Commit
180b76ef
authored
Jan 10, 2018
by
Manuel Günther
Browse files
Merge branch 'super' into 'master'
Use super in base file classes See merge request
!127
parents
18148cfe
8376cb79
Pipeline
#15125
passed with stages
in 13 minutes and 17 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
bob/bio/base/database/file.py
View file @
180b76ef
...
...
@@ -22,8 +22,8 @@ class BioFile(bob.db.base.File):
see :py:class:`bob.db.base.File` constructor
"""
def
__init__
(
self
,
client_id
,
path
,
file_id
=
None
):
bob
.
db
.
base
.
File
.
__init__
(
self
,
path
,
file_id
)
def
__init__
(
self
,
client_id
,
path
,
file_id
=
None
,
**
kwargs
):
super
(
BioFile
,
self
)
.
__init__
(
path
,
file_id
,
**
kwargs
)
# just copy the information
self
.
client_id
=
client_id
...
...
@@ -48,13 +48,15 @@ class BioFileSet(BioFile):
All files of that list need to have the same client ID.
"""
def
__init__
(
self
,
file_set_id
,
files
,
path
=
None
):
def
__init__
(
self
,
file_set_id
,
files
,
path
=
None
,
**
kwargs
):
# don't accept empty file lists
assert
len
(
files
),
"Cannot create an empty BioFileSet"
# call base class constructor
BioFile
.
__init__
(
self
,
files
[
0
].
client_id
,
"+"
.
join
(
f
.
path
for
f
in
files
)
if
path
is
None
else
path
,
file_set_id
)
super
(
BioFileSet
,
self
).
__init__
(
files
[
0
].
client_id
,
"+"
.
join
(
f
.
path
for
f
in
files
)
if
path
is
None
else
path
,
file_set_id
,
**
kwargs
)
# check that all files come from the same client
assert
all
(
f
.
client_id
==
self
.
client_id
for
f
in
files
)
...
...
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