Ejemplo n.º 1
0
    def __init__(self):
        self.appliers = {
            'inline': InlineLayersApplier(),
            'paragraph': ParagraphLayersApplier(),
            'search_replace': SearchReplaceLayersApplier()
        }

        self.api = api_reader.ApiReader()
Ejemplo n.º 2
0
def get_regulation(regulation, version):
    """ Get the regulation JSON tree. Manipulate the label a bit for easier
    access in the templates."""
    api = api_reader.ApiReader()
    reg = api.regulation(regulation, version)

    if reg:
        title = reg['title']
        # up till the paren
        match = re.search('part \d+[^\w]*([^\(]*)', title, re.I)
        if match:
            reg['title_clean'] = match.group(1).strip()
        match = re.search('\(regulation (\w+)\)', title, re.I)
        if match:
            reg['reg_letter'] = match.group(1)

        return reg
Ejemplo n.º 3
0
def get_diff_json(regulation, older, newer):
    api = api_reader.ApiReader()
    return api.diff(regulation, older, newer)
Ejemplo n.º 4
0
def get_notice(part, document_number):
    """ Get a the data from a particular notice, given the Federal Register
    document number. """

    api = api_reader.ApiReader()
    return api.notice(part, document_number)
Ejemplo n.º 5
0
def get_all_notices(part):
    api = api_reader.ApiReader()
    return notices.fetch_all(api, part)
Ejemplo n.º 6
0
def get_tree_paragraph(paragraph_id, version):
    """Get a single level of the regulation tree."""
    api = api_reader.ApiReader()
    return api.regulation(paragraph_id, version)
Ejemplo n.º 7
0
 def __init__(self):
     config = conf.ConfigurationHandler().get_configuration_section(
         'ZILLOW')
     self._zwid = config['zwid']
     self._api_base_url = config['api_url']
     self._api = api.ApiReader()