mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-07-12 08:16:03 -07:00
Remove RunningProcess class and replace with platform alias
This commit is contained in:
parent
ad6f0b7bb6
commit
7a46bfa55a
1 changed files with 5 additions and 17 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue