Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update builder.py #282

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ def get_identity():
return row
raise Exception('No identities found.')

class Client(object):
class Client:
def __init__(self, host, port):
self.conn = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
self.conn.connect((host, port))
Expand All @@ -152,7 +152,7 @@ def authenticate(self):
'identity_token': identity_token,
}
response = requests.post(url, data=payload)
if response.status_code == 200 and response.text.isalnum():
if response.ok and response.text.isalnum():
access_token = response.text
self.conn.sendall('A,%s,%s\n' % (username, access_token))
else:
Expand All @@ -173,7 +173,7 @@ def bitmap(self, sx, sy, sz, d1, d2, data, lookup):
z = sz if dz1 else z
for c in row:
w = lookup.get(c)
if w is not None:
if w:
self.set_block(x, y, z, w)
x, y, z = x + dx1, y + dy1, z + dz1
x, y, z = x + dx2, y + dy2, z + dz2
Expand Down