From 1073c627d63e07b766fbc02f982782664a513908 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 10 May 2011 22:45:59 -0600 Subject: [PATCH 1/9] Fix #780849 (Spelling error in Welcome to calibre) --- src/calibre/gui2/wizard/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/calibre/gui2/wizard/__init__.py b/src/calibre/gui2/wizard/__init__.py index a32347dc72..6b1a793fc8 100644 --- a/src/calibre/gui2/wizard/__init__.py +++ b/src/calibre/gui2/wizard/__init__.py @@ -435,7 +435,7 @@ class DevicePage(QWizardPage, DeviceUI): self.registerField("device", self.device_view) def initializePage(self): - self.label.setText(_('Choose you e-book device. If your device is' + self.label.setText(_('Choose your e-book device. If your device is' ' not in the list, choose a "%s" device.')%Device.manufacturer) self.man_model = ManufacturerModel() self.manufacturer_view.setModel(self.man_model) From 31e2bc3818b888503b14c025230c7468e3dcad78 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 11 May 2011 09:53:28 -0600 Subject: [PATCH 2/9] Fix #781135 (ParseException when pressing "Next" or "Previous" in plugin search) --- src/calibre/gui2/preferences/plugins.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/calibre/gui2/preferences/plugins.py b/src/calibre/gui2/preferences/plugins.py index 8888a64e84..4f88e5aa1d 100644 --- a/src/calibre/gui2/preferences/plugins.py +++ b/src/calibre/gui2/preferences/plugins.py @@ -75,6 +75,8 @@ class PluginModel(QAbstractItemModel, SearchQueryParser): # {{{ def find(self, query): query = query.strip() + if not query: + return QModelIndex() matches = self.parse(query) if not matches: return QModelIndex() @@ -87,6 +89,8 @@ class PluginModel(QAbstractItemModel, SearchQueryParser): # {{{ def find_next(self, idx, query, backwards=False): query = query.strip() + if not query: + return idx matches = self.parse(query) if not matches: return idx From 231df586c08b8d155a7996f6b000db65f7b438c3 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 11 May 2011 14:56:10 -0600 Subject: [PATCH 3/9] ODT Input: Handle inline special styles defined on tags. Fixes #780250 (Italic text not converting from ODT source) --- src/odf/odf2xhtml.py | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/src/odf/odf2xhtml.py b/src/odf/odf2xhtml.py index a04aa48bf7..0ae89b1663 100644 --- a/src/odf/odf2xhtml.py +++ b/src/odf/odf2xhtml.py @@ -1415,18 +1415,34 @@ ol, ul { padding-left: 2em; } self.writedata() c = attrs.get( (TEXTNS,'style-name'), None) htmlattrs = {} + # Changed by Kovid to handle inline apecial styles defined on tags. + # Apparently LibreOffice does this. + special = 'span' if c: c = c.replace(".","_") special = special_styles.get("S-"+c) - if special is None and self.generate_css: - htmlattrs['class'] = "S-%s" % c - self.opentag('span', htmlattrs) + if special is None: + special = 'span' + if self.generate_css: + htmlattrs['class'] = "S-%s" % c + + self.opentag(special, htmlattrs) self.purgedata() def e_text_span(self, tag, attrs): """ End the """ self.writedata() - self.closetag('span', False) + c = attrs.get( (TEXTNS,'style-name'), None) + # Changed by Kovid to handle inline apecial styles defined on tags. + # Apparently LibreOffice does this. + special = 'span' + if c: + c = c.replace(".","_") + special = special_styles.get("S-"+c) + if special is None: + special = 'span' + + self.closetag(special, False) self.purgedata() def s_text_tab(self, tag, attrs): From fa0c8702b0d6d51ae7d96f1c14e43c27beb9f7c7 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 11 May 2011 16:33:23 -0600 Subject: [PATCH 4/9] ... --- recipes/divahair.recipe | 53 ++++++++++++++++++++++++++++++++++ recipes/icons/divahair.png | Bin 0 -> 675 bytes recipes/icons/mayra.png | Bin 0 -> 620 bytes recipes/icons/moldovaazi.png | Bin 0 -> 243 bytes recipes/icons/newsmoldova.png | Bin 0 -> 837 bytes recipes/mayra.recipe | 51 ++++++++++++++++++++++++++++++++ recipes/moldovaazi.recipe | 50 ++++++++++++++++++++++++++++++++ recipes/newsmoldova.recipe | 50 ++++++++++++++++++++++++++++++++ 8 files changed, 204 insertions(+) create mode 100644 recipes/divahair.recipe create mode 100644 recipes/icons/divahair.png create mode 100644 recipes/icons/mayra.png create mode 100644 recipes/icons/moldovaazi.png create mode 100644 recipes/icons/newsmoldova.png create mode 100644 recipes/mayra.recipe create mode 100644 recipes/moldovaazi.recipe create mode 100644 recipes/newsmoldova.recipe diff --git a/recipes/divahair.recipe b/recipes/divahair.recipe new file mode 100644 index 0000000000..978ac19808 --- /dev/null +++ b/recipes/divahair.recipe @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +#!/usr/bin/env python + +__license__ = 'GPL v3' +__copyright__ = u'2011, Silviu Cotoar\u0103' +''' +divahair.ro +''' + +from calibre.web.feeds.news import BasicNewsRecipe + +class DivaHair(BasicNewsRecipe): + title = u'Diva Hair' + language = 'ro' + __author__ = u'Silviu Cotoar\u0103' + description = u'Coafuri, frizuri, tunsori ..' + publisher = u'Diva Hair' + category = u'Ziare,Stiri,Coafuri,Femei' + oldest_article = 5 + max_articles_per_feed = 100 + no_stylesheets = True + use_embedded_content = False + encoding = 'utf-8' + remove_javascript = True + cover_url = 'http://www.divahair.ro/imgs/logo.jpg' + + conversion_options = { + 'comments' : description + ,'tags' : category + ,'language' : language + ,'publisher' : publisher + } + + keep_only_tags = [ + dict(name='td', attrs={'class':'spatiuart'}) + , dict(name='div', attrs={'class':'spatiuart'}) + ] + + + remove_tags = [ + dict(name='div', attrs={'class':'categorie'}) + , dict(name='div', attrs={'class':'gri gri2 detaliiart'}) + , dict(name='div', attrs={'class':'articol_box_bottom'}) + ] + + remove_tags_after = [ + dict(name='div', attrs={'class':'articol_box_bottom'}) + ] + + feeds = [ (u'\u0218tiri', u'http://www.divahair.ro/feed') ] + + def preprocess_html(self, soup): + return self.adeify_images(soup) diff --git a/recipes/icons/divahair.png b/recipes/icons/divahair.png new file mode 100644 index 0000000000000000000000000000000000000000..4cb2964687b0acf7fc5d93332ca5963bb1d96a63 GIT binary patch literal 675 zcmV;U0$lxxP)jf%BN7SpBJEufALZZ58cfd7ZMb2yJMDZK6 zM5*`@t`{VWwuMAuqDiB<_wCS=ru5g%!$ZHyVdT;~+ zXl^&cZbt~gLy@wn3HviY&dyF;!5|I6Aa=hWt-1M87(m**J{%n#I9~;E1w+`|+R$2B z5Kh;lFo1Lf0yw+7afL$I12528Tak^82>Cb+Af4SWafL!S+S{?YpCX?$A*B2-7(lv$ zA-?_m#mCuMrjto(C={@`xQJmG7={5rxm;#xX$hqiySuyW?Ckv8psR~7$s}*1QLd_0 z#>dA2n3|d*m&-9fKaWz1csx$ES_NQiY>aq3{#Ri4`LJv@qW%4hj*g=1I{ADauh&aB z97fl5EXyL5N-;P%$nx?s(P)%Hp@32fSp+iHQjY1_rn)7O5N`BQx17kw^r9xw$#|`uaFLJgm=z5X{WXFfuYiI-N$7lCRU# zoSmHT)fGxxTU4`IsMYEn+e4tby`_43N@;VG;_3?Jg9EHm=}z~KKv@>GT#oB>n&RpT zSKHg%oS&mi^WNX63zSk=l?uOgozmJG#q~8Rx{j(;>esk0e*pJl2G9Ddg zkKy*DcOS*DZoy&@d|KO>tUb-!fe4*7xRmEB>!Q?lw*0vS5Osp0EVNOb;cSQV}sH!*s zwp1o^G}FA&9%YOnc69{TOH+N61Hk#cgNb(RDQ=lKhOTQP)E~b@t;JE*=H%BlQL+DJ z5*a>>E^i_~SBMY_C`i75f2fB~Q!|8Ni0ADi8tvpqex4IU$C;V_!az1dskFxM>66eI z!7i0?Xrche5C#ph*?!XL6xC{tLZL_~!rM3RNvBg(DjO76iXaxOLc|ckbwDgm-+q$O z4&uo;$y5SVSzIhIIGAO9y-fc=hFYygDwV`8t)qn0@4cNFfj(aLY z?BW?+fa>a+8<_IPn1; oXT0iAyAf3;VL#XQd-Z>|sWM#kdXX$=fEF@%y85}Sb4q9e0J&XVnE(I) literal 0 HcmV?d00001 diff --git a/recipes/icons/newsmoldova.png b/recipes/icons/newsmoldova.png new file mode 100644 index 0000000000000000000000000000000000000000..a4faaa46357560501f42c45788b34e86896ff51e GIT binary patch literal 837 zcmV-L1G@Z)P)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!~g&e!~vBn4jTXf0@_JLK~y+Tm66#` zQ$ZBQ@8998&n9Z3PyPoc#>A)*g#=A7CPp6=7YY~!0!ly-1VSmB>_MSn4TYAarIc1$ z*3#bY_jWI|R4k>He$EVmg!tr5CU?#^=lsrhW;p!E_vB*_#x(0^D!A@R9S#mt7+>6g z(;I=LNzUS-Sre?DAo>*syr><-^s*V9<4ZV5rda%?U&(T~%Qg%AoFhjFj41=sQ_ z@pW((&#L-ak)%^oB)0$lE^FXVvf!L zXySu+tqgFdK#Ki?V+YjYsCpeE3v0}QZqtc#*I(nt%Z7gey~Gx~gCZF&W|y*rtYR51 zWR+mc>0Fki$N4cria5}c)ebh zM>VU}icly7PNht_((*TQJi`!Qe&fe$CZ6;3!&yC4!V0GZAYg=H6YYLNlj zmi_2m38IFa?~;!78ZTOjCL^n6UWCHB3$A)zU|lFgz8;1_h@(R3IR#9ZcTl2mu`yb7 zK1i2*XeZ4YwLWx^KSzVAS%KNARC&;0piX>P^2E`!=*8zbfpw*Ez1quM(J^v*%qX5D zm)K1#PV-Up7=vga1#~28Eq~OGS7g Date: Wed, 11 May 2011 16:34:59 -0600 Subject: [PATCH 5/9] Fix #780728 (RTF to mobi conversion fails) --- src/calibre/ebooks/rtf/input.py | 2 +- src/calibre/ebooks/rtf2xml/process_tokens.py | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/calibre/ebooks/rtf/input.py b/src/calibre/ebooks/rtf/input.py index 23c16f473d..f08aa76605 100644 --- a/src/calibre/ebooks/rtf/input.py +++ b/src/calibre/ebooks/rtf/input.py @@ -86,7 +86,7 @@ class RTFInput(InputFormatPlugin): run_lev = 4 self.log('Running RTFParser in debug mode') except: - pass + self.log.warn('Impossible to run RTFParser in debug mode') parser = ParseRtf( in_file = stream, out_file = ofile, diff --git a/src/calibre/ebooks/rtf2xml/process_tokens.py b/src/calibre/ebooks/rtf2xml/process_tokens.py index 65162d0d37..11aab48588 100755 --- a/src/calibre/ebooks/rtf2xml/process_tokens.py +++ b/src/calibre/ebooks/rtf2xml/process_tokens.py @@ -197,8 +197,8 @@ class ProcessTokens: # character info => ci 'b' : ('ci', 'bold______', self.bool_st_func), 'blue' : ('ci', 'blue______', self.color_func), - 'caps' : ('ci', 'caps______', self.bool_st_func), - 'cf' : ('ci', 'font-color', self.default_func), + 'caps' : ('ci', 'caps______', self.bool_st_func), + 'cf' : ('ci', 'font-color', self.colorz_func), 'chftn' : ('ci', 'footnot-mk', self.bool_st_func), 'dn' : ('ci', 'font-down_', self.divide_by_2), 'embo' : ('ci', 'emboss____', self.bool_st_func), @@ -624,6 +624,11 @@ class ProcessTokens: num = 'true' return 'cw<%s<%s Date: Wed, 11 May 2011 17:24:20 -0600 Subject: [PATCH 6/9] Fix #780804 (not found gdbm on Windows in 0.8.0 and Japanese) --- setup/resources.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup/resources.py b/setup/resources.py index 84ff136371..1501e28017 100644 --- a/setup/resources.py +++ b/setup/resources.py @@ -9,7 +9,7 @@ __docformat__ = 'restructuredtext en' import os, cPickle, re, anydbm, shutil, marshal, zipfile, glob from zlib import compress -from setup import Command, basenames, __appname__ +from setup import Command, basenames, __appname__, iswindows def get_opts_from_parser(parser): def do_opt(opt): @@ -128,7 +128,7 @@ class Resources(Command): if not os.path.exists(base): os.makedirs(base) - if self.newer(dest, src): + if self.newer(dest, src) or iswindows: self.info('\tGenerating Kanwadict') for line in open(src, "r"): From 1a38be575d68278caff8647446255f92e3eabf79 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 11 May 2011 17:35:27 -0600 Subject: [PATCH 7/9] ... --- setup/resources.py | 4 ++-- src/odf/odf2xhtml.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/setup/resources.py b/setup/resources.py index 1501e28017..afa8829988 100644 --- a/setup/resources.py +++ b/setup/resources.py @@ -139,7 +139,7 @@ class Resources(Command): dest = self.j(self.RESOURCES, 'localization', 'pykakasi','itaijidict2.pickle') - if self.newer(dest, src): + if self.newer(dest, src) or iswindows: self.info('\tGenerating Itaijidict') self.mkitaiji(src, dest) @@ -147,7 +147,7 @@ class Resources(Command): dest = self.j(self.RESOURCES, 'localization', 'pykakasi','kanadict2.pickle') - if self.newer(dest, src): + if self.newer(dest, src) or iswindows: self.info('\tGenerating kanadict') self.mkkanadict(src, dest) diff --git a/src/odf/odf2xhtml.py b/src/odf/odf2xhtml.py index 0ae89b1663..b1dbebb775 100644 --- a/src/odf/odf2xhtml.py +++ b/src/odf/odf2xhtml.py @@ -1415,7 +1415,7 @@ ol, ul { padding-left: 2em; } self.writedata() c = attrs.get( (TEXTNS,'style-name'), None) htmlattrs = {} - # Changed by Kovid to handle inline apecial styles defined on tags. + # Changed by Kovid to handle inline special styles defined on tags. # Apparently LibreOffice does this. special = 'span' if c: @@ -1433,7 +1433,7 @@ ol, ul { padding-left: 2em; } """ End the """ self.writedata() c = attrs.get( (TEXTNS,'style-name'), None) - # Changed by Kovid to handle inline apecial styles defined on tags. + # Changed by Kovid to handle inline special styles defined on tags. # Apparently LibreOffice does this. special = 'span' if c: From 48166bd87764c26ccb6401482048679d558a3d93 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 11 May 2011 18:08:00 -0600 Subject: [PATCH 8/9] Ensure kakasi databases are always rebuilt on windows --- setup/commands.py | 5 +- setup/installer/windows/__init__.py | 1 + setup/installer/windows/wix-template.xml | 3 - setup/resources.py | 209 ++++++++++++----------- 4 files changed, 114 insertions(+), 104 deletions(-) diff --git a/setup/commands.py b/setup/commands.py index 7e22ff14f3..febc684c08 100644 --- a/setup/commands.py +++ b/setup/commands.py @@ -11,7 +11,7 @@ __all__ = [ 'build', 'build_pdf2xml', 'server', 'gui', 'develop', 'install', - 'resources', + 'kakasi', 'resources', 'check', 'sdist', 'manual', 'tag_release', @@ -49,8 +49,9 @@ gui = GUI() from setup.check import Check check = Check() -from setup.resources import Resources +from setup.resources import Resources, Kakasi resources = Resources() +kakasi = Kakasi() from setup.publish import Manual, TagRelease, Stage1, Stage2, \ Stage3, Stage4, Publish diff --git a/setup/installer/windows/__init__.py b/setup/installer/windows/__init__.py index b51eccc832..59042ac56c 100644 --- a/setup/installer/windows/__init__.py +++ b/setup/installer/windows/__init__.py @@ -32,6 +32,7 @@ class Win32(VMInstaller): FREEZE_TEMPLATE = 'python -OO setup.py {freeze_command} --no-ice' INSTALLER_EXT = 'msi' SHUTDOWN_CMD = ['shutdown.exe', '-s', '-f', '-t', '0'] + BUILD_BUILD = ['python setup.py kakasi',] + VMInstaller.BUILD_BUILD def download_installer(self): installer = self.installer() diff --git a/setup/installer/windows/wix-template.xml b/setup/installer/windows/wix-template.xml index b5d2f4b292..5de08e155f 100644 --- a/setup/installer/windows/wix-template.xml +++ b/setup/installer/windows/wix-template.xml @@ -11,9 +11,6 @@ SummaryCodepage='1252' /> - - Date: Wed, 11 May 2011 18:20:44 -0600 Subject: [PATCH 9/9] Use Qt 4.7.3 for windows build --- setup/installer/windows/freeze.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup/installer/windows/freeze.py b/setup/installer/windows/freeze.py index f666427598..7fb60968e7 100644 --- a/setup/installer/windows/freeze.py +++ b/setup/installer/windows/freeze.py @@ -14,7 +14,7 @@ from setup.build_environment import msvc, MT, RC from setup.installer.windows.wix import WixMixIn OPENSSL_DIR = r'Q:\openssl' -QT_DIR = 'Q:\\Qt\\4.7.2' +QT_DIR = 'Q:\\Qt\\4.7.3' QT_DLLS = ['Core', 'Gui', 'Network', 'Svg', 'WebKit', 'Xml', 'XmlPatterns'] LIBUSB_DIR = 'C:\\libusb' LIBUNRAR = 'C:\\Program Files\\UnrarDLL\\unrar.dll'