Fixed bugs

This commit is contained in:
itdominator 2022-01-24 00:31:27 -06:00
parent cf4411e7ae
commit 7fcdc950fc
8 changed files with 10 additions and 18 deletions

Binary file not shown.

View File

@ -5,8 +5,8 @@ import os, logging
class Logger: class Logger:
def __init__(self): def __init__(self, config_path):
pass self._CONFIG_PATH = config_path
def get_logger(self, loggerName = "NO_LOGGER_NAME_PASSED", createFile = True): def get_logger(self, loggerName = "NO_LOGGER_NAME_PASSED", createFile = True):
""" """
@ -42,8 +42,8 @@ class Logger:
log.addHandler(ch) log.addHandler(ch)
if createFile: if createFile:
folder = "logs" folder = self._CONFIG_PATH
file = folder + "/application.log" file = f"{folder}/application.log"
if not os.path.exists(folder): if not os.path.exists(folder):
os.mkdir(folder) os.mkdir(folder)

View File

@ -29,7 +29,7 @@ class Settings:
self._XSCREEN_SAVERS = "/usr/lib/xscreensaver/" self._XSCREEN_SAVERS = "/usr/lib/xscreensaver/"
self._logger = Logger().get_logger() self._logger = Logger(self._CONFIG_PATH).get_logger()
self._builder = Gtk.Builder() self._builder = Gtk.Builder()
self._main_window = None self._main_window = None

View File

@ -1,6 +1,2 @@
"""
Utils module
"""
from .Logger import Logger from .Logger import Logger
from .Settings import Settings from .Settings import Settings

View File

@ -5,8 +5,8 @@ import os, logging
class Logger: class Logger:
def __init__(self): def __init__(self, config_path):
pass self._CONFIG_PATH = config_path
def get_logger(self, loggerName = "NO_LOGGER_NAME_PASSED", createFile = True): def get_logger(self, loggerName = "NO_LOGGER_NAME_PASSED", createFile = True):
""" """
@ -42,8 +42,8 @@ class Logger:
log.addHandler(ch) log.addHandler(ch)
if createFile: if createFile:
folder = "logs" folder = self._CONFIG_PATH
file = folder + "/application.log" file = f"{folder}/application.log"
if not os.path.exists(folder): if not os.path.exists(folder):
os.mkdir(folder) os.mkdir(folder)

View File

@ -29,7 +29,7 @@ class Settings:
self._XSCREEN_SAVERS = "/usr/lib/xscreensaver/" self._XSCREEN_SAVERS = "/usr/lib/xscreensaver/"
self._logger = Logger().get_logger() self._logger = Logger(self._CONFIG_PATH).get_logger()
self._builder = Gtk.Builder() self._builder = Gtk.Builder()
self._main_window = None self._main_window = None

View File

@ -1,6 +1,2 @@
"""
Utils module
"""
from .Logger import Logger from .Logger import Logger
from .Settings import Settings from .Settings import Settings