Bugfixes in checkBibtex
* except too wide on first y / N * clean user input for isbn (remove '-' and ' ') * forgot a tools.
This commit is contained in:
parent
e538c16a42
commit
855e6fa1fc
@ -142,7 +142,6 @@ 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.
|
||||||
|
|
||||||
0. Add book
|
|
||||||
60. Unittest
|
60. Unittest
|
||||||
80. Search engine
|
80. Search engine
|
||||||
85. Anti-duplicate ?
|
85. Anti-duplicate ?
|
||||||
|
11
bmc.py
11
bmc.py
@ -27,11 +27,16 @@ def checkBibtex(filename, bibtex_string):
|
|||||||
bibtex = bibtex[bibtex.keys()[0]]
|
bibtex = bibtex[bibtex.keys()[0]]
|
||||||
# Check entries are correct
|
# Check entries are correct
|
||||||
assert bibtex['title']
|
assert bibtex['title']
|
||||||
assert bibtex['authors']
|
if bibtex['type'] == 'article':
|
||||||
|
assert bibtex['authors']
|
||||||
|
elif bibtex['type'] == 'book':
|
||||||
|
assert bibtex['author']
|
||||||
assert bibtex['year']
|
assert bibtex['year']
|
||||||
# Print the bibtex and confirm
|
# Print the bibtex and confirm
|
||||||
print(parsed2Bibtex(bibtex))
|
print(tools.parsed2Bibtex(bibtex))
|
||||||
check = tools.rawInput("Is it correct? [Y/n] ")
|
check = tools.rawInput("Is it correct? [Y/n] ")
|
||||||
|
except KeyboardInterrupt:
|
||||||
|
sys.exit()
|
||||||
except:
|
except:
|
||||||
check = 'n'
|
check = 'n'
|
||||||
|
|
||||||
@ -139,7 +144,7 @@ def addFile(src, filetype, manual, autoconfirm, tag):
|
|||||||
while isbn_manual not in ['isbn', 'manual', 'skip']:
|
while isbn_manual not in ['isbn', 'manual', 'skip']:
|
||||||
isbn_manual = tools.rawInput("ISBN / manual / skip? ").lower()
|
isbn_manual = tools.rawInput("ISBN / manual / skip? ").lower()
|
||||||
if isbn_manual == 'isbn':
|
if isbn_manual == 'isbn':
|
||||||
isbn = tools.rawInput('ISBN? ')
|
isbn = tools.rawInput('ISBN? ').replace(' ', '').replace('-', '')
|
||||||
elif isbn_manual == 'skip':
|
elif isbn_manual == 'skip':
|
||||||
return False
|
return False
|
||||||
elif doi is not False:
|
elif doi is not False:
|
||||||
|
Loading…
Reference in New Issue
Block a user