~ubuntu-branches/ubuntu/precise/zeitgeist/precise-proposed

« back to all changes in this revision

Viewing changes to _zeitgeist/engine/notify.py

  • Committer: Bazaar Package Importer
  • Author(s): Siegfried-Angel Gevatter Pujals
  • Date: 2010-01-20 00:23:48 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20100120002348-hn9uooxjjmdgb4c0
Tags: 0.3.2-1
* New upstream release:
   - Add FindEvents, optimized shorthand for GetEvents(FindEventIds(...)).
   - Fix DeleteEvents and make it ignore bad requests.
   - Fix GetEvents not to raise an exception when called with an empty list.
   - ZeitgeistClient.get_version() now returns a Python list.
   - Some code refactoring, documentation changes and other little fixes.
* Delete debian/zeitgeist-daemon.bash_completion, as it's now in the tarball,
  and update debian/rules to reflect this change.
* debian/control.in:
   - Change Homepage field to zeitgeist-project.com.

Show diffs side-by-side

added added

removed removed

Lines of Context:
40
40
                
41
41
                :param owner: Unique DBus name of the process owning the monitor
42
42
                :param monitor_path: The DBus object path to the monitor object
43
 
                    in the client process
 
43
                        in the client process
44
44
                :param time_range: a 
45
 
                    :class:`TimeRange <zeitgeist.datamodel.TimeRange` instance
46
 
                    the monitored events must lie within
 
45
                        :class:`TimeRange <zeitgeist.datamodel.TimeRange` instance
 
46
                        the monitored events must lie within
47
47
                :param event_templates: List of event templates that any events
48
 
                    must match in order to notify this monitor
 
48
                        must match in order to notify this monitor
49
49
                :type event_templates: list of
50
 
                    :class:`Events <zeitgeist.datamodel.Event>`
 
50
                        :class:`Events <zeitgeist.datamodel.Event>`
51
51
                """
52
52
                bus = dbus.SessionBus()
53
53
                proxy = bus.get_object(owner, monitor_path)
103
103
                """
104
104
                for ev in events : ev._make_dbus_sendable()
105
105
                self.NotifyInsert(time_range, events,
106
 
                            reply_handler=self._notify_reply_handler,
107
 
                            error_handler=self._notify_error_handler)
 
106
                                        reply_handler=self._notify_reply_handler,
 
107
                                        error_handler=self._notify_error_handler)
108
108
        
109
109
        def notify_delete (self, time_range, event_ids):
110
110
                """
115
115
                time range. That is the responsibility of the caller
116
116
                """
117
117
                self.NotifyDelete(time_range, event_ids,
118
 
                            reply_handler=self._notify_reply_handler,
119
 
                            error_handler=self._notify_error_handler)
 
118
                                        reply_handler=self._notify_reply_handler,
 
119
                                        error_handler=self._notify_error_handler)
120
120
        
121
121
        @staticmethod
122
122
        def hash(owner, path):
146
146
                
147
147
                # Listen for disconnecting clients to clean up potential dangling monitors
148
148
                dbus.SessionBus().add_signal_receiver (self._name_owner_changed,
149
 
                                                       signal_name="NameOwnerChanged",
150
 
                                                       dbus_interface=dbus.BUS_DAEMON_IFACE,
151
 
                                                       arg2="")
 
149
                                                                                           signal_name="NameOwnerChanged",
 
150
                                                                                           dbus_interface=dbus.BUS_DAEMON_IFACE,
 
151
                                                                                           arg2="")
152
152
        
153
153
        def install_monitor (self, owner, monitor_path, time_range, event_templates):
154
154
                """
164
164
                :param owner: Unique DBus name of the process owning the monitor
165
165
                :type owner: string
166
166
                :param monitor_path: The DBus object path for the monitor object
167
 
                    in the client process
 
167
                        in the client process
168
168
                :type monitor_path: String or :class:`dbus.ObjectPath`
169
169
                :param time_range: a 
170
 
                    :class:`TimeRange <zeitgeist.datamodel.TimeRange` instance
171
 
                    the monitored events must lie within
 
170
                        :class:`TimeRange <zeitgeist.datamodel.TimeRange` instance
 
171
                        the monitored events must lie within
172
172
                :param event_templates: A list of
173
 
                    :class:`Event <zeitgeist.datamodel.Event>` templates to match
 
173
                        :class:`Event <zeitgeist.datamodel.Event>` templates to match
174
174
                :returns: This method has no return value
175
175
                """
176
176
                # Check that we don't already have the monitor, so we don't
194
194
                :param owner: Unique DBus name of the process owning the monitor
195
195
                :type owner: string
196
196
                :param monitor_path: The DBus object path for the monitor object
197
 
                    in the client process
 
197
                        in the client process
198
198
                :type monitor_path: String or :class:`dbus.ObjectPath`
199
199
                """
200
200
                log.debug("Removing monitor %s%s", owner, monitor_path)