formatting

This commit is contained in:
WorldTeacher
2024-05-16 15:31:06 +02:00
parent 4f7b564352
commit ef5f862a2b
4 changed files with 39 additions and 26 deletions

View File

@@ -1,22 +1,25 @@
import os
from pathlib import Path
from omegaconf import OmegaConf
from src.backend.database import Database
db = Database()
config = OmegaConf.load("config.yaml")
def recreateFile(name, app_id, filetype, open=True)->Path:
def recreateFile(name, app_id, filetype, open=True) -> Path:
"""
recreateFile creates a file from the database and opens it in the respective program, if the open parameter is set to True.
Args:
----
- name (str): The filename selected by the user.
- app_id (str): the id of the apparatus.
- filetype (str): the extension of the file to be created.
- open (bool, optional): Determines if the file should be opened. Defaults to True.
Returns:
-------
- Path: Absolute path to the file.
@@ -30,4 +33,4 @@ def recreateFile(name, app_id, filetype, open=True)->Path:
else:
path = path.resolve()
os.system(f"open {path}")
return path
return path