def fetch_cfr_parts(notice_xml): """ Sometimes we need to read the CFR part numbers from the notice XML itself. This would need to happen when we've broken up a multiple-effective-date notice that has multiple CFR parts that may not be included in each date. """ cfr_elm = notice_xml.xpath('//CFR')[0] results = notice_cfr_p.parseString(cfr_elm.text) return list(results)
def fetch_cfr_parts(notice_xml): """ Sometimes we need to read the CFR part numbers from the notice XML itself. This would need to happen when we've broken up a multiple-effective-date notice that has multiple CFR parts that may not be included in each date. """ cfr_elm = notice_xml.xpath('//CFR')[0] results = notice_cfr_p.parseString(cfr_elm.text) return list(results)
def fetch_cfr_parts(notice_xml): """ Sometimes we need to read the CFR part numbers from the notice XML itself. This would need to happen when we've broken up a multiple-effective-date notice that has multiple CFR parts that may not be included in each date. """ parts = [] for cfr_elm in notice_xml.xpath("//CFR"): parts.extend(notice_cfr_p.parseString(cfr_elm.text).cfr_parts) return list(sorted(set(parts)))
def fetch_cfr_parts(notice_xml): """ Sometimes we need to read the CFR part numbers from the notice XML itself. This would need to happen when we've broken up a multiple-effective-date notice that has multiple CFR parts that may not be included in each date. """ parts = [] for cfr_elm in notice_xml.xpath('//CFR'): parts.extend(notice_cfr_p.parseString(cfr_elm.text).cfr_parts) return list(sorted(set(parts)))
def cfr_titles(self): return list( sorted(set(int(notice_cfr_p.parseString(cfr_elm.text).cfr_title) for cfr_elm in self.xpath("//CFR"))) )
def derive_cfr_refs(self): """Pull out CFR information from the CFR tag""" for cfr_elm in self.xpath('//CFR'): result = notice_cfr_p.parseString(cfr_elm.text) yield TitlePartsRef(result.cfr_title, list(result.cfr_parts))
def derive_cfr_refs(self): """Pull out CFR information from the CFR tag""" for cfr_elm in self.xpath('//CFR'): result = notice_cfr_p.parseString(cfr_elm.text) yield TitlePartsRef(result.cfr_title, list(result.cfr_parts))
def cfr_titles(self): return list(sorted(set( int(notice_cfr_p.parseString(cfr_elm.text).cfr_title) for cfr_elm in self.xpath('//CFR'))))