Skip to content

Commit 441dbbc

Browse files
committed
Adapt to python3
1 parent 8ad37ad commit 441dbbc

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

clients-rocket.py

+10-9
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env python
1+
#!/usr/bin/env python3
22

33
import requests
44
import sys
@@ -11,10 +11,12 @@ def __init__(self, host, username="guest", password=""):
1111
self.host = host
1212
self.http_client = requests.Session()
1313
self.http_client.get("https://%s/login.cgi" % host, verify=False)
14-
self.http_client.post("https://%s/login.cgi" % host, verify=False,
15-
data={'username': username, 'password': password,
16-
'uri': 'sta.cgi'},
17-
files={'b': 'b'}) # use files to force multipart/form-data
14+
self.http_client.post(
15+
"https://%s/login.cgi" % host, verify=False,
16+
data={'username': username, 'password': password,
17+
'uri': 'sta.cgi'},
18+
files={'b': 'b'} # use files to force multipart/form-data
19+
)
1820
self.status()
1921

2022
def status(self):
@@ -26,9 +28,8 @@ def status(self):
2628
self.fwversion = self.status['host']['fwversion']
2729

2830
def acl(self):
29-
r = self.http_client.get("https://%s/macacl.cgi"
30-
% self.host, verify=False)
31-
print r.content
31+
self.acl = self.http_client.get("https://%s/macacl.cgi"
32+
% self.host, verify=False)
3233

3334
def __str__(self):
3435
r = ("### %s (%s AirOS %s)\n"
@@ -60,4 +61,4 @@ def next(address):
6061
pool.close()
6162
pool.join()
6263
for r in results:
63-
print r
64+
print(r)

0 commit comments

Comments
 (0)