forked from indymedia/epicyon
Ensure that line endings are removed
parent
949f52ae9b
commit
48f6bbf482
|
@ -51,14 +51,12 @@ def undoBookmarksCollectionEntry(recentPostsCache: {},
|
||||||
bookmarkIndex = postFilename.split('/')[-1].strip()
|
bookmarkIndex = postFilename.split('/')[-1].strip()
|
||||||
else:
|
else:
|
||||||
bookmarkIndex = postFilename.strip()
|
bookmarkIndex = postFilename.strip()
|
||||||
|
bookmarkIndex = bookmarkIndex.replace('\n', '')
|
||||||
if bookmarkIndex not in open(bookmarksIndexFilename).read():
|
if bookmarkIndex not in open(bookmarksIndexFilename).read():
|
||||||
return
|
return
|
||||||
indexStr = ''
|
indexStr = ''
|
||||||
indexStrChanged = False
|
|
||||||
with open(bookmarksIndexFilename, 'r') as indexFile:
|
with open(bookmarksIndexFilename, 'r') as indexFile:
|
||||||
indexStr = indexFile.read().replace(bookmarkIndex + '\n', '')
|
indexStr = indexFile.read().replace(bookmarkIndex + '\n', '')
|
||||||
indexStrChanged = True
|
|
||||||
if indexStrChanged:
|
|
||||||
bookmarksIndexFile = open(bookmarksIndexFilename, 'w')
|
bookmarksIndexFile = open(bookmarksIndexFilename, 'w')
|
||||||
if bookmarksIndexFile:
|
if bookmarksIndexFile:
|
||||||
bookmarksIndexFile.write(indexStr)
|
bookmarksIndexFile.write(indexStr)
|
||||||
|
|
Loading…
Reference in New Issue