コード例 #1
0
ファイル: build.py プロジェクト: phildini/regulations-parser
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)
コード例 #2
0
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)
コード例 #3
0
ファイル: xml.py プロジェクト: theresaanna/regulations-parser
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)))
コード例 #4
0
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)))
コード例 #5
0
ファイル: xml.py プロジェクト: theresaanna/regulations-parser
 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")))
     )
コード例 #6
0
 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))
コード例 #7
0
 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))
コード例 #8
0
ファイル: xml.py プロジェクト: cmc333333/regulations-parser
 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'))))