mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Sync to trunk.
This commit is contained in:
commit
b1aca05630
@ -1,4 +1,3 @@
|
|||||||
#!/usr/bin/env python
|
|
||||||
|
|
||||||
__license__ = 'GPL v3'
|
__license__ = 'GPL v3'
|
||||||
__copyright__ = '2009, Darko Miletic <darko.miletic at gmail.com>'
|
__copyright__ = '2009, Darko Miletic <darko.miletic at gmail.com>'
|
||||||
@ -12,26 +11,24 @@ class Azstarnet(BasicNewsRecipe):
|
|||||||
title = 'Arizona Daily Star'
|
title = 'Arizona Daily Star'
|
||||||
__author__ = 'Darko Miletic'
|
__author__ = 'Darko Miletic'
|
||||||
description = 'news from Arizona'
|
description = 'news from Arizona'
|
||||||
language = 'en'
|
language = 'en'
|
||||||
|
|
||||||
publisher = 'azstarnet.com'
|
publisher = 'azstarnet.com'
|
||||||
category = 'news, politics, Arizona, USA'
|
category = 'news, politics, Arizona, USA'
|
||||||
delay = 1
|
delay = 1
|
||||||
oldest_article = 1
|
oldest_article = 3
|
||||||
max_articles_per_feed = 100
|
max_articles_per_feed = 100
|
||||||
no_stylesheets = True
|
no_stylesheets = True
|
||||||
use_embedded_content = False
|
use_embedded_content = False
|
||||||
encoding = 'utf-8'
|
encoding = 'utf-8'
|
||||||
needs_subscription = True
|
needs_subscription = True
|
||||||
remove_javascript = True
|
|
||||||
|
|
||||||
html2lrf_options = [
|
conversion_options = {
|
||||||
'--comment', description
|
'comment' : description
|
||||||
, '--category', category
|
, 'tags' : category
|
||||||
, '--publisher', publisher
|
, 'publisher' : publisher
|
||||||
]
|
, 'language' : language
|
||||||
|
}
|
||||||
|
|
||||||
html2epub_options = 'publisher="' + publisher + '"\ncomments="' + description + '"\ntags="' + category + '"'
|
|
||||||
|
|
||||||
def get_browser(self):
|
def get_browser(self):
|
||||||
br = BasicNewsRecipe.get_browser()
|
br = BasicNewsRecipe.get_browser()
|
||||||
@ -52,14 +49,19 @@ class Azstarnet(BasicNewsRecipe):
|
|||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
feeds = [(u'Tucson Region', u'http://rss.azstarnet.com/index.php?site=metro')]
|
feeds = [
|
||||||
|
(u'Tucson Region', u'http://rss.azstarnet.com/index.php?site=metro')
|
||||||
|
,(u'Sports' , u'http://rss.azstarnet.com/index.php?site=sports')
|
||||||
|
,(u'Business' , u'http://rss.azstarnet.com/index.php?site=biz-topheadlines')
|
||||||
|
,(u'Nation-World' , u'http://rss.azstarnet.com/index.php?site=news')
|
||||||
|
,(u'Opinion' , u'http://rss.azstarnet.com/index.php?site=opinion')
|
||||||
|
,(u'Lifestyle' , u'http://rss.azstarnet.com/index.php?site=accent')
|
||||||
|
,(u'Food' , u'http://rss.azstarnet.com/index.php?site=food')
|
||||||
|
]
|
||||||
|
|
||||||
def preprocess_html(self, soup):
|
def preprocess_html(self, soup):
|
||||||
soup.html['dir' ] = 'ltr'
|
|
||||||
soup.html['lang'] = 'en-US'
|
|
||||||
mtag = '\n<meta http-equiv="Content-Language" content="en-US"/>\n<meta http-equiv="Content-Type" content="text/html; charset=utf-8">\n'
|
|
||||||
soup.head.insert(0,mtag)
|
|
||||||
for item in soup.findAll(style=True):
|
for item in soup.findAll(style=True):
|
||||||
del item['style']
|
del item['style']
|
||||||
return soup
|
return soup
|
||||||
|
|
||||||
|
|
||||||
|
@ -26,6 +26,7 @@ sys.path.insert(0, path)
|
|||||||
|
|
||||||
sys.resources_location = os.environ.get('CALIBRE_RESOURCES_PATH', {resources!r})
|
sys.resources_location = os.environ.get('CALIBRE_RESOURCES_PATH', {resources!r})
|
||||||
sys.extensions_location = os.environ.get('CALIBRE_EXTENSIONS_PATH', {extensions!r})
|
sys.extensions_location = os.environ.get('CALIBRE_EXTENSIONS_PATH', {extensions!r})
|
||||||
|
sys.executables_location = os.environ.get('CALIBRE_EXECUTABLES_PATH', {executables!r})
|
||||||
|
|
||||||
'''
|
'''
|
||||||
|
|
||||||
@ -184,6 +185,7 @@ class Develop(Command):
|
|||||||
script = template.format(
|
script = template.format(
|
||||||
module=mod, func=func,
|
module=mod, func=func,
|
||||||
path=self.libdir, resources=self.sharedir,
|
path=self.libdir, resources=self.sharedir,
|
||||||
|
executables=self.staging_bindir,
|
||||||
extensions=self.j(self.libdir, 'calibre', 'plugins'))
|
extensions=self.j(self.libdir, 'calibre', 'plugins'))
|
||||||
path = self.j(self.staging_bindir, name)
|
path = self.j(self.staging_bindir, name)
|
||||||
if not os.path.exists(self.staging_bindir):
|
if not os.path.exists(self.staging_bindir):
|
||||||
|
@ -53,12 +53,10 @@ every time you add an HTML file to the library.\
|
|||||||
class PML2PMLZ(FileTypePlugin):
|
class PML2PMLZ(FileTypePlugin):
|
||||||
name = 'PML to PMLZ'
|
name = 'PML to PMLZ'
|
||||||
author = 'John Schember'
|
author = 'John Schember'
|
||||||
description = textwrap.dedent(_('''\
|
description = _('Create a PMLZ archive containing the PML file '
|
||||||
Create a PMLZ archive containing the PML file \
|
'and all images in the directory pmlname_img or images. '
|
||||||
and all images in the directory pmlname_img or \
|
'This plugin is run every time you add '
|
||||||
images. This plugin is run every time you add \
|
'a PML file to the library.')
|
||||||
a PML file to the library. \
|
|
||||||
'''))
|
|
||||||
version = numeric_version
|
version = numeric_version
|
||||||
file_types = set(['pml'])
|
file_types = set(['pml'])
|
||||||
supported_platforms = ['windows', 'osx', 'linux']
|
supported_platforms = ['windows', 'osx', 'linux']
|
||||||
|
@ -128,6 +128,8 @@ class MetadataSource(Plugin):
|
|||||||
from calibre.customize.ui import customize_plugin
|
from calibre.customize.ui import customize_plugin
|
||||||
customize_plugin(self, sc)
|
customize_plugin(self, sc)
|
||||||
|
|
||||||
|
def customization_help(self):
|
||||||
|
return 'This plugin can only be customized using the GUI'
|
||||||
|
|
||||||
class GoogleBooks(MetadataSource):
|
class GoogleBooks(MetadataSource):
|
||||||
|
|
||||||
|
@ -55,7 +55,8 @@ class Worker(object):
|
|||||||
return os.path.join(contents, 'MacOS', self.osx_interpreter)
|
return os.path.join(contents, 'MacOS', self.osx_interpreter)
|
||||||
|
|
||||||
return os.path.join(getattr(sys, 'frozen_path'), 'calibre-parallel') \
|
return os.path.join(getattr(sys, 'frozen_path'), 'calibre-parallel') \
|
||||||
if isfrozen else 'calibre-parallel'
|
if isfrozen else \
|
||||||
|
os.path.join(sys.executables_location, 'calibre-parallel')
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def gui_executable(self):
|
def gui_executable(self):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user