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.
This commit is contained in:
parent
bd91fa2e49
commit
bf1eca4c42
@ -69,7 +69,7 @@ TODO
|
|||||||
|
|
||||||
### Edit entries
|
### 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
|
### Data storage
|
||||||
|
|
||||||
|
@ -135,7 +135,7 @@ def deleteFile(filename):
|
|||||||
|
|
||||||
found = False
|
found = False
|
||||||
for key in bibtex.keys():
|
for key in bibtex.keys():
|
||||||
if bibtex[key]['file'] == filename:
|
if os.path.samepath(bibtex[key]['file'], filename):
|
||||||
found = True
|
found = True
|
||||||
try:
|
try:
|
||||||
os.remove(bibtex[key]['file'])
|
os.remove(bibtex[key]['file'])
|
||||||
@ -204,7 +204,7 @@ def getBibtex(entry, file_id = 'both'):
|
|||||||
pass
|
pass
|
||||||
elif file_id == 'both' or file_id == 'file':
|
elif file_id == 'both' or file_id == 'file':
|
||||||
for key in bibtex.keys():
|
for key in bibtex.keys():
|
||||||
if bibtex[key]['file'] == filename:
|
if os.path.samepath(bibtex[key]['file'], filename):
|
||||||
bibtex_entry = bibtex[key]
|
bibtex_entry = bibtex[key]
|
||||||
break
|
break
|
||||||
return bibtex_entry
|
return bibtex_entry
|
||||||
|
Loading…
Reference in New Issue
Block a user