unified sics_command() with sics_client()
This commit is contained in:
parent
4b9e0e905d
commit
52fc0fa054
@ -49,14 +49,11 @@ def sics_coroutine(hostport, login):
|
||||
request = yield '\n'.join(result)
|
||||
|
||||
|
||||
def sics_client(hostport, login='Spy 007'):
|
||||
def sics_client(hostport, command=None, login='Spy 007'):
|
||||
sics = sics_coroutine(hostport, login)
|
||||
next(sics) # start generator
|
||||
if command is None:
|
||||
return sics
|
||||
|
||||
|
||||
def sics_command(hostport, command, login='Spy 007'):
|
||||
sics = sics_client(hostport, login)
|
||||
result = sics.send(command)
|
||||
sics.close()
|
||||
return result
|
||||
|
Loading…
x
Reference in New Issue
Block a user