generated from Hazel/python-project
feat: added steps dir
This commit is contained in:
parent
0895256dc4
commit
cb9e594837
@ -18,12 +18,19 @@ class RawImage:
|
||||
|
||||
self.image = self.get_image()
|
||||
|
||||
self.steps_dir = self._get_dir("steps")
|
||||
|
||||
def _get_path(self, ending: str, original_suffix: bool = False) -> Path:
|
||||
if original_suffix:
|
||||
return self.file.with_name(self.file.stem + "_" + ending + self.file.suffix)
|
||||
else:
|
||||
return self.file.with_name(self.file.stem + "_" + ending)
|
||||
|
||||
def _get_dir(self, name: str) -> Path:
|
||||
p = self._get_path(ending=name, original_suffix=False)
|
||||
p.mkdir(exist_ok=True, parents=True)
|
||||
return p
|
||||
|
||||
def read_meta(self) -> dict:
|
||||
if not self.meta_file.exists():
|
||||
return {}
|
||||
|
Loading…
x
Reference in New Issue
Block a user