ljhopkins2 / broadcastify-archtk

The Broadcastify Archive Toolkit for python
https://ljhopkins2.github.io/broadcastify-archtk/
GNU Affero General Public License v3.0
8 stars 9 forks source link

Navigation times out if first date in build is current date #20

Closed ljhopkins2 closed 4 years ago

ljhopkins2 commented 4 years ago

Line 727 in go_to_date()?

TEST_FEED_ID = '14439' # Travis County, Austin, TX
archive = pybartok.BroadcastifyArchive(TEST_FEED_ID)
~/data_science/personal_projects/pyBArTOK/pybartok_distn/pybartok/pybartok.py in build(self, start, end, days_back, chronological, rebuild)
    357                                     # f'({i + 1} of {len(date_list)})')
    358             t.set_description(f'Building {date}', refresh=True)
--> 359             self.arch_cal.go_to_date(date)
    360 
    361             if self.arch_cal.entries_for_date:

~/data_science/personal_projects/pyBArTOK/pybartok_distn/pybartok/pybartok.py in go_to_date(self, date)
    725                 self._parent.throttle.throttle('date_nav')
    726                 self._browser.find_element_by_class_name('today').click()
--> 727                 self._wait_for_refresh()
    728                 return self._displayed_month_dt
    729             except _NSEE:
ljhopkins2 commented 4 years ago

Added this code to check that we actually needed to wait for the calendar to refresh:

# Check that we need to wait for a refresh
if (self.active_date.month != self._displayed_month_dt.month
    ) or (self.active_date.year != self._displayed_month_dt.year):
     self._wait_for_refresh()