Commit 180b76ef authored by Manuel Günther's avatar 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
......@@ -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,
super(BioFileSet, self).__init__(
"+".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)
Supports Markdown
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