From 6143456d35ebeeb6270d6518a0c1b760e6fc5a28 Mon Sep 17 00:00:00 2001 From: berhsi Date: Sat, 27 Jul 2019 18:14:13 +0200 Subject: [PATCH] setstatus.py: fix bug for setting status variable --- setstatus.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/setstatus.py b/setstatus.py index 4f7d800..b250f88 100755 --- a/setstatus.py +++ b/setstatus.py @@ -1,11 +1,11 @@ #!/usr/bin/python3 # -*- coding: utf-8 -*- -# file: client-clear.py +# file: setstatus.py.py # date: 26.07.2019 # email: berhsi@web.de -# client, who connects to nr18.space at port 10001 to update the krautspace +# client, who connects to the statusserver at port 10001 to update the krautspace # door status. If no status is given as argument, he reads from stdin until # input is 0 or 1. @@ -51,7 +51,7 @@ def read_argument(): def main(*status): - HOST = 'localhost' + HOST = 'nr18.space' PORT = 10001 BOM = byteorder STATUS = None @@ -66,6 +66,8 @@ def main(*status): STATUS = read_argument() else: STATUS = check_arguments(argv) + if STATUS == None: + STATUS = read_argument() with socket.socket(socket.AF_INET, socket.SOCK_STREAM, 0) as mySocket: print('Socket created')