From ef37a15ac88344f47179848d1b1920bf10069b8f Mon Sep 17 00:00:00 2001 From: Nathaniel Kenschaft Date: Tue, 16 Jun 2020 23:15:29 -0400 Subject: [PATCH 1/2] bgservice.py --- bgservice/bgservice.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/bgservice/bgservice.py b/bgservice/bgservice.py index 34ae4f3..daabea3 100644 --- a/bgservice/bgservice.py +++ b/bgservice/bgservice.py @@ -7,7 +7,7 @@ import time import sys import os import pyinotify -from . import checker +import checker from pathlib import Path @@ -135,9 +135,10 @@ def watch_dir(watched_dir=str(Path.home()), log_dir="SkoolOS/logs"): DIR = watched_dir if not os.path.exists(log_dir): os.makedirs(log_dir) - logfile = open( - log_dir + "/skoolos_" + - time.strftime("%m%d%Y-%H%M%S", time.localtime()), 'w') + logfile_ = log_dir + "/skooloslog" + logfile = open(logfile_, 'w') + if os.path.isfile(logfile_): + os.remove(logfile_) START_TIME = time.time() wm = pyinotify.WatchManager() mask = pyinotify.IN_CREATE | pyinotify.IN_CLOSE_WRITE | pyinotify.IN_DELETE | \ From eb1f3bede7583f58253db3d39bc34fbc2c1d587b Mon Sep 17 00:00:00 2001 From: Nathaniel Kenschaft Date: Tue, 16 Jun 2020 23:25:09 -0400 Subject: [PATCH 2/2] fixed bgservice --- bgservice/bgservice.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bgservice/bgservice.py b/bgservice/bgservice.py index daabea3..5205fd4 100644 --- a/bgservice/bgservice.py +++ b/bgservice/bgservice.py @@ -7,7 +7,7 @@ import time import sys import os import pyinotify -import checker +from . import checker from pathlib import Path @@ -136,9 +136,9 @@ def watch_dir(watched_dir=str(Path.home()), log_dir="SkoolOS/logs"): if not os.path.exists(log_dir): os.makedirs(log_dir) logfile_ = log_dir + "/skooloslog" - logfile = open(logfile_, 'w') if os.path.isfile(logfile_): os.remove(logfile_) + logfile = open(logfile_, 'w') START_TIME = time.time() wm = pyinotify.WatchManager() mask = pyinotify.IN_CREATE | pyinotify.IN_CLOSE_WRITE | pyinotify.IN_DELETE | \