diff options
author | Jordan <me@jordan.im> | 2020-04-06 00:23:32 -0700 |
---|---|---|
committer | Jordan <me@jordan.im> | 2020-04-06 00:23:32 -0700 |
commit | 187b714507a2e9f8642dedbb24f2766ecfa55454 (patch) | |
tree | 2af65da2db6c4cf20ba5444ba74ad1e0261727a0 | |
parent | 759800be93dfffd9ae48457817705a11b73c31f7 (diff) | |
download | roka-187b714507a2e9f8642dedbb24f2766ecfa55454.tar.gz roka-187b714507a2e9f8642dedbb24f2766ecfa55454.zip |
revert 759800be
reverts commit 759800be93dfffd9ae48457817705a11b73c31f7
-rwxr-xr-x | run.py | 15 |
1 files changed, 4 insertions, 11 deletions
@@ -9,7 +9,6 @@ from collections import OrderedDict from operator import getitem from datetime import date, timedelta from flask import Flask, request, Response, render_template, send_file -from xml.dom import minidom abs_path = os.path.dirname(os.path.abspath(__file__)) app = Flask(__name__) @@ -41,15 +40,6 @@ def check_auth(username, password): return ret -def xml_prettify(elem): - ''' - Make our XML response human-readable - ''' - xml_str = ET.tostring(elem, encoding='utf8', method='xml') - xml_dom = minidom.parseString(xml_str) - - return xml_dom.toprettyxml(indent=' ') - @app.route('/') def list_books(): ''' @@ -191,7 +181,10 @@ def list_books(): } ET.SubElement(item, 'enclosure', enc_attr) - return Response(xml_prettify(rss), mimetype='text/xml') + return Response( + ET.tostring(rss, encoding='utf8', method='xml'), + mimetype='text/xml' + ) else: auth = request.authorization if not auth or not check_auth(auth.username, auth.password): |