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. 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 ? 50. Anti-duplicate ?
60. Check stored versions when updating arxiv papers 60. Check stored versions when updating arxiv papers
65. Look for published version in arXiv 65. Look for published version in arXiv

25
main.py
View File

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