Browse Source

Pequenos ajustes LexML

pull/2582/head
Edward Ribeiro 6 years ago
parent
commit
94273c3ebf
  1. 14
      sapl/lexml/OAIServer.py
  2. 2
      sapl/lexml/views.py

14
sapl/lexml/OAIServer.py

@ -267,16 +267,18 @@ def get_xml_provedor():
descricao = descricao.encode('utf-8')
return descricao
def get_config(url, batch_size):
config = {'content_type': None,
'delay': 0,
'base_asset_path': None,
'metadata_prefixes': ['oai_lexml']}
config.update({'titulo': casa_legislativa().nome, # Inicializa variável global casa
'email': [casa.email], # lista de e-mails
'base_url': url[:url.find('/', 8)],
'descricao': get_xml_provedor(),
'batch_size': batch_size})
'metadata_prefixes': ['oai_lexml'],
'titulo': casa_legislativa().nome, # Inicializa variável global casa
'email': [casa.email], # lista de e-mails, antigo `def get_email()`
'base_url': url[:url.find('/', 8)],
'descricao': get_xml_provedor(),
'batch_size': batch_size
}
return config

2
sapl/lexml/views.py

@ -10,7 +10,7 @@ LexmlPublicadorCrud = CrudAux.build(LexmlPublicador, 'lexml_publicador')
def lexml_request(request):
config = get_config(request.get_raw_uri(), int(request.GET.get('batch_size', 10)))
config = get_config(request.get_raw_uri(), int(request.GET.get('batch_size', '10')))
oai_server = OAIServerFactory(config)
r = oai_server.handleRequest(request.GET)
response = r.decode('UTF-8')

Loading…
Cancel
Save