Use pathlib where possible

This commit is contained in:
Patrick Jentsch
2024-03-07 15:49:04 +01:00
parent ec23bd94ee
commit 9da74c1c6f
21 changed files with 164 additions and 167 deletions

View File

@ -1,6 +1,6 @@
from flask import url_for
from flask_hashids import HashidMixin
import os
from pathlib import Path
from app import db
from .file_mixin import FileMixin
@ -33,8 +33,8 @@ class JobInput(FileMixin, HashidMixin, db.Model):
return f'{self.job.jsonpatch_path}/inputs/{self.hashid}'
@property
def path(self):
return os.path.join(self.job.path, 'inputs', str(self.id))
def path(self) -> Path:
return self.job.path / 'inputs' / f'{self.id}'
@property
def url(self):