cleanup extending passwd.dat

pull/3/head
Thomas Waldmann 2017-12-11 15:43:35 +01:00
rodzic 23af7385b0
commit 278144a911
1 zmienionych plików z 6 dodań i 7 usunięć

Wyświetl plik

@ -106,14 +106,13 @@ def handle_configure(client, request):
<br><br>""" <br><br>"""
send_response(client, response_footer) send_response(client, response_footer)
try: try:
with open("passwd.dat", "r") as fo: with open("passwd.dat", "r") as f:
ex_data = fo.read() ex_data = f.read()
ex_data = ssid + ";" + password + "\n" + ex_data
with open("passwd.dat", "w") as fo:
fo.write(ex_data)
except: except:
with open("passwd.dat", "w") as fo: ex_data = ""
fo.write(ssid + ";" + password + "\n") ex_data = "%s;%s\n" % (ssid, password) + ex_data
with open("passwd.dat", "w") as f:
f.write(ex_data)
return True return True
else: else:
response_footer = """ response_footer = """