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
dcd7bf1033
BIN
resources/images/news/ourdailybread.png
Normal file
BIN
resources/images/news/ourdailybread.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 739 B |
@ -1,9 +1,7 @@
|
|||||||
#!/usr/bin/env python
|
|
||||||
|
|
||||||
__license__ = 'GPL v3'
|
__license__ = 'GPL v3'
|
||||||
__copyright__ = '2009, Darko Miletic <darko.miletic at gmail.com>'
|
__copyright__ = '2009-2010, Darko Miletic <darko.miletic at gmail.com>'
|
||||||
'''
|
'''
|
||||||
rbc.org
|
odb.org
|
||||||
'''
|
'''
|
||||||
|
|
||||||
from calibre.web.feeds.news import BasicNewsRecipe
|
from calibre.web.feeds.news import BasicNewsRecipe
|
||||||
@ -11,27 +9,29 @@ from calibre.web.feeds.news import BasicNewsRecipe
|
|||||||
class OurDailyBread(BasicNewsRecipe):
|
class OurDailyBread(BasicNewsRecipe):
|
||||||
title = 'Our Daily Bread'
|
title = 'Our Daily Bread'
|
||||||
__author__ = 'Darko Miletic and Sujata Raman'
|
__author__ = 'Darko Miletic and Sujata Raman'
|
||||||
description = 'Religion'
|
description = "Our Daily Bread is a daily devotional from RBC Ministries which helps readers spend time each day in God's Word."
|
||||||
oldest_article = 15
|
oldest_article = 15
|
||||||
language = 'en'
|
language = 'en'
|
||||||
lang = 'en'
|
|
||||||
|
|
||||||
max_articles_per_feed = 100
|
max_articles_per_feed = 100
|
||||||
no_stylesheets = True
|
no_stylesheets = True
|
||||||
use_embedded_content = False
|
use_embedded_content = False
|
||||||
category = 'religion'
|
category = 'ODB, Daily Devotional, Bible, Christian Devotional, Devotional, RBC Ministries, Our Daily Bread, Devotionals, Daily Devotionals, Christian Devotionals, Faith, Bible Study, Bible Studies, Scripture, RBC, religion'
|
||||||
encoding = 'utf-8'
|
encoding = 'utf-8'
|
||||||
|
|
||||||
conversion_options = {
|
conversion_options = {
|
||||||
'comments' : description
|
'comments' : description
|
||||||
,'tags' : category
|
,'tags' : category
|
||||||
,'language' : 'en'
|
,'language' : language
|
||||||
|
,'linearize_tables' : True
|
||||||
}
|
}
|
||||||
|
|
||||||
keep_only_tags = [dict(name='div', attrs={'class':['altbg','text']})]
|
keep_only_tags = [dict(attrs={'class':'module-content'})]
|
||||||
|
remove_tags = [
|
||||||
|
dict(attrs={'id':'article-zoom'})
|
||||||
|
,dict(attrs={'class':'listen-now-box'})
|
||||||
|
]
|
||||||
|
remove_tags_after = dict(attrs={'class':'readable-area'})
|
||||||
|
|
||||||
remove_tags = [dict(name='div', attrs={'id':['ctl00_cphPrimary_pnlBookCover']}),
|
|
||||||
]
|
|
||||||
extra_css = '''
|
extra_css = '''
|
||||||
.text{font-family:Arial,Helvetica,sans-serif;font-size:x-small;}
|
.text{font-family:Arial,Helvetica,sans-serif;font-size:x-small;}
|
||||||
.devotionalTitle{font-family:Arial,Helvetica,sans-serif; font-size:large; font-weight: bold;}
|
.devotionalTitle{font-family:Arial,Helvetica,sans-serif; font-size:large; font-weight: bold;}
|
||||||
@ -40,14 +40,9 @@ class OurDailyBread(BasicNewsRecipe):
|
|||||||
a{color:#000000;font-family:Arial,Helvetica,sans-serif; font-size:x-small;}
|
a{color:#000000;font-family:Arial,Helvetica,sans-serif; font-size:x-small;}
|
||||||
'''
|
'''
|
||||||
|
|
||||||
feeds = [(u'Our Daily Bread', u'http://www.rbc.org/rss.ashx?id=50398')]
|
feeds = [(u'Our Daily Bread', u'http://odb.org/feed/')]
|
||||||
|
|
||||||
def preprocess_html(self, soup):
|
def preprocess_html(self, soup):
|
||||||
soup.html['xml:lang'] = self.lang
|
|
||||||
soup.html['lang'] = self.lang
|
|
||||||
mtag = '<meta http-equiv="Content-Type" content="text/html; charset=' + self.encoding + '">'
|
|
||||||
soup.head.insert(0,mtag)
|
|
||||||
|
|
||||||
return self.adeify_images(soup)
|
return self.adeify_images(soup)
|
||||||
|
|
||||||
def get_cover_url(self):
|
def get_cover_url(self):
|
||||||
@ -61,3 +56,4 @@ class OurDailyBread(BasicNewsRecipe):
|
|||||||
cover_url = a.img['src']
|
cover_url = a.img['src']
|
||||||
|
|
||||||
return cover_url
|
return cover_url
|
||||||
|
|
||||||
|
@ -123,5 +123,12 @@ class BOOX(HANLINV3):
|
|||||||
EBOOK_DIR_MAIN = 'MyBooks'
|
EBOOK_DIR_MAIN = 'MyBooks'
|
||||||
EBOOK_DIR_CARD_A = 'MyBooks'
|
EBOOK_DIR_CARD_A = 'MyBooks'
|
||||||
|
|
||||||
|
def windows_sort_drives(self, drives):
|
||||||
|
return drives
|
||||||
|
|
||||||
|
def osx_sort_names(self, names):
|
||||||
|
return names
|
||||||
|
|
||||||
|
def linux_swap_drives(self, drives):
|
||||||
|
return drives
|
||||||
|
|
||||||
|
@ -337,7 +337,7 @@ def main():
|
|||||||
dev.touch(args[0])
|
dev.touch(args[0])
|
||||||
elif command == 'test_file':
|
elif command == 'test_file':
|
||||||
parser = OptionParser(usage=("usage: %prog test_file path\n"
|
parser = OptionParser(usage=("usage: %prog test_file path\n"
|
||||||
'Open device, copy file psecified by path to device and '
|
'Open device, copy file specified by path to device and '
|
||||||
'then eject device.'))
|
'then eject device.'))
|
||||||
options, args = parser.parse_args(args)
|
options, args = parser.parse_args(args)
|
||||||
if len(args) != 1:
|
if len(args) != 1:
|
||||||
|
@ -290,7 +290,7 @@ class XMLCache(object):
|
|||||||
|
|
||||||
lpath_map = self.build_lpath_map(root)
|
lpath_map = self.build_lpath_map(root)
|
||||||
for book in bl:
|
for book in bl:
|
||||||
record = lpath_map[book.lpath]
|
record = lpath_map.get(book.lpath, None)
|
||||||
if record is not None:
|
if record is not None:
|
||||||
title = record.get('title', None)
|
title = record.get('title', None)
|
||||||
if title is not None and title != book.title:
|
if title is not None and title != book.title:
|
||||||
|
@ -19,12 +19,20 @@ use *plugins* to add funtionality to |app|.
|
|||||||
Environment variables
|
Environment variables
|
||||||
-----------------------
|
-----------------------
|
||||||
|
|
||||||
* ``CALIBRE_CONFIG_DIRECTORY``
|
* ``CALIBRE_CONFIG_DIRECTORY`` - sets the directory where configuration files are stored/read.
|
||||||
* ``CALIBRE_OVERRIDE_DATABASE_PATH``
|
* ``CALIBRE_OVERRIDE_DATABASE_PATH`` - allows you to specify the full path to metadata.db. Using this variable you can have metadata.db be in a location other than the library folder. Useful if your library folder is on a networked drive that does not support file locking.
|
||||||
* ``CALIBRE_DEVELOP_FROM``
|
* ``CALIBRE_DEVELOP_FROM`` - Used to run from a calibre development environment. See :ref:`develop`.
|
||||||
* ``CALIBRE_OVERRIDE_LANG``
|
* ``CALIBRE_OVERRIDE_LANG`` - Used to force the language used by the interface (ISO 639 language code)
|
||||||
* ``SYSFS_PATH``
|
* ``SYSFS_PATH`` - Use if sysfs is mounted somewhere other than /sys
|
||||||
* ``http_proxy``
|
* ``http_proxy`` - Used on linux to specify an HTTP proxy
|
||||||
|
|
||||||
|
Tweaks
|
||||||
|
------------
|
||||||
|
|
||||||
|
Tweaks are small changes that you can specify to control various aspects of |app|'s behavior. You specify them by editing the 2tweaks.py file in the config directory.
|
||||||
|
The default tweaks.py file is reproduced below
|
||||||
|
|
||||||
|
.. literalinclude:: ../../../resources/default_tweaks.py
|
||||||
|
|
||||||
|
|
||||||
A Hello World plugin
|
A Hello World plugin
|
||||||
|
Loading…
x
Reference in New Issue
Block a user