Skip to content

Commit

Permalink
Improve warnings for double inclusions
Browse files Browse the repository at this point in the history
  • Loading branch information
davidswelt committed Jul 4, 2014
1 parent 8940237 commit 0ca1bb7
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion zot.py
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,20 @@ def compile_data(collection_id, collection_name, exclude={}):
for i in a:
key = i[u'id']
if item_ids.has_key(key):
print("warning - item %s included additionally in collection %s"%(key, collection_name))
auth = ""
# if u'author' in i:
# a += ",".join(i[u'author'].values())
# elif u'editor' in i:
# a += ",".join(i[u'editor'])
if u'title' in i:
auth = i[u'title'][:14]

year = ""
if u'issued' in i and u'raw' in i[u'issued']:
year = i[u'issued'][u'raw']

ref = "%s (%s)"%(auth, year)
print("warning - item %s also included in collection %s"%(ref, collection_name))
item_ids[key] = True
counter += 1

Expand Down

0 comments on commit 0ca1bb7

Please sign in to comment.