Apply Neal's patch - Fixed os.remove
[feedingit] / src / feedingitdbus.py
1 #!/usr/bin/env python2.5
2
3
4 # Copyright (c) 2007-2008 INdT.
5 # This program is free software: you can redistribute it and/or modify
6 # it under the terms of the GNU Lesser General Public License as published by
7 # the Free Software Foundation, either version 3 of the License, or
8 # (at your option) any later version.
9 #
10 #  This program is distributed in the hope that it will be useful,
11 #  but WITHOUT ANY WARRANTY; without even the implied warranty of
12 #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 #  GNU Lesser General Public License for more details.
14 #
15 #  You should have received a copy of the GNU Lesser General Public License
16 #  along with this program.  If not, see <http://www.gnu.org/licenses/>.
17 #
18
19 # ============================================================================
20 # Name        : FeedingIt.py
21 # Author      : Yves Marcoz
22 # Version     : 0.5.4
23 # Description : Simple RSS Reader
24 # ============================================================================
25
26 import dbus
27 import dbus.service
28
29 class ServerObject(dbus.service.Object):
30     def __init__(self, app):
31         # Here the service name
32         bus_name = dbus.service.BusName('org.maemo.feedingit',bus=dbus.SessionBus())
33         # Here the object path
34         dbus.service.Object.__init__(self, bus_name, '/org/maemo/feedingit')
35         self.app = app
36
37     # Here the interface name, and the method is named same as on dbus.
38     @dbus.service.method('org.maemo.feedingit')
39     def AddFeed(self, url):
40         self.app.addFeed(url)
41         return "Done"
42     
43     @dbus.service.method('org.maemo.feedingit')
44     def GetStatus(self):
45         return self.app.getStatus()
46
47     @dbus.service.method('org.maemo.feedingit')
48     def OpenFeed(self, key):
49         #self.app.buttonFeedClicked(None, self.app, None, key)
50         self.app.openFeed(key)
51         return "Done"
52     
53     @dbus.service.method('org.maemo.feedingit')
54     def OpenArticle(self, key, id):
55         #self.app.buttonFeedClicked(None, self.app, None, key)
56         self.app.openArticle(key, id)
57         return "Done"