Skip to content

Commit

Permalink
switched to dirpath(abspath()) to be save on linux
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreWohnsland committed Nov 20, 2021
1 parent 281c8d0 commit 48c7f7f
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion config/config_manager.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import os
import yaml

CONFIG_FILE = os.path.join(os.path.dirname(__file__), "..", "custom_config.yaml")
CONFIG_FILE = os.path.join(os.path.dirname(os.path.abspath(__file__)), "..", "custom_config.yaml")


class ConfigManager:
Expand Down
2 changes: 1 addition & 1 deletion dashboard/backend/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from pydantic import BaseModel

DATABASE_NAME = "team"
DIRPATH = os.path.dirname(__file__)
DIRPATH = os.path.dirname(os.path.abspath(__file__))
database_path = os.path.join(DIRPATH, "storage", f"{DATABASE_NAME}.db")

app = FastAPI()
Expand Down
2 changes: 1 addition & 1 deletion dashboard/frontend/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
mpl.rcParams.update({'text.color': "white", 'axes.labelcolor': "white"})

DATABASE_NAME = "team"
DIRPATH = os.path.dirname(__file__)
DIRPATH = os.path.dirname(os.path.abspath(__file__))
load_dotenv(os.path.join(DIRPATH, ".language.env"))
database_path = os.path.join(DIRPATH, "storage", f"{DATABASE_NAME}.db")

Expand Down
2 changes: 1 addition & 1 deletion microservice/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import sqlite3

DATABASE_NAME = "failed_data"
DIRPATH = os.path.dirname(__file__)
DIRPATH = os.path.dirname(os.path.abspath(__file__))


class DatabaseHandler:
Expand Down
2 changes: 1 addition & 1 deletion src/database_commander.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from typing import Any, Dict, List

DATABASE_NAME = "Cocktail_database"
DIRPATH = os.path.dirname(__file__)
DIRPATH = os.path.dirname(os.path.abspath(__file__))


class DatabaseCommander:
Expand Down
2 changes: 1 addition & 1 deletion src/logger_handler.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import os
import logging

dirpath = os.path.dirname(__file__)
dirpath = os.path.dirname(os.path.abspath(__file__))


class LoggerHandler:
Expand Down
2 changes: 1 addition & 1 deletion src/save_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from src.display_controller import DP_CONTROLLER
from src.service_handler import SERVICE_HANDLER

DIRPATH = os.path.dirname(__file__)
DIRPATH = os.path.dirname(os.path.abspath(__file__))


class SaveHandler:
Expand Down
3 changes: 2 additions & 1 deletion src_ui/setup_mainwindow.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ def __init__(self, parent=None):
self.logger_handler.log_start_program()
self.connect_objects()
self.connect_other_windows()
self.icon_path = os.path.join(os.path.dirname(__file__), "..", "ui_elements", "Cocktail-icon.png")
self.icon_path = os.path.join(os.path.dirname(os.path.abspath(__file__)),
"..", "ui_elements", "Cocktail-icon.png")
# as long as its not UI_DEVENVIRONMENT (usually touchscreen) hide the cursor
if not self.UI_DEVENVIRONMENT:
self.setCursor(Qt.BlankCursor)
Expand Down

0 comments on commit 48c7f7f

Please sign in to comment.