From 48930e78472d2ef03e54f8cba7d4d10d645ebe65 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 12 Jun 2008 13:46:51 -0700 Subject: [PATCH] Fix #776 --- .../gui2/pictureflow/PyQt/configure.py | 11 +++-- src/calibre/web/feeds/recipes/__init__.py | 2 +- src/calibre/web/feeds/recipes/upi.py | 40 +++++++++++++++++++ upload.py | 1 - 4 files changed, 48 insertions(+), 6 deletions(-) create mode 100644 src/calibre/web/feeds/recipes/upi.py diff --git a/src/calibre/gui2/pictureflow/PyQt/configure.py b/src/calibre/gui2/pictureflow/PyQt/configure.py index 56b3112a7e..04c7c8fe91 100644 --- a/src/calibre/gui2/pictureflow/PyQt/configure.py +++ b/src/calibre/gui2/pictureflow/PyQt/configure.py @@ -1,4 +1,4 @@ -import os, sys +import os, sys, glob import sipconfig if os.environ.get('PYQT4PATH', None): print os.environ['PYQT4PATH'] @@ -35,12 +35,15 @@ makefile = pyqtconfig.QtGuiModuleMakefile ( # Add the library we are wrapping. The name doesn't include any platform # specific prefixes or extensions (e.g. the "lib" prefix on UNIX, or the # ".dll" extension on Windows). -makefile.extra_lib_dirs = ['..\\..\\.build\\release', '../../.build'] +if 'linux' in sys.platform: + for f in glob.glob('../../.build/libpictureflow.a'): + os.link(f, './'+os.path.basename(f)) + makefile.extra_lib_dirs = ['.'] +else: + makefile.extra_lib_dirs = ['..\\..\\.build\\release', '../../.build', '.'] makefile.extra_libs = ['pictureflow0' if 'win' in sys.platform and 'darwin' not in sys.platform else "pictureflow"] makefile.extra_cflags = ['-arch i386', '-arch ppc'] if 'darwin' in sys.platform else [] makefile.extra_cxxflags = makefile.extra_cflags -if 'linux' in sys.platform: - makefile.extra_lflags = ['-Wl,--rpath=.'] # Generate the Makefile itself. makefile.generate() diff --git a/src/calibre/web/feeds/recipes/__init__.py b/src/calibre/web/feeds/recipes/__init__.py index 6939c0a8ce..a531f990cd 100644 --- a/src/calibre/web/feeds/recipes/__init__.py +++ b/src/calibre/web/feeds/recipes/__init__.py @@ -8,7 +8,7 @@ recipes = [ 'newsweek', 'atlantic', 'economist', 'portfolio', 'nytimes', 'usatoday', 'outlook_india', 'bbc', 'greader', 'wsj', 'wired', 'globe_and_mail', 'smh', 'espn', 'business_week', - 'ars_technica', + 'ars_technica', 'upi', ] import re, imp, inspect, time diff --git a/src/calibre/web/feeds/recipes/upi.py b/src/calibre/web/feeds/recipes/upi.py new file mode 100644 index 0000000000..d29c34f769 --- /dev/null +++ b/src/calibre/web/feeds/recipes/upi.py @@ -0,0 +1,40 @@ +#!/usr/bin/env python +__license__ = 'GPL v3' +__copyright__ = '2008, Kovid Goyal kovid@kovidgoyal.net' +__docformat__ = 'restructuredtext en' + +import re +from calibre.web.feeds.news import BasicNewsRecipe + + +class UnitedPressInternational(BasicNewsRecipe): + + title = 'United Press International' + max_articles_per_feed = 15 + html2lrf_options = ['--override-css= "H1 {font-family: Arial; font-weight: bold; color: #000000; size: 10pt;}"'] + + + preprocess_regexps = [ (re.compile(i[0], re.IGNORECASE | re.DOTALL), i[1]) for i in + [ + (r'.*?' , lambda match : ''), + (r'
.*?', lambda match : ''), + (r'.*?', lambda match : ''), + (r'.*?', lambda match : ''), + (r'.*?', lambda match : ''), + ##(r'.*?
', lambda match : ''), + (r'