def setup(self): """ Create a list where each list item is one Activity object """ self.activities = [] # rain_orgs = CordaidOrgs() outsys("\nRunning {}() ".format(who_am_i())) with open(RAIN_IATI_ACTIVITIES_XML, 'r') as f: iati_activities = etree.fromstring(f.read()) iati_activity_list = iati_activities.xpath('//iati-activity') for iati_activity in iati_activity_list: outsys(".") self.activities.append(RainActivity(iati_activity, RAIN_ACTIVITY_NS, AKVO_NS))
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(RAIN_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(RainActivity(iati_activity, RAIN_ACTIVITY_NS, AKVO_NS))
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(RAIN_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( RainActivity(iati_activity, RAIN_ACTIVITY_NS, AKVO_NS))
def run(self): outsys("\nProcessing projects") for activity in self.activities: outsys(".") project = self._process_project(activity)