Skip to content

Commit

Permalink
get_client() helper
Browse files Browse the repository at this point in the history
  • Loading branch information
fogleman committed Jan 19, 2014
1 parent 9cc0cc4 commit ac41fa2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,11 +178,15 @@ def bitmap(self, sx, sy, sz, d1, d2, data, lookup):
x, y, z = x + dx1, y + dy1, z + dz1
x, y, z = x + dx2, y + dy2, z + dz2

def main():
def get_client():
default_args = [DEFAULT_HOST, DEFAULT_PORT]
args = sys.argv[1:] + [None] * len(default_args)
host, port = [a or b for a, b in zip(args, default_args)]
client = Client(host, int(port))
return client

def main():
client = get_client()
set_block = client.set_block
set_blocks = client.set_blocks
# set_blocks(circle_y(0, 32, 0, 16, True), STONE)
Expand Down

0 comments on commit ac41fa2

Please sign in to comment.