Commit c052f929 authored by Daniel W Bond's avatar Daniel W Bond
Browse files

Merge branch 'roomnums' of git.gmu.edu:srct/roomlist

parents 185b0e2f 2b23b583
import re
from housing.models import Building, Floor, Room
with open('buildingFloors.txt','r') as building_floors:
for lines in building_floors:
lines.strip("\n")
pattern = re.compile("[A-Z a-z]")
if (pattern.match(lines))
greg_building = Building.objects.create(name=lines)
greg_building.save()
else
building_floor = Floor.objects.create(number=int(lines), building = greg_building)
building_floor.save()
with open('roomNunbers.txt','r') as roomnums:
for (morelines in roomnums):
morelines.strip("\n")
pattern = re.compile("[A-Z a-z]")
if (morelines is "Shenandoah" or morelines is "Aquia" or morelines is "Rappahannock"):
neighborhood = morelines
else (pattern.match(morelines)):
roomBuilding = morelines
while not(pattern.match(morelines))):
if (roomBuilding is "Commonwealth" or roomBuilding is "Dominion"):
room = Room.objects.create(number=int(morelines), floor=int(morelines[1]))
room.save()
else:
room = Room.objects.create(number=int(morelines), floor=int(morelines[0]))
room.save()
\ No newline at end of file
Adams
1
2
3
Harrison
1
2
3
Jackson
1
2
3
Jefferson
1
2
3
Kennedy
1
2
3
Lincoln
1
2
3
Madison
1
2
3
Monroe
1
2
3
Roosevelt
1
2
3
Truman
1
2
3
Wilson
1
2
3
Washington
1
2
3
Amherst
1
2
3
Brunswick
1
2
3
Carroll
1
2
3
Dickenson
1
2
3
Essex
1
2
3
Franklin
1
2
Grayson
1
2
Rogers
1
2
3
4
5
6
Whitetop
1
2
3
4
5
6
Eastern Shore
2
3
4
5
Commonwealth
2
3
4
5
Dominion
2
3
4
5
Potomac Heights
1
2
3
4
5
Blue Ridge
1
2
3
4
5
Northern Neck
1
2
3
4
5
Sandbridge
1
2
3
4
5
6
Adams
101
102
103
104
105
107
108
110
111
112
113
114
115
116
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
Harrison
106
107
108
109
110
111
112
113
201
202
203
204
205
206
207
208
209
210
211
213
215
301
302
303
304
305
306
307
308
309
310
311
312
313
315
Jackson
101
102
103
104
105
106
107
108
109
110
111
112
114
115
116
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
301
302
303
305
306
307
308
309
310
311
313
314
315
316
Jefferson
101
103
104
105
106
107
108
109
110
111
112
113
114
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
Kennedy
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
301
302
303
305
306
307
308
309
310
312
313
314
315
Lincoln
101
102
103
104
105
107
108
110
111
112
113
114
115
116
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
301
302
303
304
305
306
307
309
310
311
312
313
314
315
Madison
101
102
103
104
106
107
108
109
110
112
113
114
201
202
203
204
205
206
207
208
209
210
211
212
214
215
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
Monroe
101
103
104
105
106
107
108
109
110
111
112
113
114
115
201
202
203
204
205
206
207
208
209
210
211
212
214
215
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
Roosevelt
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
301
302
303
305
306
307
308
309
310
312
313
314
315
Truman
101
102
103
104
105
106
107
109
110
111
114
115
116
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
301
302
303
305
306
307
308
309
310
311
313
314
315
316
Wilson
101
103
104
105
106
107
108
109
110
111
112
113
114
115
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
Washington
101
102
103
104
106
107
108
109
110