Psycojoker / dierentheater

lachambre.be_to_json
GNU Affero General Public License v3.0
8 stars 6 forks source link

Document small format change broke the parser #1

Open Psycojoker opened 12 years ago

Psycojoker commented 12 years ago
2012-05-18 02:33:10,645 - [x] Received <Task: parse_a_document(3)>, processing...
Traceback (most recent call last):
  File "/home/bram/dierentuin/scheduler/scheduler.py", line 37, in loop
    perform_task(task)
  File "/home/bram/dierentuin/scheduler/scheduler.py", line 58, in wrapper
    return func(task)
  File "/home/bram/dierentuin/scheduler/scheduler.py", line 72, in perform_task
    operations[task.function](*task.args)
  File "/home/bram/dierentuin/lachambre_parser/documents.py", line 103, in parse_a_document
    handle_document(Document.objects.get(lachambre_id=lachambre_id))
  File "/home/bram/dierentuin/lachambre_parser/documents.py", line 121, in handle_document
    _get_document_chambre(dico, dico_nl, document)
  File "/home/bram/dierentuin/lachambre_parser/documents.py", line 340, in _get_document_chambre
    _get_next_documents(chambre_dico, chambre_dico_nl, document_chambre)
  File "/home/bram/dierentuin/lachambre_parser/documents.py", line 378, in _get_next_documents
    doc.authors.append({"lachambre_id": -1, "id": -1, "full_name": dep('td')[-1].contents[2].strip(), "role": {"fr": dep('td')[-1].i.text[1:-1], "nl": dep_nl('td')[-1].i.text[1:-1]}})
IndexError: list index out of range
2012-05-18 02:33:11,749 - /!\ parse_a_document(3) didn't succed! Error: list index out of range
> /home/bram/dierentuin/lachambre_parser/documents.py(378)_get_next_documents()
    377                 else:
--> 378                     doc.authors.append({"lachambre_id": -1, "id": -1, "full_name": dep('td')[-1].contents[2].strip(), "role": {"fr": dep('td')[-1].i.text[1:-1], "nl": dep_nl('td')[-1].i.text[1:-1]}})
    379             doc.save()