Commit 4df57e6b authored by Jason Yeomans's avatar Jason Yeomans
Browse files

Added freshman buildings (except Commonwealth and Dominion) to inital_data.json

parent eed3643f
This diff is collapsed.
...@@ -18,25 +18,32 @@ def get_floor_num(line): ...@@ -18,25 +18,32 @@ def get_floor_num(line):
roomNumbers = open('room-numbers', 'r') roomNumbers = open('room-numbers', 'r')
print "[{" print("[{")
# for line in file # for line in file
pk = 1 pk = 1
curFloor = 0
curFloorInBuilding = 1 curFloorInBuilding = 1
curFloor = 1
for line in roomNumbers: for line in roomNumbers:
if not prog.match('[a-zA-Z]',line): line = line.rstrip('\n')
print "}, {\n" if re.match('[a-zA-Z]',line):
print " \"floor\": " + curFloor + ",\n" curFloor += 1
print " \"number\": " + line + ",\n" curFloorInBuilding = 1
print " \"room_num\": \"" + line + "\",\n" else:
print " \"slug\": \"" + slug_generator() + "\",\n" if int(float(get_floor_num(line))) > curFloorInBuilding:
print " }," curFloor += 1
print " \"model\":\"housing.room\",\n" curFloorInBuilding += 1
print " \"pk\":\n" print("}, {\"fields\": {")
pk++ print(" \"floor\": " + str(curFloor) + ",")
print "}]" print(" \"number\": " + str(line) + ",")
print(" \"room_num\": \"" + str(line) + "\",")
print(" \"slug\": \"" + slug_generator() + "\"")
print(" },")
print(" \"model\":\"housing.room\",")
print(" \"pk\":" + str(pk))
pk = pk + 1
print("}]")
""" """
"fields": { "fields": {
......
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment