Merge from trunk

This commit is contained in:
Charles Haley 2010-06-07 20:53:25 +01:00
commit dcd7bf1033
6 changed files with 41 additions and 30 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 739 B

View File

@ -1,9 +1,7 @@
#!/usr/bin/env python
__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
@ -11,27 +9,29 @@ from calibre.web.feeds.news import BasicNewsRecipe
class OurDailyBread(BasicNewsRecipe):
title = 'Our Daily Bread'
__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
language = 'en'
lang = 'en'
max_articles_per_feed = 100
no_stylesheets = True
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'
conversion_options = {
'comments' : description
,'tags' : category
,'language' : 'en'
,'language' : language
,'linearize_tables' : True
}
keep_only_tags = [dict(name='div', attrs={'class':['altbg','text']})]
remove_tags = [dict(name='div', attrs={'id':['ctl00_cphPrimary_pnlBookCover']}),
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'})
extra_css = '''
.text{font-family:Arial,Helvetica,sans-serif;font-size:x-small;}
.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;}
'''
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):
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)
def get_cover_url(self):
@ -61,3 +56,4 @@ class OurDailyBread(BasicNewsRecipe):
cover_url = a.img['src']
return cover_url

View File

@ -123,5 +123,12 @@ class BOOX(HANLINV3):
EBOOK_DIR_MAIN = '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

View File

@ -337,7 +337,7 @@ def main():
dev.touch(args[0])
elif command == 'test_file':
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.'))
options, args = parser.parse_args(args)
if len(args) != 1:

View File

@ -290,7 +290,7 @@ class XMLCache(object):
lpath_map = self.build_lpath_map(root)
for book in bl:
record = lpath_map[book.lpath]
record = lpath_map.get(book.lpath, None)
if record is not None:
title = record.get('title', None)
if title is not None and title != book.title:

View File

@ -19,12 +19,20 @@ use *plugins* to add funtionality to |app|.
Environment variables
-----------------------
* ``CALIBRE_CONFIG_DIRECTORY``
* ``CALIBRE_OVERRIDE_DATABASE_PATH``
* ``CALIBRE_DEVELOP_FROM``
* ``CALIBRE_OVERRIDE_LANG``
* ``SYSFS_PATH``
* ``http_proxy``
* ``CALIBRE_CONFIG_DIRECTORY`` - sets the directory where configuration files are stored/read.
* ``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`` - Used to run from a calibre development environment. See :ref:`develop`.
* ``CALIBRE_OVERRIDE_LANG`` - Used to force the language used by the interface (ISO 639 language code)
* ``SYSFS_PATH`` - Use if sysfs is mounted somewhere other than /sys
* ``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