~rainct/zeitgeist/922620

« back to all changes in this revision

Viewing changes to python/client.py

  • Committer: Siegfried-Angel Gevatter Pujals
  • Date: 2012-02-07 22:45:47 UTC
  • Revision ID: siegfried@gevatter.com-20120207224547-np546ewnpxypm3jg
Fix monitors being installed twice; python-dbus always gives us a name
owner changed notification, so we want to ignore this first one.

Show diffs side-by-side

added added

removed removed

Lines of Context:
179
179
                self._reconnect_when_needed = reconnect
180
180
                self._load_introspection_data()
181
181
                
 
182
                self._first_connection = True
182
183
                self._disconnect_callbacks = set()
183
184
                self._reconnect_callbacks = set()
184
185
                
188
189
                                self.__methods = self.__signals = None
189
190
                                for callback in self._disconnect_callbacks:
190
191
                                        callback()
 
192
                        elif self._first_connection:
 
193
                                # python-dbus guarantees that it'll call NameOwnerChanged at startup
 
194
                                # (even if the service was already running). When that happens, we
 
195
                                # don't want to connect the signals a second time.
 
196
                                self._first_connection = False
191
197
                        else:
192
198
                                if not self._reconnect_when_needed:
193
199
                                        return