mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Merge from trunk
This commit is contained in:
commit
ca056f014b
7257
imgsrc/plugboard.svg
Normal file
7257
imgsrc/plugboard.svg
Normal file
File diff suppressed because it is too large
Load Diff
After Width: | Height: | Size: 209 KiB |
Binary file not shown.
Before Width: | Height: | Size: 31 KiB After Width: | Height: | Size: 3.6 KiB |
34
resources/recipes/dhnet_be.recipe
Normal file
34
resources/recipes/dhnet_be.recipe
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
|
|
||||||
|
__license__ = 'GPL v3'
|
||||||
|
__copyright__ = '2008, Lionel Bergeret <lbergeret at gmail.com>'
|
||||||
|
'''
|
||||||
|
dhnet.be
|
||||||
|
'''
|
||||||
|
|
||||||
|
from calibre.web.feeds.news import BasicNewsRecipe
|
||||||
|
|
||||||
|
class DHNetBe(BasicNewsRecipe):
|
||||||
|
title = u'La Derniere Heure'
|
||||||
|
__author__ = u'Lionel Bergeret'
|
||||||
|
description = u'News from Belgium in French'
|
||||||
|
publisher = u'dhnet.be'
|
||||||
|
category = 'news, Belgium'
|
||||||
|
oldest_article = 3
|
||||||
|
language = 'fr'
|
||||||
|
|
||||||
|
max_articles_per_feed = 20
|
||||||
|
no_stylesheets = True
|
||||||
|
use_embedded_content = False
|
||||||
|
timefmt = ' [%d %b %Y]'
|
||||||
|
|
||||||
|
keep_only_tags = [
|
||||||
|
dict(name = 'div', attrs = {'id': 'articleText'})
|
||||||
|
,dict(name = 'div', attrs = {'id': 'articlePicureAndLinks'})
|
||||||
|
]
|
||||||
|
|
||||||
|
feeds = [
|
||||||
|
(u'La Une' , u'http://www.dhnet.be/rss' )
|
||||||
|
,(u'La Une Sports' , u'http://www.dhnet.be/rss/dhsports/' )
|
||||||
|
,(u'La Une Info' , u'http://www.dhnet.be/rss/dhinfos/' )
|
||||||
|
]
|
43
resources/recipes/lesoir_be.recipe
Normal file
43
resources/recipes/lesoir_be.recipe
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
|
|
||||||
|
__license__ = 'GPL v3'
|
||||||
|
__copyright__ = '2008, Lionel Bergeret <lbergeret at gmail.com>'
|
||||||
|
'''
|
||||||
|
lesoir.be
|
||||||
|
'''
|
||||||
|
|
||||||
|
from calibre.web.feeds.news import BasicNewsRecipe
|
||||||
|
|
||||||
|
class LeSoirBe(BasicNewsRecipe):
|
||||||
|
title = u'Le Soir'
|
||||||
|
__author__ = u'Lionel Bergeret'
|
||||||
|
description = u'News from Belgium in French'
|
||||||
|
publisher = u'lesoir.be'
|
||||||
|
category = 'news, Belgium'
|
||||||
|
oldest_article = 3
|
||||||
|
language = 'fr'
|
||||||
|
|
||||||
|
max_articles_per_feed = 20
|
||||||
|
no_stylesheets = True
|
||||||
|
use_embedded_content = False
|
||||||
|
timefmt = ' [%d %b %Y]'
|
||||||
|
|
||||||
|
keep_only_tags = [
|
||||||
|
dict(name = 'div', attrs = {'id': 'story_head'})
|
||||||
|
,dict(name = 'div', attrs = {'id': 'story_body'})
|
||||||
|
]
|
||||||
|
|
||||||
|
remove_tags = [
|
||||||
|
dict(name='form', attrs={'id':'story_actions'})
|
||||||
|
,dict(name='div', attrs={'id':'sb-share'})
|
||||||
|
,dict(name='div', attrs={'id':'sb-subscribe'})
|
||||||
|
]
|
||||||
|
|
||||||
|
feeds = [
|
||||||
|
(u'Belgique' , u'http://www.lesoir.be/actualite/belgique/rss.xml' )
|
||||||
|
,(u'France' , u'http://www.lesoir.be/actualite/france/rss.xml' )
|
||||||
|
,(u'Monde' , u'http://www.lesoir.be/actualite/monde/rss.xml' )
|
||||||
|
,(u'Regions' , u'http://www.lesoir.be/regions/rss.xml' )
|
||||||
|
,(u'Vie du Net' , u'http://www.lesoir.be/actualite/vie_du_net/rss.xml' )
|
||||||
|
,(u'Petite Gazette' , u'http://www.lesoir.be/actualite/sciences/rss.xml' )
|
||||||
|
]
|
@ -31,7 +31,6 @@ class AdvancedUserRecipe1282101454(BasicNewsRecipe):
|
|||||||
#The following will get read of the Gallery: links when found
|
#The following will get read of the Gallery: links when found
|
||||||
|
|
||||||
def preprocess_html(self, soup) :
|
def preprocess_html(self, soup) :
|
||||||
print 'SOUP IS: ', soup
|
|
||||||
weblinks = soup.findAll(['head','h2'])
|
weblinks = soup.findAll(['head','h2'])
|
||||||
if weblinks is not None:
|
if weblinks is not None:
|
||||||
for link in weblinks:
|
for link in weblinks:
|
||||||
|
@ -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.904'
|
__version__ = '0.7.905'
|
||||||
__author__ = "Kovid Goyal <kovid@kovidgoyal.net>"
|
__author__ = "Kovid Goyal <kovid@kovidgoyal.net>"
|
||||||
|
|
||||||
import re
|
import re
|
||||||
|
@ -47,10 +47,10 @@ class ISBNDBMetadata(Metadata):
|
|||||||
def __init__(self, book):
|
def __init__(self, book):
|
||||||
Metadata.__init__(self, None, [])
|
Metadata.__init__(self, None, [])
|
||||||
|
|
||||||
self.isbn = book.get('isbn13', book.get('isbn'))
|
self.isbn = unicode(book.get('isbn13', book.get('isbn')))
|
||||||
self.title = book.find('titlelong').string
|
self.title = unicode(book.find('titlelong').string)
|
||||||
if not self.title:
|
if not self.title:
|
||||||
self.title = book.find('title').string
|
self.title = unicode(book.find('title').string)
|
||||||
self.title = unicode(self.title).strip()
|
self.title = unicode(self.title).strip()
|
||||||
au = unicode(book.find('authorstext').string).strip()
|
au = unicode(book.find('authorstext').string).strip()
|
||||||
temp = au.split(',')
|
temp = au.split(',')
|
||||||
@ -65,11 +65,11 @@ class ISBNDBMetadata(Metadata):
|
|||||||
self.author_sort = None
|
self.author_sort = None
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
self.publisher = book.find('publishertext').string
|
self.publisher = unicode(book.find('publishertext').string)
|
||||||
|
|
||||||
summ = book.find('summary')
|
summ = book.find('summary')
|
||||||
if summ and hasattr(summ, 'string') and summ.string:
|
if summ and hasattr(summ, 'string') and summ.string:
|
||||||
self.comments = 'SUMMARY:\n'+summ.string
|
self.comments = 'SUMMARY:\n'+unicode(summ.string)
|
||||||
|
|
||||||
|
|
||||||
def build_isbn(base_url, opts):
|
def build_isbn(base_url, opts):
|
||||||
|
@ -84,7 +84,8 @@ class EditMetadataAction(InterfaceAction):
|
|||||||
|
|
||||||
def do_download_metadata(self, ids, covers=True, set_metadata=True,
|
def do_download_metadata(self, ids, covers=True, set_metadata=True,
|
||||||
set_social_metadata=None):
|
set_social_metadata=None):
|
||||||
db = self.gui.library_view.model().db
|
m = self.gui.library_view.model()
|
||||||
|
db = m.db
|
||||||
if set_social_metadata is None:
|
if set_social_metadata is None:
|
||||||
get_social_metadata = config['get_social_metadata']
|
get_social_metadata = config['get_social_metadata']
|
||||||
else:
|
else:
|
||||||
@ -93,6 +94,8 @@ class EditMetadataAction(InterfaceAction):
|
|||||||
self._download_book_metadata = DownloadMetadata(db, ids,
|
self._download_book_metadata = DownloadMetadata(db, ids,
|
||||||
get_covers=covers, set_metadata=set_metadata,
|
get_covers=covers, set_metadata=set_metadata,
|
||||||
get_social_metadata=get_social_metadata)
|
get_social_metadata=get_social_metadata)
|
||||||
|
m.stop_metadata_backup()
|
||||||
|
try:
|
||||||
self._download_book_metadata.start()
|
self._download_book_metadata.start()
|
||||||
if set_social_metadata is not None and set_social_metadata:
|
if set_social_metadata is not None and set_social_metadata:
|
||||||
x = _('social metadata')
|
x = _('social metadata')
|
||||||
@ -105,6 +108,8 @@ class EditMetadataAction(InterfaceAction):
|
|||||||
self._bb_dialog = BlockingBusy(_('Downloading %s for %d book(s)')%(x,
|
self._bb_dialog = BlockingBusy(_('Downloading %s for %d book(s)')%(x,
|
||||||
len(ids)), parent=self.gui)
|
len(ids)), parent=self.gui)
|
||||||
self._bb_dialog.exec_()
|
self._bb_dialog.exec_()
|
||||||
|
finally:
|
||||||
|
m.start_metadata_backup()
|
||||||
|
|
||||||
def book_metadata_download_check(self):
|
def book_metadata_download_check(self):
|
||||||
if self._download_book_metadata.is_alive():
|
if self._download_book_metadata.is_alive():
|
||||||
|
@ -630,10 +630,16 @@ Using this button to create author sort will change author sort from red to gree
|
|||||||
<property name="toolTip">
|
<property name="toolTip">
|
||||||
<string>Remove border (if any) from cover</string>
|
<string>Remove border (if any) from cover</string>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>T&rim</string>
|
||||||
|
</property>
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="../../../../resources/images.qrc">
|
<iconset resource="../../../../resources/images.qrc">
|
||||||
<normaloff>:/images/trim.png</normaloff>:/images/trim.png</iconset>
|
<normaloff>:/images/trim.png</normaloff>:/images/trim.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="toolButtonStyle">
|
||||||
|
<enum>Qt::ToolButtonTextBesideIcon</enum>
|
||||||
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
|
@ -32,7 +32,7 @@
|
|||||||
<string>&Explode ePub</string>
|
<string>&Explode ePub</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset>
|
<iconset resource="../../../../resources/images.qrc">
|
||||||
<normaloff>:/images/wizard.png</normaloff>:/images/wizard.png</iconset>
|
<normaloff>:/images/wizard.png</normaloff>:/images/wizard.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
@ -49,7 +49,7 @@
|
|||||||
<string>&Rebuild ePub</string>
|
<string>&Rebuild ePub</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset>
|
<iconset resource="../../../../resources/images.qrc">
|
||||||
<normaloff>:/images/exec.png</normaloff>:/images/exec.png</iconset>
|
<normaloff>:/images/exec.png</normaloff>:/images/exec.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
@ -63,7 +63,7 @@
|
|||||||
<string>&Cancel</string>
|
<string>&Cancel</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset>
|
<iconset resource="../../../../resources/images.qrc">
|
||||||
<normaloff>:/images/window-close.png</normaloff>:/images/window-close.png</iconset>
|
<normaloff>:/images/window-close.png</normaloff>:/images/window-close.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
@ -71,7 +71,7 @@
|
|||||||
<item row="0" column="0">
|
<item row="0" column="0">
|
||||||
<widget class="QLabel" name="label">
|
<widget class="QLabel" name="label">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Explode the ePub to display contents in a file browser window. To tweak individual files, right-click, then 'Open with...' your editor of choice. When tweaks are complete, close the file browser window. Rebuild the ePub, updating your calibre library.</string>
|
<string><p>Explode the ePub to display contents in a file browser window. To tweak individual files, right-click, then 'Open with...' your editor of choice. When tweaks are complete, close the file browser window <b>and the editor windows you used to edit files in the epub</b>.</p><p>Rebuild the ePub, updating your calibre library.</p></string>
|
||||||
</property>
|
</property>
|
||||||
<property name="wordWrap">
|
<property name="wordWrap">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
|
@ -152,7 +152,7 @@ class SearchBar(QWidget): # {{{
|
|||||||
l.addWidget(x)
|
l.addWidget(x)
|
||||||
x.setToolTip(_("Advanced search"))
|
x.setToolTip(_("Advanced search"))
|
||||||
|
|
||||||
self.label = x = QLabel('&Search:')
|
self.label = x = QLabel(_('&Search:'))
|
||||||
l.addWidget(self.label)
|
l.addWidget(self.label)
|
||||||
x.setSizePolicy(QSizePolicy.Minimum, QSizePolicy.Minimum)
|
x.setSizePolicy(QSizePolicy.Minimum, QSizePolicy.Minimum)
|
||||||
|
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -1147,7 +1147,7 @@ class ZipFile:
|
|||||||
|
|
||||||
self._writecheck(zinfo)
|
self._writecheck(zinfo)
|
||||||
self._didModify = True
|
self._didModify = True
|
||||||
fp = open(filename, "rb")
|
with open(filename, "rb") as fp:
|
||||||
# Must overwrite CRC and sizes with correct data later
|
# Must overwrite CRC and sizes with correct data later
|
||||||
zinfo.CRC = CRC = 0
|
zinfo.CRC = CRC = 0
|
||||||
zinfo.compress_size = compress_size = 0
|
zinfo.compress_size = compress_size = 0
|
||||||
@ -1168,7 +1168,6 @@ class ZipFile:
|
|||||||
buf = cmpr.compress(buf)
|
buf = cmpr.compress(buf)
|
||||||
compress_size = compress_size + len(buf)
|
compress_size = compress_size + len(buf)
|
||||||
self.fp.write(buf)
|
self.fp.write(buf)
|
||||||
fp.close()
|
|
||||||
if cmpr:
|
if cmpr:
|
||||||
buf = cmpr.flush()
|
buf = cmpr.flush()
|
||||||
compress_size = compress_size + len(buf)
|
compress_size = compress_size + len(buf)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user