View Single Post
Old 01-06-2013, 12:43 PM   #1
johanp began at the beginning.
Posts: 15
Karma: 10
Join Date: Jan 2010
Location: Stockholm, Sweden
Device: Kobo Glo, PocketBook Touch 622
Fetching from python script


I have a setup where I fetch news from a python script on my Linux server using cron. It works well apart from for which the description string contains non-ascii characters. I get the "Failed to find builtin recipe: " error. I'm running Python 2.7.1. I copied the description string from the builtin_recipes.xml file. Script:

# -*- coding: utf-8 -*-

import os, subprocess, tempfile

os.environ['DISPLAY'] = ':1'

recipes = [u' Новости' 'Dagens Nyheter', \
           'Svenska Dagbladet', 'BBC News', 'La Repubblica']

tmp_dir = tempfile.mkdtemp()
out_file = tmp_dir + "/news.epub"

for recipe in recipes:["ebook-convert", recipe + ".recipe", out_file])["calibredb", "add", out_file])

Any clue how to make this work?
johanp is offline   Reply With Quote