delete configs after use
This commit is contained in:
parent
7e757c005c
commit
54bcba195d
15
csdr.py
15
csdr.py
@ -108,6 +108,8 @@ class dsp(object):
|
|||||||
self.modification_lock = threading.Lock()
|
self.modification_lock = threading.Lock()
|
||||||
self.output = output
|
self.output = output
|
||||||
self.temporary_directory = "/tmp"
|
self.temporary_directory = "/tmp"
|
||||||
|
self.direwolf_config = None
|
||||||
|
self.direwolf_port = None
|
||||||
|
|
||||||
def set_temporary_directory(self, what):
|
def set_temporary_directory(self, what):
|
||||||
self.temporary_directory = what
|
self.temporary_directory = what
|
||||||
@ -361,6 +363,7 @@ class dsp(object):
|
|||||||
if self.secondary_processes_running == False:
|
if self.secondary_processes_running == False:
|
||||||
return
|
return
|
||||||
self.try_delete_pipes(self.secondary_pipe_names)
|
self.try_delete_pipes(self.secondary_pipe_names)
|
||||||
|
self.try_delete_configs()
|
||||||
if self.secondary_process_fft:
|
if self.secondary_process_fft:
|
||||||
try:
|
try:
|
||||||
os.killpg(os.getpgid(self.secondary_process_fft.pid), signal.SIGTERM)
|
os.killpg(os.getpgid(self.secondary_process_fft.pid), signal.SIGTERM)
|
||||||
@ -567,6 +570,18 @@ AGWPORT off
|
|||||||
file.close()
|
file.close()
|
||||||
else:
|
else:
|
||||||
self.direwolf_config = None
|
self.direwolf_config = None
|
||||||
|
self.direwolf_port = None
|
||||||
|
|
||||||
|
def try_delete_configs(self):
|
||||||
|
if self.direwolf_config:
|
||||||
|
try:
|
||||||
|
os.unlink(self.direwolf_config)
|
||||||
|
except FileNotFoundError:
|
||||||
|
# result suits our expectations. fine :)
|
||||||
|
pass
|
||||||
|
except Exception:
|
||||||
|
logger.exception("try_delete_configs()")
|
||||||
|
self.direwolf_config = None
|
||||||
|
|
||||||
def start(self):
|
def start(self):
|
||||||
self.modification_lock.acquire()
|
self.modification_lock.acquire()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user