diff --git a/src/calibre/library/cli.py b/src/calibre/library/cli.py index a509e31d60..491a9e61fc 100644 --- a/src/calibre/library/cli.py +++ b/src/calibre/library/cli.py @@ -78,8 +78,9 @@ STANZA_TEMPLATE='''\ urn:calibre:${record['id']} ${record['authors']} ${record['timestamp'].strftime('%Y-%m-%dT%H:%M:%SZ')} - - + + + ${record['comments']} diff --git a/src/calibre/library/server.py b/src/calibre/library/server.py index 8fad2da593..159663fdef 100644 --- a/src/calibre/library/server.py +++ b/src/calibre/library/server.py @@ -72,15 +72,15 @@ class LibraryServer(object): STANZA_ENTRY=MarkupTemplate(textwrap.dedent('''\ - ${record['title']} - urn:calibre:${record['id']} + ${record[FM['title']]} + urn:calibre:${record[FM['id']]} ${authors} - ${record['timestamp'].strftime('%Y-%m-%dT%H:%M:%S+00:00')} - - - + ${record[FM['timestamp']].strftime('%Y-%m-%dT%H:%M:%S+00:00')} + + + - ${record['comments']} + ${record[FM['comments']]} ''')) @@ -245,7 +245,7 @@ class LibraryServer(object): if 'EPUB' in record[FIELD_MAP['formats']].upper(): authors = ' & '.join([i.replace('|', ',') for i in record[2].split(',')]) books.append(self.STANZA_ENTRY.generate(authors=authors, - record=record, + record=record, FM=FIELD_MAP, port=self.opts.port, server=self.opts.hostname, ).render('xml').decode('utf8')) @@ -254,7 +254,7 @@ class LibraryServer(object): cherrypy.response.headers['Last-Modified'] = self.last_modified(updated) cherrypy.response.headers['Content-Type'] = 'text/xml' - return self.STANZA.generate(subtitle='', data=books, + return self.STANZA.generate(subtitle='', data=books, FM=FIELD_MAP, updated=updated, id='urn:calibre:main').render('xml') @expose @@ -359,7 +359,7 @@ def main(args=sys.argv): opts, args = parser.parse_args(args) cherrypy.log.screen = True from calibre.utils.config import prefs - db = LibraryDatabase2(prefs['library_path'], row_factory=True) + db = LibraryDatabase2(prefs['library_path']) server = LibraryServer(db, opts) server.start() return 0 diff --git a/src/calibre/library/static/gui.css b/src/calibre/library/static/gui.css index df93396786..1bcc4e1eb0 100644 --- a/src/calibre/library/static/gui.css +++ b/src/calibre/library/static/gui.css @@ -13,7 +13,7 @@ Search bar #search_box { width: 201px; height: 31px; - background: url(/static/bg_search_box.png); + background: url(bg_search_box.png); top: 5px; right: 20px; position: absolute; } diff --git a/src/calibre/library/static/gui.js b/src/calibre/library/static/gui.js index ab1f5bdadc..b0a88db7f9 100644 --- a/src/calibre/library/static/gui.js +++ b/src/calibre/library/static/gui.js @@ -234,7 +234,7 @@ function setup_count_bar() { function search() { var search = $.trim($('#search_box * #s').val()); - fetch_library_books(last_start, last_num, LIBRARY_FETCH_TIMEOUT, + fetch_library_books(0, last_num, LIBRARY_FETCH_TIMEOUT, last_sort, last_sort_order, search); } diff --git a/src/calibre/web/feeds/recipes/__init__.py b/src/calibre/web/feeds/recipes/__init__.py index 7cc994d7e3..4217e2e583 100644 --- a/src/calibre/web/feeds/recipes/__init__.py +++ b/src/calibre/web/feeds/recipes/__init__.py @@ -10,7 +10,7 @@ recipes = [ 'wired', 'globe_and_mail', 'smh', 'espn', 'business_week', 'ars_technica', 'upi', 'new_yorker', 'irish_times', 'iht', 'discover_magazine', 'scientific_american', 'new_york_review_of_books', - 'daily_telegraph', 'guardian', 'el_pais', + 'daily_telegraph', 'guardian', 'el_pais', 'new_scientist', 'b92', 'politika' ] import re, imp, inspect, time, os diff --git a/src/calibre/web/feeds/recipes/b92.py b/src/calibre/web/feeds/recipes/b92.py new file mode 100644 index 0000000000..2f160b8892 --- /dev/null +++ b/src/calibre/web/feeds/recipes/b92.py @@ -0,0 +1,38 @@ +#!/usr/bin/env python + +__license__ = 'GPL v3' +__copyright__ = '2008, Darko Miletic ' +''' +b92.net +''' + +from calibre.web.feeds.news import BasicNewsRecipe + +class B92(BasicNewsRecipe): + title = u'B92' + __author__ = 'Darko Miletic' + description = 'Dnevne vesti iz Srbije i sveta' + oldest_article = 7 + max_articles_per_feed = 100 + no_stylesheets = True + use_embedded_content = False + + remove_tags_after = dict(name='div', attrs={'class':'gas'}) + remove_tags = [ + dict(name='div' , attrs={'class':'interaction clearfix' }) + ,dict(name='div' , attrs={'class':'gas' }) + ,dict(name='ul' , attrs={'class':'comment-nav' }) + ,dict(name='table', attrs={'class':'pages-navigation-form'}) + ] + + feeds = [ + (u'Vesti' , u'http://www.b92.net/info/rss/vesti.xml' ) + ,(u'Kultura' , u'http://www.b92.net/info/rss/kultura.xml' ) + ,(u'Automobili', u'http://www.b92.net/info/rss/automobili.xml') + ,(u'Zivot' , u'http://www.b92.net/info/rss/zivot.xml' ) + ,(u'Tehnopolis', u'http://www.b92.net/info/rss/tehnopolis.xml') + ,(u'Biz' , u'http://www.b92.net/info/rss/biz.xml' ) + ] + + def print_version(self, url): + return url + '&version=print' diff --git a/src/calibre/web/feeds/recipes/new_scientist.py b/src/calibre/web/feeds/recipes/new_scientist.py new file mode 100644 index 0000000000..75d72bcb4e --- /dev/null +++ b/src/calibre/web/feeds/recipes/new_scientist.py @@ -0,0 +1,36 @@ +#!/usr/bin/env python + +__license__ = 'GPL v3' +__copyright__ = '2008, Darko Miletic ' +''' +newscientist.com +''' + +from calibre.web.feeds.news import BasicNewsRecipe + +class NewScientist(BasicNewsRecipe): + title = u'New Scientist' + __author__ = 'Darko Miletic' + description = 'Science news' + oldest_article = 7 + max_articles_per_feed = 100 + no_stylesheets = True + use_embedded_content = False + + keep_only_tags = [ + dict(name='div' , attrs={'id':'pgtop' }) + ,dict(name='div' , attrs={'id':'maincol' }) + ] + remove_tags = [ + dict(name='div' , attrs={'class':'hldBd' }) + ,dict(name='div' , attrs={'id':'compnl' }) + ,dict(name='div' , attrs={'id':'artIssueInfo' }) + ] + + feeds = [ + (u'Latest Headlines' , u'http://feeds.newscientist.com/science-news' ) + ,(u'Magazine' , u'http://www.newscientist.com/feed/magazine' ) + ,(u'Health' , u'http://www.newscientist.com/feed/view?id=2&type=channel' ) + ,(u'Life' , u'http://www.newscientist.com/feed/view?id=3&type=channel' ) + ,(u'Space' , u'http://www.newscientist.com/feed/view?id=6&type=channel' ) + ] \ No newline at end of file diff --git a/src/calibre/web/feeds/recipes/politika.py b/src/calibre/web/feeds/recipes/politika.py new file mode 100644 index 0000000000..7debb45368 --- /dev/null +++ b/src/calibre/web/feeds/recipes/politika.py @@ -0,0 +1,33 @@ +#!/usr/bin/env python + +__license__ = 'GPL v3' +__copyright__ = '2008, Darko Miletic ' +''' +politika.rs +''' + +from calibre.web.feeds.news import BasicNewsRecipe + +class Politika(BasicNewsRecipe): + title = u'Politika Online' + __author__ = 'Darko Miletic' + description = 'Najstariji dnevni list na Balkanu' + oldest_article = 7 + max_articles_per_feed = 100 + no_stylesheets = True + extra_css = '.content_center_border {text-align: left;}' + use_embedded_content = False + + remove_tags_before = dict(name='div', attrs={'class':'content_center_border'}) + remove_tags_after = dict(name='div', attrs={'class':'datum_item_details'}) + + feeds = [ + (u'Politika' , u'http://www.politika.rs/rubrike/Politika/index.1.lt.xml' ) + ,(u'Svet' , u'http://www.politika.rs/rubrike/Svet/index.1.lt.xml' ) + ,(u'Redakcijski komentari', u'http://www.politika.rs/rubrike/redakcijski-komentari/index.1.lt.xml') + ,(u'Pogledi' , u'http://www.politika.rs/pogledi/index.lt.xml' ) + ,(u'Pogledi sa strane' , u'http://www.politika.rs/rubrike/Pogledi-sa-strane/index.1.lt.xml' ) + ,(u'Tema dana' , u'http://www.politika.rs/rubrike/tema-dana/index.1.lt.xml' ) + ,(u'Kultura' , u'http://www.politika.rs/rubrike/Kultura/index.1.lt.xml' ) + ,(u'Zivot i stil' , u'http://www.politika.rs/rubrike/zivot-i-stil/index.1.lt.xml' ) + ]
${record['comments']}