Bugfix in manual mode

This commit is contained in:
Phyks 2014-05-15 00:11:56 +02:00
parent e5cf3441aa
commit 62706c5364
2 changed files with 19 additions and 8 deletions

View File

@ -138,6 +138,8 @@ 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.
30. Skip article
40. Option to automatically confirm
50. Anti-duplicate ?
60. Check stored versions when updating arxiv papers
65. Look for published version in arXiv

19
main.py
View File

@ -24,10 +24,13 @@ def checkBibtex(filename, bibtex_string):
bibtex = BibTexParser(bibtex_string)
bibtex = bibtex.get_entry_dict()
try:
bibtex = bibtex[bibtex.keys()[0]]
print(bibtex_string)
check = tools.rawInput("Is it correct? [Y/n] ")
except:
check = 'n'
try:
old_filename = bibtex['file']
except:
@ -46,17 +49,23 @@ def checkBibtex(filename, bibtex_string):
bibtex = bibtex[bibtex.keys()[0]]
except:
tools.warning("Invalid bibtex entry")
bibtex_string = False
bibtex_string = ''
tools.rawInput("Press Enter to go back to editor.")
continue
if('authors' not in bibtex and 'title' not in bibtex and 'year' not in
bibtex):
tools.warning("Invalid bibtex entry")
bibtex_string = ''
tools.rawInput("Press Enter to go back to editor.")
continue
if old_filename is not False and 'file' not in bibtex:
tools.warning("Invalid bibtex entry. No filename given.")
tools.rawInput("Press Enter to go back to editor.")
check = 'n'
else:
if bibtex_string is not False:
bibtex_string = tools.parsed2Bibtex(bibtex)
else:
bibtex_string = ''
print("\nThe bibtex entry for "+filename+" is:")
print(bibtex_string)
check = tools.rawInput("Is it correct? [Y/n] ")