aboutsummaryrefslogtreecommitdiff
path: root/src/web/views/article.py
diff options
context:
space:
mode:
authorCédric Bonhomme <cedric@cedricbonhomme.org>2016-10-06 10:40:55 +0200
committerCédric Bonhomme <cedric@cedricbonhomme.org>2016-10-06 10:40:55 +0200
commitf8b61ef5e163607731b992f9fdf0ec5840e5daaf (patch)
treed50c273be4f27954909f53822de757184792ee67 /src/web/views/article.py
parentRemoved refresh_rate column for the user table. (diff)
downloadnewspipe-f8b61ef5e163607731b992f9fdf0ec5840e5daaf.tar.gz
newspipe-f8b61ef5e163607731b992f9fdf0ec5840e5daaf.tar.bz2
newspipe-f8b61ef5e163607731b992f9fdf0ec5840e5daaf.zip
The export to HTML webzine functionality has been removed.
Diffstat (limited to 'src/web/views/article.py')
-rw-r--r--src/web/views/article.py21
1 files changed, 5 insertions, 16 deletions
diff --git a/src/web/views/article.py b/src/web/views/article.py
index eed9a9d3..572c019e 100644
--- a/src/web/views/article.py
+++ b/src/web/views/article.py
@@ -7,7 +7,7 @@ from flask_login import login_required, current_user
from bootstrap import db
-from web.export import export_json, export_html
+from web.export import export_json
from web.lib.utils import clear_string, redirect_url
from web.controllers import (ArticleController, UserController,
CategoryController)
@@ -125,23 +125,11 @@ def expire():
@login_required
def export():
"""
- Export all articles to HTML or JSON.
+ Export to OPML or JSON.
"""
user = UserController(current_user.id).get(id=current_user.id)
- if request.args.get('format') == "HTML":
- # Export to HTML
- try:
- archive_file, archive_file_name = export_html(user)
- except Exception as e:
- print(e)
- flash(gettext("Error when exporting articles."), 'danger')
- return redirect(redirect_url())
- response = make_response(archive_file)
- response.headers['Content-Type'] = 'application/x-compressed'
- response.headers['Content-Disposition'] = 'attachment; filename=%s' \
- % archive_file_name
- elif request.args.get('format') == "JSON":
- # Export to JSON
+ if request.args.get('format') == "JSON":
+ # Export to JSON for the export of account.
try:
json_result = export_json(user)
except Exception as e:
@@ -152,6 +140,7 @@ def export():
response.headers["Content-Disposition"] \
= 'attachment; filename=account.json'
elif request.args.get('format') == "OPML":
+ # Export to the OPML format.
categories = {cat.id: cat.dump()
for cat in CategoryController(user.id).read()}
response = make_response(render_template('opml.xml', user=user,
bgstack15