This commit is contained in:
Kumi 2021-11-30 07:25:24 +01:00
parent f1094bdbda
commit d0953837ec
4 changed files with 5 additions and 5 deletions

View file

@ -180,9 +180,9 @@ class Database:
return [f[0] for f in cur.fetchall()]
def getCompletionByFileUUID(self, fileuuid: str) -> List[Optional[str]]:
def getCompletionByFileUUID(self, fileuuid: str) -> list[Optional[str]]:
cur = self.getCursor()
cur.execute("SELECT vessel FROM contentmonster_file_log WHERE file = ?", (fileuuid))
cur.execute("SELECT vessel FROM contentmonster_file_log WHERE file = ?", (fileuuid,))
return [v[0] for v in cur.fetchall()]

View file

@ -61,7 +61,7 @@ class Directory:
if os.path.isfile(self.completeddir):
raise FileExistsError("Cannot create directory %s - path exists but is not a directory!" % str(self.completeddir))
os.path.mkdir(self.completeddir)
os.mkdir(self.completeddir)
def getFiles(self) -> list[File]:
"""Get all Files in Directory

View file

@ -41,7 +41,7 @@ class File:
return os.path.isfile(self.directory.location / self.name)
def moveCompleted(self) -> None:
self.getFullPath.rename(self.directory.completeddir / self.name)
self.getFullPath().rename(self.directory.completeddir / self.name)
def getUUID(self) -> str:
"""Return unique identifier for this File object

View file

@ -143,7 +143,7 @@ class VesselThread(Process):
def checkFileCompletion(self, fileobj: File) -> None:
db = Database()
complete = db.getCompletionByFileUUID()
complete = db.getCompletionByFileUUID(fileobj.uuid)
del(db)
for vessel in [v.name for v in self._state["config"].vessels]: