~phroa/boat-map

afe4f60d3faa3a4ae16f259664340c74e368565f — Jack Stratton 7 months ago c861574
Maybe fix time calculation?  12pm is interpreted as 24:00
1 files changed, 2 insertions(+), 2 deletions(-)

M make-map.py
M make-map.py => make-map.py +2 -2
@@ 146,7 146,7 @@ def draw_schedule():
                cell_contents = ''
            if len(col.xpath('div/div[@class="pm"]')) > 0 and ':' in cell_contents:
                hour, minute = map(int, cell_contents.split(':'))
                times.append(60 * (hour + 12) + minute)
                times.append(60 * ((hour if hour != 12 else 0) + 12) + minute)
                cell_contents += 'p'
            elif ':' in cell_contents:
                hour, minute = map(int, cell_contents.split(':'))


@@ 156,7 156,7 @@ def draw_schedule():
            elif 'Midnight' in cell_contents:
                times.append(60 * 24)
            line.append(cell_contents)
        if current_time.tm_hour * 60 + current_time.tm_min < max(times):
        if (current_time.tm_hour + 1) * 60 + current_time.tm_min < max(times):
            schedule_lines[current_label].append('{}  {:6} {:6} {:6} {:6} {:6}'.format(*line))

    mf_or_satsun = 'Saturday and Sunday' if time.localtime().tm_wday > 4 else 'Monday through Friday'