diff --git a/README.md b/README.md index 8c51fb5..8e1fa27 100644 --- a/README.md +++ b/README.md @@ -47,13 +47,25 @@ Should be almost working and usable now, although still to be considered as **ex * Update * working + +**Error reporting :** If you have any issue with this script, please report error. If possible, send me the article responsible for the error, or at least give me the reference so that I can test and debug easily. + ## Installation -* Clone this git repository where you want : `git clone https://github.com/Phyks/BMC` +* Clone this git repository where you want: +``` +git clone https://github.com/Phyks/BMC +``` * Install `requesocks`, `bibtexparser` (https://github.com/sciunto/python-bibtexparser), `PyPDF2` and `isbntools` _via_ Pypi -* Install `pdftotext` (provided by Xpdf) and `djvulibre` _via_ your package manager the way you want +``` +sudo pip install requesocks bibtexparser pyPDF2 isbntools +``` +(replace pip by pip2 if your distribution ships python3 by default) +* Install `pdftotext` (provided by Xpdf) and `djvulibre` _via_ your package manager or the way you want * Copy `params.py.example` to `params.py` and customize it to fit your needs +*Note:* To update the script, just run `git pull` in the script dir. + ## Usage ### To import an existing PDF / Djvu file @@ -127,14 +139,13 @@ Here are some sources of inspirations for this project : A list of ideas and TODO. Don't hesitate to give feedback on the ones you really want or to propose your owns. 50. Anti-duplicate ? +60. Check stored versions when updating arxiv papers 65. Look for published version in arXiv -70. No DOI for HAL => metadata with SOAP API… don't want to handle it for now :/ +70. Export of bibtex 80. Search engine +90. No DOI for HAL => metadata with SOAP API… don't want to handle it for now :/ 200. Webserver interface ? GUI ? (not likely for now…) -Keep multiple versions of papers -Check stored versions when updating arxiv papers -Export of bibtex -Tree à la docear ? +300. Tree à la docear ? ## Thanks diff --git a/backend.py b/backend.py index c402378..2c78241 100644 --- a/backend.py +++ b/backend.py @@ -36,10 +36,10 @@ def getNewName(src, bibtex, tag=''): new_name = new_name.replace("%l", authors[-1].split(',')[0].strip()) new_name = new_name.replace("%a", ', '.join([i.split(',')[0].strip() for i in authors])) - if('archiveprefix' not in bibtex or - 'arXiv' not in bibtex['archiveprefix']): + if('archiveprefix' in bibtex and + 'arXiv' in bibtex['archiveprefix']): new_name = new_name.replace("%v", - bibtex[eprint][bibtex['eprint'].rfind('v'):]) + bibtex['eprint'][bibtex['eprint'].rfind('v'):]) else: new_name = new_name.replace("%v", '')