Added full rotation support to QML interface
[feedingit] / src / updatedbus.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.6.1
23 # Description : Simple RSS Reader
24 # ============================================================================
25
26 import dbus
27 import dbus.service
28
29 def get_lock(key):
30     try:
31         bus_name = dbus.service.BusName('org.marcoz.feedingit.lock_%s' %key,bus=dbus.SessionBus(), do_not_queue=True)
32     except:
33         bus_name = None
34     return bus_name
35     
36
37 class UpdateServerObject(dbus.service.Object):
38     def __init__(self, app):
39         # Here the service name
40         bus_name = dbus.service.BusName('org.marcoz.feedingit',bus=dbus.SessionBus())
41         # Here the object path
42         dbus.service.Object.__init__(self, bus_name, '/org/marcoz/feedingit/update')
43         self.app = app
44
45     @dbus.service.method('org.marcoz.feedingit')
46     def UpdateAll(self):
47         self.app.automaticUpdate()
48         return "Done"
49     
50     @dbus.service.method('org.marcoz.feedingit')
51     def StopUpdate(self):
52         self.app.stopUpdate()
53         return "Done"
54     
55     # A signal that will be exported to dbus
56     @dbus.service.signal('org.marcoz.feedingit', signature='')
57     def ArticleCountUpdated(self):
58         pass
59
60     # A signal that will be exported to dbus
61     @dbus.service.signal('org.marcoz.feedingit', signature='')
62     def UpdateStarted(self):
63         pass
64     
65     # A signal that will be exported to dbus
66     @dbus.service.signal('org.marcoz.feedingit', signature='')
67     def UpdateFinished(self):
68         pass