From 901fbd154f16268ca4c9d10af8d038d684c8c4f4 Mon Sep 17 00:00:00 2001 From: cedricbonhomme Date: Thu, 8 Nov 2012 23:08:35 +0100 Subject: Porting to Python 3.2. Better, faster, stronger. --- source/export.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source/export.py') diff --git a/source/export.py b/source/export.py index 8380682a..f2fbd729 100644 --- a/source/export.py +++ b/source/export.py @@ -160,8 +160,8 @@ def export_pdf(feeds): Export the articles given in parameter in PDF files. """ from xhtml2pdf import pisa - import cStringIO as StringIO - for feed in feeds.values(): + import io as StringIO + for feed in list(feeds.values()): # creates folder for each stream folder = utils.path + "/var/export/pdf/" + \ utils.normalize_filename(feed.feed_title.strip().replace(':', '').lower()) @@ -171,7 +171,7 @@ def export_pdf(feeds): # directories already exists (not a problem) pass - for article in feed.articles.values(): + for article in list(feed.articles.values()): name = article.article_date.strip().replace(' ', '_') name = os.path.normpath(folder + "/" + name + ".pdf") -- cgit