/b-gtk/fix-viz

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/b-gtk/fix-viz

« back to all changes in this revision

Viewing changes to __init__.py

Merge James' D-Bus changes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
540
540
        from bzrlib.transport import get_transport
541
541
        if getattr(dbus, 'version', (0,0,0)) >= (0,41,0):
542
542
            import dbus.glib
543
 
        from bzrlib.plugins.dbus import activity
 
543
        BROADCAST_INTERFACE = "org.bazaarvcs.plugins.dbus.Broadcast"
544
544
        bus = dbus.SessionBus()
545
 
        # get the object so we can subscribe to callbacks from it.
546
 
        broadcast_service = bus.get_object(
547
 
            activity.Broadcast.DBUS_NAME,
548
 
            activity.Broadcast.DBUS_PATH)
549
545
 
550
546
        def catch_branch(revision_id, urls):
551
547
            # TODO: show all the urls, or perhaps choose the 'best'.
582
578
            except Exception, e:
583
579
                print e
584
580
                raise
585
 
        broadcast_service.connect_to_signal("Revision", catch_branch,
586
 
            dbus_interface=activity.Broadcast.DBUS_INTERFACE)
 
581
        bus.add_signal_receiver(catch_branch,
 
582
                                dbus_interface=BROADCAST_INTERFACE,
 
583
                                signal_name="Revision")
587
584
        pynotify.init("bzr commit-notify")
588
585
        gtk.main()
589
586