forked from Krautspace/doorstatus
setstatus.py: its possible now to pass a integer to main()
to perform a stresstest its possible now to pass an integer as argument to main()
This commit is contained in:
parent
868702eb8d
commit
777c320ce4
1 changed files with 10 additions and 5 deletions
|
@ -49,18 +49,23 @@ def read_argument():
|
|||
return status
|
||||
|
||||
|
||||
def main():
|
||||
def main(*status):
|
||||
|
||||
HOST = 'nr18.space'
|
||||
HOST = 'localhost'
|
||||
PORT = 10001
|
||||
BOM = byteorder
|
||||
STATUS = None
|
||||
RESPONSE = None
|
||||
|
||||
if check_arguments(argv) == None:
|
||||
STATUS = read_argument()
|
||||
if status:
|
||||
STATUS = status[0]
|
||||
STATUS = bytes([STATUS])
|
||||
print('Status: {}'.format(STATUS))
|
||||
else:
|
||||
STATUS = check_arguments(argv)
|
||||
if len(argv) == 1:
|
||||
STATUS = read_argument()
|
||||
else:
|
||||
STATUS = check_arguments(argv)
|
||||
|
||||
with socket.socket(socket.AF_INET, socket.SOCK_STREAM, 0) as mySocket:
|
||||
print('Socket created')
|
Loading…
Reference in a new issue