def setup(self): """ Create a list where each list item is one Activity object """ self.activities = [] outsys("\nRunning {}() ".format(who_am_i())) xml = load_xml(RVO_IATI_ACTIVITES_URL) if xml: parser = etree.XMLParser(ns_clean=True, recover=True, encoding='utf-8') iati_activities = etree.fromstring(xml, parser=parser) iati_activity_list = iati_activities.xpath('//iati-activity') for iati_activity in iati_activity_list: outsys(".") self.activities.append(RvoActivity(iati_activity))
def run(self): outsys("\nProcessing projects") for activity in self.activities: outsys(".") project = self._process_project(activity)