mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 02:34:06 -04:00
Sync to trunk.
This commit is contained in:
commit
c20d643a67
17
resources/recipes/golem_de.recipe
Normal file
17
resources/recipes/golem_de.recipe
Normal file
@ -0,0 +1,17 @@
|
||||
from calibre.web.feeds.news import BasicNewsRecipe
|
||||
|
||||
class AdvancedUserRecipe1257093338(BasicNewsRecipe):
|
||||
title = u'Golem.de'
|
||||
language = 'de'
|
||||
__author__ = 'Kovid Goyal'
|
||||
oldest_article = 7
|
||||
max_articles_per_feed = 100
|
||||
|
||||
feeds = [(u'Golem.de', u'http://rss.golem.de/rss.php?feed=ATOM1.0')]
|
||||
|
||||
def print_version(self, url):
|
||||
murxb = url.rfind('/') + 1
|
||||
murxc = url[murxb :-5]
|
||||
murxa = 'http://www.golem.de/' + 'print.php?a=' + murxc
|
||||
return murxa
|
||||
|
14
resources/recipes/netzpolitik.recipe
Normal file
14
resources/recipes/netzpolitik.recipe
Normal file
@ -0,0 +1,14 @@
|
||||
from calibre.web.feeds.news import BasicNewsRecipe
|
||||
|
||||
class BasicUserRecipe1257093186(BasicNewsRecipe):
|
||||
title = u'Netzpolitik'
|
||||
oldest_article = 14
|
||||
language = 'de'
|
||||
no_stylesheets = True
|
||||
__author__ = 'Kovid Goyal'
|
||||
max_articles_per_feed = 100
|
||||
remove_tags = [dict(id=['respond', 'ackt', 'nav', 'commentblock',
|
||||
'l_sidebar', 'r_sidebar']), dict(attrs={'class':['widgettitle',
|
||||
'bt-links', 'navigation']})]
|
||||
|
||||
feeds = [(u'Netzpolitik.org', u'http://www.netzpolitik.org/feed/')]
|
53
resources/recipes/nu.recipe
Normal file
53
resources/recipes/nu.recipe
Normal file
@ -0,0 +1,53 @@
|
||||
__license__ = 'GPL v3'
|
||||
__copyright__ = '2009, Rob Hankel <from outerspace.com>'
|
||||
'''
|
||||
nu.nl
|
||||
'''
|
||||
|
||||
from calibre.web.feeds.news import BasicNewsRecipe
|
||||
|
||||
class Nu(BasicNewsRecipe):
|
||||
title = u'Nu.nl'
|
||||
__author__ = u'Rob Hankel'
|
||||
|
||||
publisher = 'nu.nl'
|
||||
description = u'Dutch News'
|
||||
category = 'news'
|
||||
oldest_article = 7
|
||||
max_articles_per_feed = 100
|
||||
no_stylesheets = True
|
||||
use_embedded_content = False
|
||||
encoding = 'utf-8'
|
||||
remove_javascript = True
|
||||
language = 'nl'
|
||||
|
||||
keep_only_tags = [dict(name='div' , attrs={'id':['leadarticle']})]
|
||||
|
||||
feeds = [(u'binnenland', u'http://www.nu.nl/feeds/rss/binnenland.rss'),
|
||||
(u'Algemeen nieuws', u'http://www.nu.nl/deeplink_rss2/index.jsp?r=Algemeen'),
|
||||
(u'Economie', u'http://www.nu.nl/deeplink_rss2/index.jsp?r=Economie'),
|
||||
(u'Internet', u'http://www.nu.nl/deeplink_rss2/index.jsp?r=Internet'),
|
||||
(u'Sport', u'http://www.nu.nl/deeplink_rss2/index.jsp?r=Sport'),
|
||||
(u'Achterklap', u'http://www.nu.nl/deeplink_rss2/index.jsp?r=Achterklap'),
|
||||
(u'Opmerkelijk', u'http://www.nu.nl/deeplink_rss2/index.jsp?r=Opmerkelijk'),
|
||||
(u'Muziek', u'http://www.nu.nl/deeplink_rss2/index.jsp?r=Muziek'),
|
||||
(u'DVD', u'http://www.nu.nl/deeplink_rss2/index.jsp?r=DVD'),
|
||||
(u'Film', u'http://www.nu.nl/deeplink_rss2/index.jsp?r=Film'),
|
||||
(u'Boek', u'http://www.nu.nl/deeplink_rss2/index.jsp?r=Boek'),
|
||||
(u'Games', u'http://www.nu.nl/deeplink_rss2/index.jsp?r=Games'),
|
||||
(u'Columns', u'http://www.nu.nl/deeplink_rss2/index.jsp?r=Columns'),
|
||||
(u'Cartoon', u'http://www.nu.nl/deeplink_rss2/index.jsp?r=Cartoon'),
|
||||
(u'Lifehacking', u'http://www.nu.nl/deeplink_rss2/index.jsp?r=Lifehacking'),
|
||||
(u'Jurryt', u'http://www.nu.nl/deeplink_rss2/index.jsp?r=Jurryt'),
|
||||
(u'Formule 1', u'http://www.nu.nl/deeplink_rss2/index.jsp?r=Formule1'),
|
||||
(u'Plugged', u'http://www.nu.nl/deeplink_rss2/index.jsp?r=Plugged'),
|
||||
(u'Auto', u'http://www.nu.nl/deeplink_rss2/index.jsp?r=Auto'),
|
||||
(u'Wetenschap', u'http://www.nu.nl/deeplink_rss2/index.jsp?r=Wetenschap'),
|
||||
(u'Gezondheid', u'http://www.nu.nl/deeplink_rss2/index.jsp?r=Gezondheid'),
|
||||
(u'Dagelijkse tv-tips', u'http://www.nu.nl/tvgids/rss/tips'),
|
||||
(u'Podcast Algemeen nieuws', u'http://www.nu.nl/podcast.php')]
|
||||
|
||||
|
||||
def get_article_url(self, article):
|
||||
return article.get('guid', None)
|
||||
|
@ -65,19 +65,23 @@ py_libusb_scan(PyObject *self, PyObject *args) {
|
||||
|
||||
PyObject*
|
||||
py_libusb_info(PyObject *self, PyObject *args) {
|
||||
unsigned long idVendor, idProduct, bcdDevice;
|
||||
uint16_t idVendor, idProduct, bcdDevice;
|
||||
ssize_t ret = 0, i = 0; int err = 0, n;
|
||||
libusb_device **list = NULL;
|
||||
libusb_device_handle *handle = NULL;
|
||||
struct libusb_device_descriptor dev;
|
||||
PyObject *ans, *t;
|
||||
PyObject *ans, *t, *t1 = NULL, *t2 = NULL, *t3 = NULL;
|
||||
unsigned char data[1000];
|
||||
|
||||
if (ctxt == NULL) return PyErr_NoMemory();
|
||||
|
||||
if (!PyArg_ParseTuple(args, "LLL", &idVendor, &idProduct, &bcdDevice))
|
||||
if (!PyArg_ParseTuple(args, "OOO", &t1, &t2, &t3))
|
||||
return NULL;
|
||||
|
||||
idVendor = (uint16_t)PyInt_AsSsize_t(t1);
|
||||
idProduct = (uint16_t)PyInt_AsSsize_t(t2);
|
||||
bcdDevice = (uint16_t)PyInt_AsSsize_t(t3);
|
||||
|
||||
ret = libusb_get_device_list(ctxt, &list);
|
||||
if (ret == LIBUSB_ERROR_NO_MEM) return PyErr_NoMemory();
|
||||
|
||||
|
@ -18,8 +18,6 @@ class Font(object):
|
||||
|
||||
class Text(object):
|
||||
|
||||
A = etree.XPath('descendant::a[@href]')
|
||||
|
||||
def __init__(self, text, font_map, opts, log):
|
||||
self.opts, self.log = opts, log
|
||||
self.font_map = font_map
|
||||
|
@ -126,7 +126,7 @@ class UserProfiles(ResizableDialog, Ui_Dialog):
|
||||
if not title or not src:
|
||||
error_dialog(self, _('No recipe selected'), _('No recipe selected')).exec_()
|
||||
return
|
||||
pt = PersistentTemporaryFile(suffix='.py')
|
||||
pt = PersistentTemporaryFile(suffix='.recipe')
|
||||
pt.write(src.encode('utf-8'))
|
||||
pt.close()
|
||||
body = _('The attached file: %s is a recipe to download %s.')%(os.path.basename(pt.name), title)
|
||||
|
Loading…
x
Reference in New Issue
Block a user