KG updates

This commit is contained in:
GRiker 2010-11-27 12:21:14 -07:00
commit a60b3d82d5
7 changed files with 40 additions and 15 deletions

View File

@ -4,6 +4,14 @@
# for important features/bug fixes. # for important features/bug fixes.
# Also, each release can have new and improved recipes. # Also, each release can have new and improved recipes.
- version: 0.7.31
date: 2010-11-27
bug fixes:
- title: "Fix various regressions in the calibre windows build caused by the switch to python 2.7. If you are on windows and upgraded to 0.7.30, it is highly recommended that you upgrade to 0.7.31. If you are not on windows, you can ignore 0.7.31"
tickets: [7685, 7694, 7691]
- version: 0.7.30 - version: 0.7.30
date: 2010-11-26 date: 2010-11-26

View File

Before

Width:  |  Height:  |  Size: 1011 B

After

Width:  |  Height:  |  Size: 1011 B

View File

@ -6,8 +6,8 @@ www.getwokingham.co.uk
from calibre.web.feeds.recipes import BasicNewsRecipe from calibre.web.feeds.recipes import BasicNewsRecipe
class TheWorkinghamTimes(BasicNewsRecipe): class TheWokinghamTimes(BasicNewsRecipe):
title = 'The Workingham Times' title = 'The Wokingham Times'
__author__ = 'Darko Miletic' __author__ = 'Darko Miletic'
description = 'News from UK' description = 'News from UK'
oldest_article = 2 oldest_article = 2
@ -19,11 +19,11 @@ class TheWorkinghamTimes(BasicNewsRecipe):
category = 'news, UK, world' category = 'news, UK, world'
language = 'en_GB' language = 'en_GB'
publication_type = 'newsportal' publication_type = 'newsportal'
extra_css = """ extra_css = """
body{ font-family: Arial,sans-serif } body{ font-family: Arial,sans-serif }
img{display: block; margin-bottom: 0.4em} img{display: block; margin-bottom: 0.4em}
""" """
conversion_options = { conversion_options = {
'comments' : description 'comments' : description
,'tags' : category ,'tags' : category
@ -32,10 +32,10 @@ class TheWorkinghamTimes(BasicNewsRecipe):
} }
keep_only_tags = [dict(name='div', attrs={'id':'article-body'})] keep_only_tags = [dict(name='div', attrs={'id':'article-body'})]
remove_tags = [ remove_tags = [
dict(name='div' , attrs={'class':['ad']}) dict(name='div' , attrs={'class':['ad']})
,dict(name=['meta','base','iframe','embed','object']) ,dict(name=['meta','base','iframe','embed','object'])
,dict(name='span' , attrs={'class':'caption small'}) ,dict(name='span' , attrs={'class':'caption small'})
] ]
remove_attributes = ['width','height','lang'] remove_attributes = ['width','height','lang']
@ -55,5 +55,5 @@ class TheWorkinghamTimes(BasicNewsRecipe):
item.replaceWith(str) item.replaceWith(str)
else: else:
item.name = 'span' item.name = 'span'
del item['href'] del item['href']
return soup return soup

View File

@ -108,8 +108,7 @@ class Win32Freeze(Command, WixMixIn):
for f in x[-1]: for f in x[-1]:
if f.lower().endswith('.dll'): if f.lower().endswith('.dll'):
f = self.j(x[0], f) f = self.j(x[0], f)
if 'py2exe' not in f: shutil.copy2(f, self.dll_dir)
shutil.copy2(f, self.dll_dir)
shutil.copy2( shutil.copy2(
r'C:\Python%(v)s\Lib\site-packages\pywin32_system32\pywintypes%(v)s.dll' r'C:\Python%(v)s\Lib\site-packages\pywin32_system32\pywintypes%(v)s.dll'
% dict(v=self.py_ver), self.dll_dir) % dict(v=self.py_ver), self.dll_dir)
@ -118,7 +117,7 @@ class Win32Freeze(Command, WixMixIn):
ans = [] ans = []
for x in items: for x in items:
ext = os.path.splitext(x)[1] ext = os.path.splitext(x)[1]
if (not ext and (x in ('demos', 'tests') or 'py2exe' in x)) or \ if (not ext and (x in ('demos', 'tests'))) or \
(ext in ('.dll', '.chm', '.htm', '.txt')): (ext in ('.dll', '.chm', '.htm', '.txt')):
ans.append(x) ans.append(x)
return ans return ans

View File

