seaman: fix the case when no recorders are needed
This commit is contained in:
13
seaman.py
13
seaman.py
@@ -265,11 +265,12 @@ class SeaManager(ServiceManager):
|
||||
args = ' '.join(recorders.get(k, '0') for k in ('main', 'stick', 'addons'))
|
||||
conn.send(f'seauser seaser\nconfig listen 1\nsea_recorder {args}\n'.encode())
|
||||
conn.settimeout(2)
|
||||
prev = b''
|
||||
while True:
|
||||
lines = (prev + conn.recv(999)).split(b'\n')
|
||||
prev = lines.pop()
|
||||
if b'ACTIVE' in lines:
|
||||
break
|
||||
if args != '0 0 0':
|
||||
prev = b''
|
||||
while True:
|
||||
lines = (prev + conn.recv(999)).split(b'\n')
|
||||
prev = lines.pop()
|
||||
if b'ACTIVE' in lines:
|
||||
break
|
||||
finally:
|
||||
conn.close()
|
||||
|
||||
Reference in New Issue
Block a user