From bd1e798e8ff23cd81a43a54b3e1227b27a59fa28 Mon Sep 17 00:00:00 2001 From: "kanru@kanru.info" <> Date: Sun, 26 Sep 2010 21:51:35 +0800 Subject: [PATCH 1/3] Fix DBus notification interface. Currently the DBus notification implementation is wrong. DBus call should be called via dbus.Interface not dbus.proxies.ProxyObject. Old implementation always hangs the system when issuing notification. --- src/calibre/gui2/notify.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/calibre/gui2/notify.py b/src/calibre/gui2/notify.py index 385fdd92b7..501f7007eb 100644 --- a/src/calibre/gui2/notify.py +++ b/src/calibre/gui2/notify.py @@ -28,12 +28,12 @@ class DBUSNotifier(Notifier): ICON = I('notify.png') - def __init__(self, server, path): + def __init__(self, server, path, interface): self.ok, self.err = True, None try: import dbus self.dbus = dbus - self._notify = dbus.SessionBus().get_object(server, path) + self._notify = dbus.Interface(dbus.SessionBus().get_object(server, path), interface) except Exception, err: self.ok = False self.err = str(err) @@ -43,7 +43,7 @@ class KDENotifier(DBUSNotifier): def __init__(self): DBUSNotifier.__init__(self, 'org.kde.VisualNotifications', - '/VisualNotifications') + '/VisualNotifications', 'org.kde.VisualNotifications') def __call__(self, body, summary=None, replaces_id=None, timeout=0): if replaces_id is None: @@ -62,7 +62,7 @@ class FDONotifier(DBUSNotifier): def __init__(self): DBUSNotifier.__init__(self, 'org.freedesktop.Notifications', - '/org/freedesktop/Notifications') + '/org/freedesktop/Notifications', 'org.freedesktop.Notifications') def __call__(self, body, summary=None, replaces_id=None, timeout=0): if replaces_id is None: From 0f341f5cd57ed6c9346ec11f812057f7f399251e Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 26 Sep 2010 12:28:35 -0600 Subject: [PATCH 2/3] Fifth beta --- src/calibre/constants.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/calibre/constants.py b/src/calibre/constants.py index be387d8ca2..6cab1d32e7 100644 --- a/src/calibre/constants.py +++ b/src/calibre/constants.py @@ -2,7 +2,7 @@ __license__ = 'GPL v3' __copyright__ = '2008, Kovid Goyal kovid@kovidgoyal.net' __docformat__ = 'restructuredtext en' __appname__ = 'calibre' -__version__ = '0.7.903' +__version__ = '0.7.904' __author__ = "Kovid Goyal " import re From 8c2b672e6c086db3003f3f1e7ce2283d7c57da1d Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 26 Sep 2010 12:30:19 -0600 Subject: [PATCH 3/3] ... --- resources/recipes/boortz.recipe | 15 +++++++-------- resources/recipes/popscience.recipe | 26 +++++++++++++------------- 2 files changed, 20 insertions(+), 21 deletions(-) diff --git a/resources/recipes/boortz.recipe b/resources/recipes/boortz.recipe index 0b52e0b9ca..8fb8041411 100644 --- a/resources/recipes/boortz.recipe +++ b/resources/recipes/boortz.recipe @@ -1,5 +1,4 @@ from calibre.web.feeds.news import BasicNewsRecipe -from calibre.ebooks.BeautifulSoup import BeautifulSoup, re class AdvancedUserRecipe1282101454(BasicNewsRecipe): title = 'Nealz Nuze' language = 'en' @@ -12,11 +11,11 @@ class AdvancedUserRecipe1282101454(BasicNewsRecipe): linearize_tables = True no_stylesheets = True remove_javascript = True - + masthead_url = 'http://boortz.com/images/nuze_logo.gif' keep_only_tags = [ dict(name='td', attrs={'id':['contentWellCell']}) - + ] remove_tags = [ dict(name='a', attrs={'class':['blogPermalink']}), @@ -26,13 +25,13 @@ class AdvancedUserRecipe1282101454(BasicNewsRecipe): remove_tags_after = [dict(name='div', attrs={'class':'blogEntryBody'}),] feeds = [ ('NUZE', 'http://boortz.com/nealz_nuze_rss/rss.xml') - + ] - - - - + + + + diff --git a/resources/recipes/popscience.recipe b/resources/recipes/popscience.recipe index 2bef7e4807..1527a1bb71 100644 --- a/resources/recipes/popscience.recipe +++ b/resources/recipes/popscience.recipe @@ -1,5 +1,5 @@ from calibre.web.feeds.news import BasicNewsRecipe -from calibre.ebooks.BeautifulSoup import BeautifulSoup, re +from calibre.ebooks.BeautifulSoup import re class AdvancedUserRecipe1282101454(BasicNewsRecipe): title = 'Popular Science' @@ -13,35 +13,35 @@ class AdvancedUserRecipe1282101454(BasicNewsRecipe): no_stylesheets = True remove_javascript = True use_embedded_content = True - + masthead_url = 'http://www.raytheon.com/newsroom/rtnwcm/groups/Public/documents/masthead/rtn08_popscidec_masthead.jpg' - - + + feeds = [ - + ('Gadgets', 'http://www.popsci.com/full-feed/gadgets'), ('Cars', 'http://www.popsci.com/full-feed/cars'), ('Science', 'http://www.popsci.com/full-feed/science'), ('Technology', 'http://www.popsci.com/full-feed/technology'), ('DIY', 'http://www.popsci.com/full-feed/diy'), - + ] - - #The following will get read of the Gallery: links when found - + + #The following will get read of the Gallery: links when found + def preprocess_html(self, soup) : print 'SOUP IS: ', soup weblinks = soup.findAll(['head','h2']) if weblinks is not None: for link in weblinks: if re.search('(Gallery)(:)',str(link)): - + link.parent.extract() return soup - #----------------------------------------------------------------- - - + #----------------------------------------------------------------- + +