unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Brendan Tildesley <brendan.tildesley@openmailbox.org>
To: 26924@debbugs.gnu.org
Subject: bug#26924: [PATCH 04/12] gnu: calibre: Import unbundle feedparser patch from
Date: Mon, 15 May 2017 01:05:49 +1000	[thread overview]
Message-ID: <95321ed9-d235-f4a4-8fc9-4dbba7bf9993@openmailbox.org> (raw)
In-Reply-To: <a474bf3a-2be1-5d4a-28d8-0ef3267e29ce@openmailbox.org>

[-- Attachment #1: Type: text/plain, Size: 1 bytes --]



[-- Attachment #2: 0004-gnu-calibre-Import-unbundle-feedparser-patch-from-de.patch --]
[-- Type: text/x-patch, Size: 4288 bytes --]

From ddfccc3e2d3f97342c0f25e00ac00f07ba7a9475 Mon Sep 17 00:00:00 2001
From: Brendan Tildesley <brendan.tildesley@openmailbox.org>
Date: Sat, 13 May 2017 22:32:01 +1000
Subject: [PATCH 04/12] gnu: calibre: Import unbundle feedparser patch from
 debian

* gnu/packages/ebook.scm
Use web module for python2-feedparser.
(calibre):
[source]: Reference new patch file.
[inputs]: Add python2-feedparser as an input.
* gnu/packages/patches/calibre-use-packaged-feedparser.patch: New file.
---
 gnu/packages/ebook.scm                             |  3 ++
 .../patches/calibre-use-packaged-feedparser.patch  | 51 ++++++++++++++++++++++
 2 files changed, 54 insertions(+)
 create mode 100644 gnu/packages/patches/calibre-use-packaged-feedparser.patch

diff --git a/gnu/packages/ebook.scm b/gnu/packages/ebook.scm
index cc43259e2..70ec9ed35 100644
--- a/gnu/packages/ebook.scm
+++ b/gnu/packages/ebook.scm
@@ -39,6 +39,7 @@
   #:use-module (gnu packages python)
   #:use-module (gnu packages qt)
   #:use-module (gnu packages tls)
+  #:use-module (gnu packages web)
   #:use-module (gnu packages xorg))
 
 (define-public chmlib
@@ -80,6 +81,7 @@
             (delete-file-recursively "src/unrar")
             (delete-file "src/odf/thumbnail.py")))
         (patches (search-patches "calibre-drop-unrar.patch"
+                                 "calibre-use-packaged-feedparser.patch"
                                  "calibre-dont-load-remote-icons.patch"
                                  "calibre-no-updates-dialog.patch"))))
     (build-system python-build-system)
@@ -116,6 +118,7 @@
        ("python2-cssutils" ,python2-cssutils)
        ("python2-dateutil" ,python2-dateutil)
        ("python2-dbus" ,python2-dbus)
+       ("python2-feedparser" ,python2-feedparser)
        ("python2-lxml" ,python2-lxml)
        ("python2-mechanize" ,python2-mechanize)
        ("python2-netifaces" ,python2-netifaces)
