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
efa736daa1
@ -3,7 +3,8 @@
|
|||||||
|
|
||||||
__license__ = 'GPL v3'
|
__license__ = 'GPL v3'
|
||||||
__copyright__ = '2010, Constantin Hofstetter <consti at consti.de>, Steffen Siebert <calibre at steffensiebert.de>'
|
__copyright__ = '2010, Constantin Hofstetter <consti at consti.de>, Steffen Siebert <calibre at steffensiebert.de>'
|
||||||
__version__ = '0.98' # 2011-04-10
|
__version__ = '0.98'
|
||||||
|
|
||||||
''' http://brandeins.de - Wirtschaftsmagazin '''
|
''' http://brandeins.de - Wirtschaftsmagazin '''
|
||||||
import re
|
import re
|
||||||
import string
|
import string
|
||||||
@ -13,8 +14,8 @@ from calibre.web.feeds.recipes import BasicNewsRecipe
|
|||||||
class BrandEins(BasicNewsRecipe):
|
class BrandEins(BasicNewsRecipe):
|
||||||
|
|
||||||
title = u'brand eins'
|
title = u'brand eins'
|
||||||
__author__ = 'Constantin Hofstetter; Steffen Siebert'
|
__author__ = 'Constantin Hofstetter'
|
||||||
description = u'Wirtschaftsmagazin: Gets the last full issue on default. Set a integer value for the username-field to get older issues: 1 -> the newest (but not complete) issue, 2 -> the last complete issue (default), 3 -> the issue before 2 etc.'
|
description = u'Wirtschaftsmagazin'
|
||||||
publisher ='brandeins.de'
|
publisher ='brandeins.de'
|
||||||
category = 'politics, business, wirtschaft, Germany'
|
category = 'politics, business, wirtschaft, Germany'
|
||||||
use_embedded_content = False
|
use_embedded_content = False
|
||||||
@ -105,10 +106,11 @@ class BrandEins(BasicNewsRecipe):
|
|||||||
keys = issue_map.keys()
|
keys = issue_map.keys()
|
||||||
keys.sort()
|
keys.sort()
|
||||||
keys.reverse()
|
keys.reverse()
|
||||||
selected_issue = issue_map[keys[issue-1]]
|
selected_issue_key = keys[issue - 1]
|
||||||
|
selected_issue = issue_map[selected_issue_key]
|
||||||
url = selected_issue.get('href', False)
|
url = selected_issue.get('href', False)
|
||||||
# Get the title for the magazin - build it out of the title of the cover - take the issue and year;
|
# Get the title for the magazin - build it out of the title of the cover - take the issue and year;
|
||||||
self.title = "brand eins "+ re.search(r"(?P<date>\d\d\/\d\d\d\d)", selected_issue.find('img').get('title', False)).group('date')
|
self.title = "brand eins " + selected_issue_key[4:] + "/" + selected_issue_key[0:4]
|
||||||
url = 'http://brandeins.de/'+url
|
url = 'http://brandeins.de/'+url
|
||||||
|
|
||||||
# url = "http://www.brandeins.de/archiv/magazin/tierisch.html"
|
# url = "http://www.brandeins.de/archiv/magazin/tierisch.html"
|
||||||
@ -161,3 +163,4 @@ class BrandEins(BasicNewsRecipe):
|
|||||||
current_articles.append({'title': title, 'url': url, 'description': description, 'date':''})
|
current_articles.append({'title': title, 'url': url, 'description': description, 'date':''})
|
||||||
titles_and_articles.append([chapter_title, current_articles])
|
titles_and_articles.append([chapter_title, current_articles])
|
||||||
return titles_and_articles
|
return titles_and_articles
|
||||||
|
|
||||||
|
@ -253,6 +253,8 @@ class MobiReader(object):
|
|||||||
|
|
||||||
.italic { font-style: italic }
|
.italic { font-style: italic }
|
||||||
|
|
||||||
|
.underline { text-decoration: underline }
|
||||||
|
|
||||||
.mbp_pagebreak {
|
.mbp_pagebreak {
|
||||||
page-break-after: always; margin: 0; display: block
|
page-break-after: always; margin: 0; display: block
|
||||||
}
|
}
|
||||||
@ -601,6 +603,9 @@ class MobiReader(object):
|
|||||||
elif tag.tag == 'i':
|
elif tag.tag == 'i':
|
||||||
tag.tag = 'span'
|
tag.tag = 'span'
|
||||||
tag.attrib['class'] = 'italic'
|
tag.attrib['class'] = 'italic'
|
||||||
|
elif tag.tag == 'u':
|
||||||
|
tag.tag = 'span'
|
||||||
|
tag.attrib['class'] = 'underline'
|
||||||
elif tag.tag == 'b':
|
elif tag.tag == 'b':
|
||||||
tag.tag = 'span'
|
tag.tag = 'span'
|
||||||
tag.attrib['class'] = 'bold'
|
tag.attrib['class'] = 'bold'
|
||||||
|
@ -1049,8 +1049,8 @@ class Manifest(object):
|
|||||||
|
|
||||||
# Remove hyperlinks with no content as they cause rendering
|
# Remove hyperlinks with no content as they cause rendering
|
||||||
# artifacts in browser based renderers
|
# artifacts in browser based renderers
|
||||||
# Also remove empty <b> and <i> tags
|
# Also remove empty <b>, <u> and <i> tags
|
||||||
for a in xpath(data, '//h:a[@href]|//h:i|//h:b'):
|
for a in xpath(data, '//h:a[@href]|//h:i|//h:b|//h:u'):
|
||||||
if a.get('id', None) is None and a.get('name', None) is None \
|
if a.get('id', None) is None and a.get('name', None) is None \
|
||||||
and len(a) == 0 and not a.text:
|
and len(a) == 0 and not a.text:
|
||||||
remove_elem(a)
|
remove_elem(a)
|
||||||
|
@ -60,7 +60,7 @@ class ViewAction(InterfaceAction):
|
|||||||
|
|
||||||
def build_menus(self, db):
|
def build_menus(self, db):
|
||||||
self.view_menu.clear()
|
self.view_menu.clear()
|
||||||
self.view_menu.addAction(self.qaction)
|
self.view_menu.addAction(self.view_action)
|
||||||
self.view_menu.addAction(self.view_specific_action)
|
self.view_menu.addAction(self.view_specific_action)
|
||||||
self.view_menu.addSeparator()
|
self.view_menu.addSeparator()
|
||||||
self.view_menu.addAction(self.action_pick_random)
|
self.view_menu.addAction(self.action_pick_random)
|
||||||
|
@ -85,12 +85,13 @@ class UserDefinedDevice(QDialog):
|
|||||||
after['drive_details'][d][1] + '\n'
|
after['drive_details'][d][1] + '\n'
|
||||||
res += _('Windows card A ID string') + ': ' + \
|
res += _('Windows card A ID string') + ': ' + \
|
||||||
after['drive_details'][d][2] + '\n'
|
after['drive_details'][d][2] + '\n'
|
||||||
trailer = _('Copy these values to the clipboard, paste them into an '
|
trailer = _(
|
||||||
'editor, then enter them into the USER_DEVICE by '
|
'Copy these values to the clipboard, paste them into an '
|
||||||
'customizing the device plugin. Be sure to also '
|
'editor, then enter them into the USER_DEVICE by '
|
||||||
'enter the folders where you want the books to '
|
'customizing the device plugin in Preferences->Plugins. '
|
||||||
'be put. You must restart calibre for your changes '
|
'Remember to also enter the folders where you want the books to '
|
||||||
'to take effect.\n')
|
'be put. You must restart calibre for your changes '
|
||||||
|
'to take effect.\n')
|
||||||
self.log.setPlainText(res + '\n\n' + trailer)
|
self.log.setPlainText(res + '\n\n' + trailer)
|
||||||
finally:
|
finally:
|
||||||
self.bbox.setEnabled(True)
|
self.bbox.setEnabled(True)
|
||||||
|
@ -468,7 +468,7 @@ If it still wont launch, start a command prompt (press the windows key and R; th
|
|||||||
|
|
||||||
Post any output you see in a help message on the `Forum <http://www.mobileread.com/forums/forumdisplay.php?f=166>`_.
|
Post any output you see in a help message on the `Forum <http://www.mobileread.com/forums/forumdisplay.php?f=166>`_.
|
||||||
|
|
||||||
|app| freeze when I click on anything?
|
|app| freezes when I click on anything?
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
There are three possible things I know of, that can cause this:
|
There are three possible things I know of, that can cause this:
|
||||||
@ -557,7 +557,7 @@ You have two choices:
|
|||||||
|
|
||||||
How is |app| licensed?
|
How is |app| licensed?
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|app| is licensed under the GNU General Public License v3 (an open source license). This means that you are free to redistribute |app| as long as you make the source code available. So if you want to put |app| on a CD with your product, you must also put the |app| source code on the CD. The source code is available for download `from googlecode <http://code.google.com/p/calibre-ebook/downloads/list>`_. You are free to use the results of conversions from |app| however you want. You cannot use code, libraries from |app| in your software without maing your software open source. For details, see `The GNU GPL v3 <http://www.gnu.org/licenses/gpl.html>`_.
|
|app| is licensed under the GNU General Public License v3 (an open source license). This means that you are free to redistribute |app| as long as you make the source code available. So if you want to put |app| on a CD with your product, you must also put the |app| source code on the CD. The source code is available for download `from googlecode <http://code.google.com/p/calibre-ebook/downloads/list>`_. You are free to use the results of conversions from |app| however you want. You cannot use code, libraries from |app| in your software without making your software open source. For details, see `The GNU GPL v3 <http://www.gnu.org/licenses/gpl.html>`_.
|
||||||
|
|
||||||
How do I run calibre from my USB stick?
|
How do I run calibre from my USB stick?
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
Loading…
x
Reference in New Issue
Block a user