aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcedricbonhomme <devnull@localhost>2012-05-01 18:37:52 +0200
committercedricbonhomme <devnull@localhost>2012-05-01 18:37:52 +0200
commit15a0cb06132587fd69afd0e405b6c9b8672f4db7 (patch)
tree4e7c29c6a5bfa35faed55a0e609a030ef96a62b1
parentIt is now possible to update information about a feed with the MongoDG database. (diff)
downloadnewspipe-15a0cb06132587fd69afd0e405b6c9b8672f4db7.tar.gz
newspipe-15a0cb06132587fd69afd0e405b6c9b8672f4db7.tar.bz2
newspipe-15a0cb06132587fd69afd0e405b6c9b8672f4db7.zip
Improved change_feed_url() function.
-rwxr-xr-xsource/utils.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/source/utils.py b/source/utils.py
index 26492b8d..a4506d07 100755
--- a/source/utils.py
+++ b/source/utils.py
@@ -244,8 +244,9 @@ def change_feed_url(old_feed_url, new_feed_url):
# Replace the URL in the text file
with open("./var/feed.lst", "r") as f:
lines = f.readlines()
+ lines = map(str.strip, lines)
try:
- lines[lines.index(old_feed_url+"\n")] = new_feed_url + '\n'
+ lines[lines.index(old_feed_url)] = new_feed_url
except:
return
with open("./var/feed.lst", "w") as f:
bgstack15