From bf1eca4c42ef8ee34201f85f14cf674347135db5 Mon Sep 17 00:00:00 2001 From: Phyks Date: Sun, 4 May 2014 02:45:24 +0200 Subject: [PATCH] Update doc + bugfix in same file checking * README updated * Use os.path.samepath to test wether filenames strings are the same instead of direct comparison. --- README.md | 2 +- backend.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 5224524..46df6fd 100644 --- a/README.md +++ b/README.md @@ -69,7 +69,7 @@ TODO ### Edit entries -TODO +Run `./main.py edit PARAM` where `PARAM` should be either a path to a paper file or an ident in the bibtex index. This will open a text editor to edit the corresponding bibtex entry. ### Data storage diff --git a/backend.py b/backend.py index f339bc8..e827e38 100644 --- a/backend.py +++ b/backend.py @@ -135,7 +135,7 @@ def deleteFile(filename): found = False for key in bibtex.keys(): - if bibtex[key]['file'] == filename: + if os.path.samepath(bibtex[key]['file'], filename): found = True try: os.remove(bibtex[key]['file']) @@ -204,7 +204,7 @@ def getBibtex(entry, file_id = 'both'): pass elif file_id == 'both' or file_id == 'file': for key in bibtex.keys(): - if bibtex[key]['file'] == filename: + if os.path.samepath(bibtex[key]['file'], filename): bibtex_entry = bibtex[key] break return bibtex_entry