Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SRCT
roomlist
Commits
4df57e6b
Commit
4df57e6b
authored
Apr 09, 2015
by
Jason Yeomans
Browse files
Added freshman buildings (except Commonwealth and Dominion) to inital_data.json
parent
eed3643f
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
roomlist/housing/initial_data.json
View file @
4df57e6b
This diff is collapsed.
Click to expand it.
roomlist/housing/room-numbers.py
View file @
4df57e6b
...
@@ -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": {
...
...
roomlist/housing/room-output.json
0 → 100644
View file @
4df57e6b
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment