mirror of
https://github.com/Rushilwiz/SkoolOS.git
synced 2025-04-16 02:10:19 -04:00
small changes
This commit is contained in:
parent
0d737d91c6
commit
dfd7e4c3bd
|
@ -12,7 +12,7 @@ class SkoolOSDaemon:
|
||||||
self.start_time = None
|
self.start_time = None
|
||||||
self.end_time = None
|
self.end_time = None
|
||||||
self.log_file = None
|
self.log_file = None
|
||||||
def write_pid_file(self):
|
def __write_pid_file(self):
|
||||||
pid = str(os.getpid())
|
pid = str(os.getpid())
|
||||||
file_ = open('/tmp/skoolosdaemonpid', 'w')
|
file_ = open('/tmp/skoolosdaemonpid', 'w')
|
||||||
file_.write(pid)
|
file_.write(pid)
|
||||||
|
@ -20,6 +20,7 @@ class SkoolOSDaemon:
|
||||||
def readable_time(self, input_time):
|
def readable_time(self, input_time):
|
||||||
return time.strftime("%A, %B %d, %Y %H:%M:%S", time.localtime(input_time))
|
return time.strftime("%A, %B %d, %Y %H:%M:%S", time.localtime(input_time))
|
||||||
def start(self):
|
def start(self):
|
||||||
|
__write_pid_file()
|
||||||
self.start_time = time.time()
|
self.start_time = time.time()
|
||||||
self.log_file = open('/tmp/skooloslogs/' + str(self.start_time), 'w')
|
self.log_file = open('/tmp/skooloslogs/' + str(self.start_time), 'w')
|
||||||
self.log_file.write("Started work: \n" + self.readable_time(self.start_time))
|
self.log_file.write("Started work: \n" + self.readable_time(self.start_time))
|
||||||
|
@ -32,8 +33,12 @@ class SkoolOSDaemon:
|
||||||
time.strftime("%H:%M:%S", time.gmtime(self.end_time - self.start_time)))
|
time.strftime("%H:%M:%S", time.gmtime(self.end_time - self.start_time)))
|
||||||
|
|
||||||
|
|
||||||
|
logger = None
|
||||||
|
|
||||||
|
|
||||||
def Main():
|
def Main():
|
||||||
print("This does nothing right now...")
|
logger = SkoolOSDaemon("/tmp")
|
||||||
|
logger.start()
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|
|
@ -10,7 +10,7 @@ class EventProcessor(pyinotify.ProcessEvent):
|
||||||
_methods = ["IN_ACCESS",
|
_methods = ["IN_ACCESS",
|
||||||
"IN_CREATE",
|
"IN_CREATE",
|
||||||
"IN_CLOSE_WRITE",
|
"IN_CLOSE_WRITE",
|
||||||
"IN_DELETE"
|
"IN_DELETE",
|
||||||
"IN_MOVED_TO",
|
"IN_MOVED_TO",
|
||||||
"IN_MOVED_FROM",
|
"IN_MOVED_FROM",
|
||||||
]
|
]
|
||||||
|
|
|
@ -12,6 +12,7 @@ oauthlib==3.1.0
|
||||||
prompt-toolkit==1.0.14
|
prompt-toolkit==1.0.14
|
||||||
pyclipper==1.1.0.post3
|
pyclipper==1.1.0.post3
|
||||||
Pygments==2.6.1
|
Pygments==2.6.1
|
||||||
|
pyinotify==0.9.6
|
||||||
PyInquirer==1.0.3
|
PyInquirer==1.0.3
|
||||||
pyperclip==1.8.0
|
pyperclip==1.8.0
|
||||||
pytz==2020.1
|
pytz==2020.1
|
||||||
|
|
Loading…
Reference in New Issue
Block a user