Skip to content

Commit 52abf46

Browse files
authored
Merge pull request #7 from dhtech/furest-hall
Use the hall data from the seatmap
2 parents 365414d + 7c41095 commit 52abf46

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

lib/location.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def add_coordinates(seatmap, cursor):
3434
continue
3535
table = normalize_table_name(seat['row'])
3636
logging.debug("Normalized table name %s to %s", seat['row'], table)
37-
hall = get_hall_from_table_name(table)
37+
hall = seat['hall']
3838
halls.setdefault(hall, []).append(seat)
3939
tables.setdefault(hall, {}).setdefault(table, []).append(seat)
4040

@@ -49,7 +49,7 @@ def add_coordinates(seatmap, cursor):
4949
if not switches.get(table, []):
5050
logging.debug("Table %s has no switches, ignoring", table)
5151
continue
52-
c, scale = table_location(table, tables)
52+
c, scale = table_location(table, tables, hall)
5353
scales.append(scale)
5454
table_coordinates[hall].append((table, c))
5555

@@ -129,9 +129,9 @@ def switch_locations(t, n):
129129
return locations
130130

131131

132-
def table_location(table, tables):
132+
def table_location(table, tables, hall):
133133
seats = sorted(
134-
tables[get_hall_from_table_name(table)][table],
134+
tables[hall][table],
135135
key=lambda seat: int(seat['seat']))
136136
logging.debug("First and last seat on %s is %s and %s",
137137
table, seats[0]["seat"], seats[-1]["seat"])

0 commit comments

Comments
 (0)