mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix #776
This commit is contained in:
parent
e2e9dd7863
commit
48930e7847
@ -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()
|
||||
|
@ -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
|
||||
|
40
src/calibre/web/feeds/recipes/upi.py
Normal file
40
src/calibre/web/feeds/recipes/upi.py
Normal file
@ -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'<HEAD>.*?</HEAD>' , lambda match : '<HEAD></HEAD>'),
|
||||
(r'<div id="apple-rss-sidebar-background">.*?<!-- start Entries -->', lambda match : ''),
|
||||
(r'<!-- end apple-rss-content-area -->.*?</body>', lambda match : '</body>'),
|
||||
(r'<script.*?>.*?</script>', lambda match : ''),
|
||||
(r'<body onload=.*?>.*?<a href="http://www.upi.com">', lambda match : '<body style="font: 8pt arial;">'),
|
||||
##(r'<div class=\'headerDIV\'><h2><a style="color: #990000;" href="http://www.upi.com/NewsTrack/Top_News/">Top News</a></h2></div>.*?<br clear="all">', lambda match : ''),
|
||||
(r'<script src="http://www.g.*?>.*?</body>', lambda match : ''),
|
||||
(r'<span style="font: 16pt arial', lambda match : '<span style="font: 12pt arial'),
|
||||
]
|
||||
]
|
||||
|
||||
|
||||
|
||||
def get_feeds(self):
|
||||
return [ ('Top Stories', 'http://www.upi.com/rss/NewsTrack/Top_News/'),
|
||||
('Science', 'http://www.upi.com/rss/NewsTrack/Science/'),
|
||||
('Heatlth', 'http://www.upi.com/rss/NewsTrack/Health/'),
|
||||
('Quirks', 'http://www.upi.com/rss/NewsTrack/Quirks/'),
|
||||
]
|
||||
|
||||
def print_version(self, url):
|
||||
return url + 'print/'
|
Loading…
x
Reference in New Issue
Block a user