Commit 4df57e6b by Jason Yeomans

### 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): roomNumbers = open('room-numbers', 'r') print "[{" print("[{") # for line in file pk = 1 curFloor = 0 curFloorInBuilding = 1 curFloor = 1 for line in roomNumbers: if not prog.match('[a-zA-Z]',line): print "}, {\n" print " \"floor\": " + curFloor + ",\n" print " \"number\": " + line + ",\n" print " \"room_num\": \"" + line + "\",\n" print " \"slug\": \"" + slug_generator() + "\",\n" print " }," print " \"model\":\"housing.room\",\n" print " \"pk\":\n" pk++ print "}]" line = line.rstrip('\n') if re.match('[a-zA-Z]',line): curFloor += 1 curFloorInBuilding = 1 else: if int(float(get_floor_num(line))) > curFloorInBuilding: curFloor += 1 curFloorInBuilding += 1 print("}, {\"fields\": {") print(" \"floor\": " + str(curFloor) + ",") 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": { ... ...
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!