Skip to content

Commit

Permalink
builder takes command line args
Browse files Browse the repository at this point in the history
  • Loading branch information
fogleman committed Jan 18, 2014
1 parent 75d3639 commit 9cc0cc4
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@
import requests
import socket
import sqlite3
import sys

HOST = '127.0.0.1'
PORT = 4080
DEFAULT_HOST = '127.0.0.1'
DEFAULT_PORT = 4080

EMPTY = 0
GRASS = 1
Expand Down Expand Up @@ -178,7 +179,10 @@ def bitmap(self, sx, sy, sz, d1, d2, data, lookup):
x, y, z = x + dx2, y + dy2, z + dz2

def main():
client = Client(HOST, PORT)
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))
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 9cc0cc4

Please sign in to comment.