1 #!/usr/bin/env python2.5
4 # Copyright (c) 2007-2008 INdT.
5 # Copyright (c) 2011 Neal H. Walfield
6 # This program is free software: you can redistribute it and/or modify
7 # it under the terms of the GNU Lesser General Public License as published by
8 # the Free Software Foundation, either version 3 of the License, or
9 # (at your option) any later version.
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU Lesser General Public License for more details.
16 # You should have received a copy of the GNU Lesser General Public License
17 # along with this program. If not, see <http://www.gnu.org/licenses/>.
20 # ============================================================================
22 # Author : Yves Marcoz
24 # Description : Simple RSS Reader
25 # ============================================================================
31 logger = logging.getLogger(__name__)
33 class ServerObject(dbus.service.Object):
34 def __init__(self, app):
35 # Here the service name
36 bus = dbus.SessionBus()
38 bus_name = dbus.service.BusName(
39 'org.maemo.feedingit', bus=bus, do_not_queue=True)
40 except dbus.NameExistsException:
42 logger.info("FeedingIt appears to already be running. "
43 + "Sending other instance to front.")
45 proxy = bus.get_object('org.maemo.feedingit',
46 '/org/maemo/feedingit')
47 iface = dbus.Interface(proxy, 'org.maemo.feedingit')
52 # Here the object path
53 dbus.service.Object.__init__(self, bus_name, '/org/maemo/feedingit')
56 # Here the interface name, and the method is named same as on dbus.
57 @dbus.service.method('org.maemo.feedingit')
58 def AddFeed(self, url):
62 @dbus.service.method('org.maemo.feedingit')
64 return self.app.getStatus()
66 @dbus.service.method('org.maemo.feedingit')
67 def OpenFeed(self, key):
68 #self.app.buttonFeedClicked(None, self.app, None, key)
69 self.app.openFeed(key)
72 @dbus.service.method('org.maemo.feedingit')
73 def OpenArticle(self, key, id):
74 #self.app.buttonFeedClicked(None, self.app, None, key)
75 self.app.openArticle(key, id)
78 @dbus.service.method('org.maemo.feedingit')