mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-07-12 16:22:53 -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
|
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):
|
class WindowsProcess(object):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.mutex = None
|
self.mutex = None
|
||||||
|
@ -1401,3 +1384,8 @@ class PosixProcess(object):
|
||||||
self.lock_socket.close()
|
self.lock_socket.close()
|
||||||
if os.path.isfile(self.pidpath):
|
if os.path.isfile(self.pidpath):
|
||||||
os.unlink(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