Fix currentUpload() return value
This commit is contained in:
parent
25844a1f59
commit
e62af0f71f
|
@ -52,7 +52,7 @@ class Vessel:
|
||||||
|
|
||||||
if "Address" in config.keys():
|
if "Address" in config.keys():
|
||||||
return cls(config.name.split()[1], config["Address"], username,
|
return cls(config.name.split()[1], config["Address"], username,
|
||||||
password, passphrase, tempdir)
|
password, passphrase, tempdir)
|
||||||
else:
|
else:
|
||||||
raise ValueError("Definition for Vessel " +
|
raise ValueError("Definition for Vessel " +
|
||||||
config.name.split()[1] + " does not contain Address!")
|
config.name.split()[1] + " does not contain Address!")
|
||||||
|
@ -107,17 +107,20 @@ class Vessel:
|
||||||
db = Database()
|
db = Database()
|
||||||
return db.getCompletionForVessel(self)
|
return db.getCompletionForVessel(self)
|
||||||
|
|
||||||
def currentUpload(self) -> File:
|
def currentUpload(self) -> Optional[File]:
|
||||||
"""Get the File that is currently being uploaded to this Vessel
|
"""Get the File that is currently being uploaded to this Vessel
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
classes.file.File: File object representing the file currently
|
classes.file.File: File object representing the file currently
|
||||||
being uploaded
|
being uploaded, if any
|
||||||
"""
|
"""
|
||||||
db = Database()
|
db = Database()
|
||||||
directory, name, _ = db.getFileByUUID(
|
output = db.getFileByUUID(
|
||||||
fileuuid := self.connection.getCurrentUploadUUID())
|
fileuuid := self.connection.getCurrentUploadUUID())
|
||||||
return File(name, directory, fileuuid)
|
|
||||||
|
if output:
|
||||||
|
directory, name, _ = output
|
||||||
|
return File(name, directory, fileuuid)
|
||||||
|
|
||||||
def clearTempDir(self) -> None:
|
def clearTempDir(self) -> None:
|
||||||
"""Clean up the temporary directory on the Vessel
|
"""Clean up the temporary directory on the Vessel
|
||||||
|
|
Loading…
Reference in a new issue