From 1420cf37a9434998a1bfd98d9487b4f619b54685 Mon Sep 17 00:00:00 2001 From: Phyks Date: Thu, 24 Apr 2014 16:23:28 +0200 Subject: [PATCH] Added extension checking when importing file --- main.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/main.py b/main.py index a425838..e15533d 100755 --- a/main.py +++ b/main.py @@ -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 " +