diff --git a/gnu/packages/patches/calibre-use-packaged-feedparser.patch b/gnu/packages/patches/calibre-use-packaged-feedparser.patch
new file mode 100644
index 000000000..8f4bbc824
--- /dev/null
+++ b/gnu/packages/patches/calibre-use-packaged-feedparser.patch
@@ -0,0 +1,51 @@
+From: Martin Pitt <mpitt@debian.org>
+Date: Mon, 14 Nov 2016 22:41:23 +0100
+Subject: Use packaged instead of bundled feedparser Python module
+
+---
+ recipes/lenta_ru.recipe           | 4 +++-
+ src/calibre/web/feeds/__init__.py | 4 +++-
+ 2 files changed, 6 insertions(+), 2 deletions(-)
+
+diff --git a/recipes/lenta_ru.recipe b/recipes/lenta_ru.recipe
+index aa4dac4..4b6710c 100644
+--- a/recipes/lenta_ru.recipe
++++ b/recipes/lenta_ru.recipe
+@@ -4,11 +4,13 @@
+ Lenta.ru
+ '''
+ 
+-from calibre.web.feeds.feedparser import parse
+ from calibre.ebooks.BeautifulSoup import Tag
+ from calibre.web.feeds.news import BasicNewsRecipe
++from feedparser import parse
++from functools import partial
+ import re
+ 
++parse = partial(parse, agent='Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.2.11) Gecko/20101012 Firefox/3.6.11')
+ 
+ class LentaRURecipe(BasicNewsRecipe):
+     title = u'Lenta.ru: \u041d\u043e\u0432\u043e\u0441\u0442\u0438'
+diff --git a/src/calibre/web/feeds/__init__.py b/src/calibre/web/feeds/__init__.py
+index 8c9d748..f262604 100644
+--- a/src/calibre/web/feeds/__init__.py
++++ b/src/calibre/web/feeds/__init__.py
+@@ -11,7 +11,10 @@ from calibre.utils.logging import default_log
+ from calibre import entity_to_unicode, strftime, force_unicode
+ from calibre.utils.date import dt_factory, utcnow, local_tz
+ from calibre.utils.cleantext import clean_ascii_chars, clean_xml_chars
++from feedparser import parse
++from functools import partial
+ 
++parse = partial(parse, agent='Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.2.11) Gecko/20101012 Firefox/3.6.11')
+ 
+ class Article(object):
+ 
+@@ -334,7 +337,6 @@ def feed_from_xml(raw_xml, title=None, oldest_article=7,
+                   max_articles_per_feed=100,
+                   get_article_url=lambda item: item.get('link', None),
+                   log=default_log):
+-    from calibre.web.feeds.feedparser import parse
+     # Handle unclosed escaped entities. They trip up feedparser and HBR for one
+     # generates them
+     raw_xml = re.sub(r'(&amp;#\d+)([^0-9;])', r'\1;\2', raw_xml)
-- 
2.12.2


  parent reply	other threads:[~2017-05-14 15:06 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-14 15:00 bug#26924: [PATCH 0/12] Update Calibre to 2.85.1 Brendan Tildesley
2017-05-14 15:02 ` bug#26924: [PATCH 01/12] " Brendan Tildesley
2017-05-15 16:34   ` Marius Bakke
2017-05-14 15:03 ` bug#26924: [PATCH 02/12] " Brendan Tildesley
2017-05-14 15:16   ` Brendan Tildesley
2017-05-15 16:36   ` Marius Bakke
2017-05-14 15:05 ` bug#26924: [PATCH 03/12] gnu: calibre: Import dont-load-icons patch from debian Brendan Tildesley
2017-05-15 16:38   ` Marius Bakke
2017-05-14 15:05 ` Brendan Tildesley [this message]
2017-05-15 16:51   ` bug#26924: [PATCH 04/12] gnu: calibre: Import unbundle feedparser patch from Marius Bakke
2017-05-14 15:06 ` bug#26924: [PATCH 05/12] gnu: calibre: Unbundle python2-markdown Brendan Tildesley
2017-05-15 16:56   ` Marius Bakke
2017-05-14 15:07 ` bug#26924: [PATCH 06/12] gnu: calibre: Undelete GPLv2 icon file Brendan Tildesley
2017-05-15 17:00   ` Marius Bakke
2017-05-16  1:02     ` Brendan Tildesley
2017-05-19 21:07       ` Marius Bakke
2017-05-14 15:08 ` bug#26924: [PATCH 07/12] gnu: calibre: Unbundle liberation fonts Brendan Tildesley
2017-05-15 17:05   ` Marius Bakke
2017-05-14 15:09 ` bug#26924: [PATCH 08/12] gnu: calibre: Unbundle chardet Brendan Tildesley
2017-05-15 17:06   ` Marius Bakke
2017-05-14 15:09 ` bug#26924: [PATCH 09/12] gnu: calibre: Add missing dependencies Brendan Tildesley
2017-05-15 17:09   ` Marius Bakke
2017-05-14 15:10 ` bug#26924: [PATCH 10/12] gnu: chmlib: Use #:prefix license: Brendan Tildesley
2017-05-15 17:27   ` Marius Bakke
2017-05-14 15:11 ` bug#26924: [PATCH 11/12] gnu: calibre: Add exhaustive license list Brendan Tildesley
2017-05-15 17:23   ` Marius Bakke
2017-05-14 15:14 ` bug#26924: [PATCH 12/12] gnu: calibre: Don't create uninstaller Brendan Tildesley
2017-05-15 17:24   ` Marius Bakke
2017-05-15 16:32 ` bug#26924: [PATCH 0/12] Update Calibre to 2.85.1 Marius Bakke
2017-05-16  4:48 ` bug#26924: [PATCH 1/12] Update Calibre to 2.85.1 [REVISED] Brendan Tildesley
2017-05-16  4:50 ` bug#26924: [PATCH 02/10] gnu: calibre: Import dont-load-icons patch from debian Brendan Tildesley
2017-05-16  4:51 ` bug#26924: [PATCH 03/10] gnu: calibre: Import unbundle feedparser patch from Brendan Tildesley
2017-05-16  4:52 ` bug#26924: [PATCH 04/10] gnu: calibre: Unbundle python2-markdown Brendan Tildesley
2017-05-16  4:53 ` bug#26924: [PATCH 05/10] gnu: calibre: Undelete GPLv2 icon file Brendan Tildesley
2017-05-16  4:54 ` bug#26924: [PATCH 06/10] gnu: calibre: Unbundle liberation fonts Brendan Tildesley
2017-05-16  4:55 ` bug#26924: [PATCH 07/10] gnu: calibre: Unbundle chardet Brendan Tildesley
2017-05-16  4:56 ` bug#26924: [PATCH 08/10] gnu: calibre: Add missing dependencies Brendan Tildesley
2017-05-16  4:58 ` bug#26924: [PATCH 09/10] gnu: calibre: Add exhaustive license list Brendan Tildesley
2017-05-19 21:58   ` Marius Bakke
2017-05-16  4:59 ` bug#26924: [PATCH 10/10] gnu: calibre: Don't create uninstaller Brendan Tildesley
2017-05-19 21:21   ` Marius Bakke

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=95321ed9-d235-f4a4-8fc9-4dbba7bf9993@openmailbox.org \
    --to=brendan.tildesley@openmailbox.org \
    --cc=26924@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).