Indices list can only have +ve integers

This commit is contained in:
Arun Prakash Jana 2016-06-17 20:48:07 +05:30
parent 5b384e5db8
commit 50ffd25ba6
No known key found for this signature in database
GPG Key ID: C0A712ED95043DCB

13
buku
View File

@ -1662,17 +1662,18 @@ if __name__ == '__main__':
bdb.close_quit(1)
else:
ids = []
# Select the unique indices
for idx in args.delete:
if idx not in ids:
ids += (idx,)
ids.sort(key=lambda x: int(x), reverse=True)
for idx in ids:
if is_int(idx):
try:
# Index delete order - highest to lowest
ids.sort(key=lambda x: int(x), reverse=True)
for idx in ids:
bdb.delete_bookmark(int(idx))
else:
printmsg('Incorrect index %s' % idx, 'ERROR')
bdb.close_quit(1)
except ValueError as e:
printmsg('Index should be numerical (>= 0)', 'ERROR')
# Search URLs, titles, tags for any keyword
if args.sany is not None: