From 02d5e73e01649c78036581bdb3f1052020e8cbbd Mon Sep 17 00:00:00 2001 From: Hails Date: Sat, 22 Oct 2022 20:02:05 -0400 Subject: [PATCH] Add files via upload admittedly slightly hippie-dippy way of fixing this but tbh at this point i just want this bug to be over with. if self.legistar_start(event) is None, then make the start a passed time that will register the meeting on the Documenters.org website as 'passed' (i.e. a meeting that is already passed and shouldn't be assigned). --- city_scrapers/spiders/cle_city_council.py | 38 +++++++++++++---------- 1 file changed, 22 insertions(+), 16 deletions(-) diff --git a/city_scrapers/spiders/cle_city_council.py b/city_scrapers/spiders/cle_city_council.py index 968a85e..59da167 100644 --- a/city_scrapers/spiders/cle_city_council.py +++ b/city_scrapers/spiders/cle_city_council.py @@ -1,3 +1,5 @@ +from datetime import datetime +from tracemalloc import start from city_scrapers_core.constants import CITY_COUNCIL, COMMITTEE from city_scrapers_core.items import Meeting from city_scrapers_core.spiders import LegistarSpider @@ -18,26 +20,30 @@ def parse_legistar(self, events): needs. """ for event in events: + if (self.legistar_start(event) is None): - return + start = datetime.strptime("01-01-01 00:00:00", '%y-%m-%d %H:%M:%S') else: - meeting = Meeting( - title=event["Name"]["label"], - description=self._parse_description(event), - classification=self._parse_classification(event), - start=self.legistar_start(event), - end=None, - all_day=False, - time_notes="", - location=self._parse_location(event), - links=self.legistar_links(event), - source=self.legistar_source(event), - ) + start = self.legistar_start(event) + + print(self.legistar_start(event)) + meeting = Meeting( + title=event["Name"]["label"], + description=self._parse_description(event), + classification=self._parse_classification(event), + start=start, + end=None, + all_day=False, + time_notes="", + location=self._parse_location(event), + links=self.legistar_links(event), + source=self.legistar_source(event), + ) - meeting["status"] = self._get_status(meeting) - meeting["id"] = self._get_id(meeting) + meeting["status"] = self._get_status(meeting) + meeting["id"] = self._get_id(meeting) - yield meeting + yield meeting def _parse_description(self, item): """Parse or generate meeting description."""