diff options
author | cedricbonhomme <devnull@localhost> | 2011-06-20 19:16:43 +0200 |
---|---|---|
committer | cedricbonhomme <devnull@localhost> | 2011-06-20 19:16:43 +0200 |
commit | f8b69e2458bebd5b4ae3aa59d4396e8d5eab807d (patch) | |
tree | bb323f1db585d2a4b8cd2e7f99e5f30806763fc7 /utils.py | |
parent | Minor bugfix in a form. (diff) | |
download | newspipe-f8b69e2458bebd5b4ae3aa59d4396e8d5eab807d.tar.gz newspipe-f8b69e2458bebd5b4ae3aa59d4396e8d5eab807d.tar.bz2 newspipe-f8b69e2458bebd5b4ae3aa59d4396e8d5eab807d.zip |
It is now possible to change the name of a feed anytime via the feed management page. The data base is automatically uptodated.
Diffstat (limited to 'utils.py')
-rwxr-xr-x | utils.py | 15 |
1 files changed, 14 insertions, 1 deletions
@@ -255,7 +255,7 @@ def add_feed(feed_url): def change_feed_url(old_feed_url, new_feed_url): """ - Change the URL of a feed. + Change the URL of a feed given in parameter. """ # Replace the URL in the text file with open("./var/feed.lst", "r") as f: @@ -278,6 +278,19 @@ def change_feed_url(old_feed_url, new_feed_url): except Exception, e: print e +def change_feed_name(feed_url, new_feed_name): + """ + Change the name of a feed given in parameter. + """ + try: + conn = sqlite3.connect(sqlite_base, isolation_level = None) + c = conn.cursor() + c.execute('UPDATE feeds SET feed_title="' + new_feed_name + '" WHERE feed_link="' + feed_url +'"') + conn.commit() + c.close() + except Exception, e: + print e + def remove_feed(feed_url): """ Remove a feed from the file feed.lst and from the SQLite base. |