From 7a46bfa55a667f0cce13c2aa37d8780cfa0e2085 Mon Sep 17 00:00:00 2001 From: Labrys of Knossos Date: Tue, 18 Dec 2018 21:41:20 -0500 Subject: [PATCH] Remove RunningProcess class and replace with platform alias --- core/utils.py | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/core/utils.py b/core/utils.py index 08e11d34..ce8944ea 100644 --- a/core/utils.py +++ b/core/utils.py @@ -1309,23 +1309,6 @@ def get_download_info(input_name, status): return sql_results - -class RunningProcess(object): - """ Limits application to single instance """ - - def __init__(self): - if os.name == 'nt': - self.process = WindowsProcess() - else: - self.process = PosixProcess() - - def alreadyrunning(self): - return self.process.alreadyrunning() - - # def __del__(self): - # self.process.__del__() - - class WindowsProcess(object): def __init__(self): self.mutex = None @@ -1401,3 +1384,8 @@ class PosixProcess(object): self.lock_socket.close() if os.path.isfile(self.pidpath): os.unlink(self.pidpath) + +if os.name == 'nt': + RunningProcess = WindowsProcess +else: + RunningProcess = PosixProcess