diff options
author | Cédric Bonhomme <cedric@cedricbonhomme.org> | 2014-02-09 22:09:29 +0100 |
---|---|---|
committer | Cédric Bonhomme <cedric@cedricbonhomme.org> | 2014-02-09 22:09:29 +0100 |
commit | 2b835245140923e36f9d3ecba06442137ba2ae43 (patch) | |
tree | 7b446a52c4ba754a354b57620ff0d3c3fddf48f9 /pyaggr3g470r/utils.py | |
parent | Updated initialization script. (diff) | |
download | newspipe-2b835245140923e36f9d3ecba06442137ba2ae43.tar.gz newspipe-2b835245140923e36f9d3ecba06442137ba2ae43.tar.bz2 newspipe-2b835245140923e36f9d3ecba06442137ba2ae43.zip |
Improved OPML import.
Diffstat (limited to 'pyaggr3g470r/utils.py')
-rwxr-xr-x | pyaggr3g470r/utils.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/pyaggr3g470r/utils.py b/pyaggr3g470r/utils.py index 4d65f14c..bb02c4df 100755 --- a/pyaggr3g470r/utils.py +++ b/pyaggr3g470r/utils.py @@ -81,13 +81,14 @@ def import_opml(email, opml_file): subscriptions = opml.parse(opml_file) except Exception as e: raise e + nb = 0 for subscription in subscriptions: try: title = subscription.text except: title = "" - print title + try: description = subscription.description except: @@ -109,8 +110,11 @@ def import_opml(email, opml_file): new_feed = models.Feed(title=title, description=description, link=link, site_link=site_link, email=False, enabled=True) user.feeds.append(new_feed) + + nb += 1 user.save() + return nb def open_url(url): """ |