Skip to content

Commit

Permalink
more logs
Browse files Browse the repository at this point in the history
  • Loading branch information
uyitroa committed Jun 30, 2020
1 parent de333ed commit dd05106
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 17 deletions.
4 changes: 4 additions & 0 deletions ScrollArea.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import logging
import os

from PyQt5 import QtWidgets
from PyQt5 import QtCore
from autologging import traced, logged

from DoubleSlider import DoubleSlider
from GridLayout import GridLayout
Expand All @@ -17,6 +19,8 @@
from config_data import current_settings, current_config


@logged(logging.getLogger(__name__))
@traced("changesize", exclude=True)
class ScrollArea(QtWidgets.QScrollArea):
def __init__(self, parent, main_window):
super().__init__()
Expand Down
2 changes: 2 additions & 0 deletions SettingsPage.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import logging

from Parents import Button
from ScrollArea import ScrollArea

Expand Down
3 changes: 3 additions & 0 deletions SkinDropDown.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from PyQt5 import QtCore
from PyQt5.QtGui import QPalette
from PyQt5.QtWidgets import QComboBox, QAbstractItemView, QGraphicsBlurEffect
from autologging import traced, logged

from abspath import abspath
from config_data import current_config
Expand All @@ -24,6 +25,8 @@ def read_properties_file(file_path):
return dict(cp.items('dummy_section'))


@logged(logging.getLogger(__name__))
@traced("changesize", "blur_me", exclude=True)
class SkinDropDown(QComboBox):
def __init__(self, parent):
super(SkinDropDown, self).__init__(parent)
Expand Down
24 changes: 7 additions & 17 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,24 @@
from Options import Options
import logging
import traceback
from autologging import traced, logged, TRACE


# from PyQt5.QtWinExtras import QWinTaskbarButton

import time

completed_settings = {}
excl = ("resizeEvent", "keyPressEvent", "mousePressEvent", "delete_popup", "blur_function", "applicationStateChanged", "on_focusChanged")


@logged(logging.getLogger(__name__))
@traced(*excl, exclude=True)
class Window(QMainWindow):
def __init__(self, App, execpath):
super().__init__()

logging.basicConfig(level=logging.DEBUG, filename=Log.apppath, filemode="w", format="%(asctime)s:%(levelname)s:%(name)s:%(funcName)s:%(message)s")
logging.basicConfig(level=logging.INFO)
logging.basicConfig(level=TRACE, filename=Log.apppath, filemode="w", format="%(asctime)s:%(levelname)s:%(name)s:%(funcName)s:%(message)s")

logging.info("Current settings is updated to: {}".format(current_settings))
logging.info("Current config is updated to: {}".format(current_config))
Expand Down Expand Up @@ -68,7 +71,7 @@ def __init__(self, App, execpath):
self.options = Options(self)
self.updatebutton = UpdateButton(self)

self.setFixedSize(window_width, window_height)
# self.setFixedSize(window_width, window_height)

logging.info("Loaded Buttons")

Expand Down Expand Up @@ -223,19 +226,6 @@ def find_latestReplay(self):
current_config[".osr path"] = replay
logging.info("Updated replay path to: {}".format(replay))

def set_settings(self, dict1):
if os.path.isfile(settingspath):
with open(settingspath) as f:
data = json.load(f)
counter = 0
for x in data:
if counter > 10:
break
data[x] = float(dict1[counter])
counter += 1
logging.info("Settings data loaded: ", data)
return data

def find_latestMap(self, replay):
if current_config["osu! path"] != "":
beatmap_path = find_beatmap_(os.path.join(current_config["osu! path"], "Replays", replay), current_config["osu! path"])
Expand All @@ -249,7 +239,6 @@ def check_replay_map(self):
self.find_latestReplay()



def kill(proc_pid):
process = psutil.Process(proc_pid)
for proc in process.children(recursive=True):
Expand Down Expand Up @@ -300,6 +289,7 @@ def main(execpath="."):

sys.exit(ret)


if __name__ == "__main__":
main()

0 comments on commit dd05106

Please sign in to comment.