Closed tliu8 closed 8 years ago
forgot to say that the item is actually updated in the server but still gives the IndexError
thanks
Hm. I can't reproduce this, but it seems like the JSON processor is trying to find an item to process which doesn't exist.
I get the following error
Traceback (most recent call last): File "./updateEmptyTitles.py", line 128, in
zot.update_item(item)
File "/usr/lib/python2.6/site-packages/pyzotero/zotero.py", line 1079, in update_item
return self._json_processor(feedparser.parse(data))
File "/usr/lib/python2.6/site-packages/pyzotero/zotero.py", line 553, in _json_processor
items[key][u'etag'] = self.etags[key]
IndexError: list index out of range
while trying to update the title; it passed check_items()
items = zot.items(q='Frost') for item in items: if item['title'] == '': zot.update_item(item)
the item itself
{u'DOI': u'', u'itemType': u'journalArticle', u'extra': u'', u'seriesText': u'', u'series': u'', u'abstractNote': u'Our understanding of the way in which HIV responds to highly active antiretroviral therapy (HAART) has benefited greatly from the use of mathematical models of viral dynamics and evolution. In this paper, I review the role that these models may play in the design and analysis of studies of structured treatment interruptions (STIs). STIs are being investigated in several different contexts: to reduce drug toxicities; to boost HIV-specific immune responses; and to allow reversion of drug resistance mutations in highly drug-experienced patients. I illustrate how models can help to compare the dynamics and evolution of HIV in these different scenarios, and to assess the risks and benefits of STIs.', u'archive': u'', u'title': u'Dynamics and evolution of HIV-1 during structured treatment interruptions.', u'ISSN': u'', u'archiveLocation': u'', u'etag': '5f95cc6480c65c5a914ce0121c45111f', u'journalAbbreviation': u'', u'issue': u'3', u'seriesTitle': u'', u'updated': 'Wed, 09 Apr 2014 20:08:16 PST', u'tags': [], u'accessDate': u'', u'libraryCatalog': u'', u'volume': u'4', u'callNumber': u'', u'key': u'4JR9SQ96', u'date': u'June 2002', u'pages': u'119\u2013127', u'group_id': u'835960', u'shortTitle': u'', u'language': u'English', u'rights': u'', u'url': u'http://eutils.ncbi.nlm.nih.gov/entrez/eutils/elink.fcgi?dbfrom=pubmed&id=12416446&retmode=ref&cmd=prlinks', u'publicationTitle': u'AIDS reviews', u'creators': [{u'lastName': u'Frost', u'creatorType': u'author', u'firstName': u'Simon D W'}]}
thank you very much for any help and thanks for the module