Added extension checking when importing file

This commit is contained in:
Phyks 2014-04-24 16:23:28 +02:00
parent ea53e0720f
commit 1420cf37a9
1 changed files with 5 additions and 1 deletions

View File

@ -98,7 +98,11 @@ def addFile(src):
"""
Add a file to the library
"""
doi = PDF2Doi(src)
# TODO : Handle books + djvu
if src.endswith(".pdf"):
doi = PDF2Doi(src)
elif src.endswith(".djvu"):
raise Exception("TODO")
if doi is False:
print("Could not determine the DOI for "+src+", switching to manual " +