@ -21,6 +21,8 @@ This is where all dependencies will be installed.
Add C:\Python27\Scripts and C:\Python27 to PATH Add C:\Python27\Scripts and C:\Python27 to PATH
Edit mimetypes.py in C:\Python27\Lib and change line 250 UnicodeEncodeError to ValueError and set _winreg = None to prevent reading of mimetypes from the windows registry
Install setuptools from http://pypi.python.org/pypi/setuptools Install setuptools from http://pypi.python.org/pypi/setuptools
If there are no windows binaries already compiled for the version of python you are using then download the source and run the following command in the folder where the source has been unpacked:: If there are no windows binaries already compiled for the version of python you are using then download the source and run the following command in the folder where the source has been unpacked::
@ -32,6 +34,8 @@ Run the following command to install python dependencies::
Install BeautifulSoup 3.0.x manually into site-packages (3.1.x parses broken HTML very poorly) Install BeautifulSoup 3.0.x manually into site-packages (3.1.x parses broken HTML very poorly)
Install pywin32 and edit win32com\__init__.py setting _frozen = True and
__gen_path__ to a temp dir (otherwise it tries to set it to a dir in the install tree which leads to permission errors)
SQLite SQLite
--------- ---------
@ -66,7 +70,11 @@ Compiling instructions::
Python Imaging Library Python Imaging Library
------------------------ ------------------------
Install as normal using provided installer. Install as normal using installer at http://www.lfd.uci.edu/~gohlke/pythonlibs/
Test it on the target system with
calibre-debug -c "import _imaging, _imagingmath, _imagingft, _imagingcms"
Libunrar Libunrar
---------- ----------

View File

@ -48,6 +48,13 @@ mimetypes.add_type('application/x-cbz', '.cbz')
mimetypes.add_type('application/x-cbr', '.cbr') mimetypes.add_type('application/x-cbr', '.cbr')
mimetypes.add_type('application/x-koboreader-ebook', '.kobo') mimetypes.add_type('application/x-koboreader-ebook', '.kobo')
mimetypes.add_type('image/wmf', '.wmf') mimetypes.add_type('image/wmf', '.wmf')
mimetypes.add_type('image/jpeg', '.jpg')
mimetypes.add_type('image/jpeg', '.jpeg')
mimetypes.add_type('image/png', '.png')
mimetypes.add_type('image/gif', '.gif')
mimetypes.add_type('image/bmp', '.bmp')
mimetypes.add_type('image/svg+xml', '.svg')
guess_type = mimetypes.guess_type guess_type = mimetypes.guess_type
import cssutils import cssutils
cssutils.log.setLevel(logging.WARN) cssutils.log.setLevel(logging.WARN)
@ -362,6 +369,8 @@ def walk(dir):
def strftime(fmt, t=None): def strftime(fmt, t=None):
''' A version of strftime that returns unicode strings and tries to handle dates ''' A version of strftime that returns unicode strings and tries to handle dates
before 1900 ''' before 1900 '''
if not fmt:
return u''
if t is None: if t is None:
t = time.localtime() t = time.localtime()
if hasattr(t, 'timetuple'): if hasattr(t, 'timetuple'):
@ -378,7 +387,8 @@ def strftime(fmt, t=None):
if isinstance(fmt, unicode): if isinstance(fmt, unicode):
fmt = fmt.encode('mbcs') fmt = fmt.encode('mbcs')
ans = plugins['winutil'][0].strftime(fmt, t) ans = plugins['winutil'][0].strftime(fmt, t)
ans = time.strftime(fmt, t).decode(preferred_encoding, 'replace') else:
ans = time.strftime(fmt, t).decode(preferred_encoding, 'replace')
if early_year: if early_year:
ans = ans.replace('_early year hack##', str(orig_year)) ans = ans.replace('_early year hack##', str(orig_year))
return ans return ans

View File

@ -2,7 +2,7 @@ __license__ = 'GPL v3'
__copyright__ = '2008, Kovid Goyal kovid@kovidgoyal.net' __copyright__ = '2008, Kovid Goyal kovid@kovidgoyal.net'
__docformat__ = 'restructuredtext en' __docformat__ = 'restructuredtext en'
__appname__ = 'calibre' __appname__ = 'calibre'
__version__ = '0.7.30' __version__ = '0.7.31'
__author__ = "Kovid Goyal <kovid@kovidgoyal.net>" __author__ = "Kovid Goyal <kovid@kovidgoyal.net>"
import re import re