aboutsummaryrefslogtreecommitdiff
path: root/pyaggr3g470r/utils.py
diff options
context:
space:
mode:
authorCédric Bonhomme <cedric@cedricbonhomme.org>2014-02-09 22:09:29 +0100
committerCédric Bonhomme <cedric@cedricbonhomme.org>2014-02-09 22:09:29 +0100
commit2b835245140923e36f9d3ecba06442137ba2ae43 (patch)
tree7b446a52c4ba754a354b57620ff0d3c3fddf48f9 /pyaggr3g470r/utils.py
parentUpdated initialization script. (diff)
downloadnewspipe-2b835245140923e36f9d3ecba06442137ba2ae43.tar.gz
newspipe-2b835245140923e36f9d3ecba06442137ba2ae43.tar.bz2
newspipe-2b835245140923e36f9d3ecba06442137ba2ae43.zip
Improved OPML import.
Diffstat (limited to 'pyaggr3g470r/utils.py')
-rwxr-xr-xpyaggr3g470r/utils.py6
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):
"""
bgstack15