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