Skip to content

Commit 0ca1bb7

Browse files
committed
Improve warnings for double inclusions
1 parent 8940237 commit 0ca1bb7

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

zot.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,20 @@ def compile_data(collection_id, collection_name, exclude={}):
393393
for i in a:
394394
key = i[u'id']
395395
if item_ids.has_key(key):
396-
print("warning - item %s included additionally in collection %s"%(key, collection_name))
396+
auth = ""
397+
# if u'author' in i:
398+
# a += ",".join(i[u'author'].values())
399+
# elif u'editor' in i:
400+
# a += ",".join(i[u'editor'])
401+
if u'title' in i:
402+
auth = i[u'title'][:14]
403+
404+
year = ""
405+
if u'issued' in i and u'raw' in i[u'issued']:
406+
year = i[u'issued'][u'raw']
407+
408+
ref = "%s (%s)"%(auth, year)
409+
print("warning - item %s also included in collection %s"%(ref, collection_name))
397410
item_ids[key] = True
398411
counter += 1
399412

0 commit comments

Comments
 (0)