diff --git a/resources/recipes/golem_de.recipe b/resources/recipes/golem_de.recipe new file mode 100644 index 0000000000..d0280a9617 --- /dev/null +++ b/resources/recipes/golem_de.recipe @@ -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 + diff --git a/resources/recipes/netzpolitik.recipe b/resources/recipes/netzpolitik.recipe new file mode 100644 index 0000000000..52d3c57f39 --- /dev/null +++ b/resources/recipes/netzpolitik.recipe @@ -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/')] diff --git a/resources/recipes/nu.recipe b/resources/recipes/nu.recipe new file mode 100644 index 0000000000..782193b55c --- /dev/null +++ b/resources/recipes/nu.recipe @@ -0,0 +1,53 @@ +__license__ = 'GPL v3' +__copyright__ = '2009, Rob Hankel ' +''' +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) + diff --git a/src/calibre/devices/libusb.c b/src/calibre/devices/libusb.c index 3cc506e5fe..c13927d44f 100644 --- a/src/calibre/devices/libusb.c +++ b/src/calibre/devices/libusb.c @@ -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(); diff --git a/src/calibre/ebooks/pdf/reflow.py b/src/calibre/ebooks/pdf/reflow.py index 31002c72fe..8cef0f327d 100644 --- a/src/calibre/ebooks/pdf/reflow.py +++ b/src/calibre/ebooks/pdf/reflow.py @@ -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 diff --git a/src/calibre/gui2/dialogs/user_profiles.py b/src/calibre/gui2/dialogs/user_profiles.py index 86449a34e7..bd332c2aa3 100644 --- a/src/calibre/gui2/dialogs/user_profiles.py +++ b/src/calibre/gui2/dialogs/user_profiles.py @@ -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)