/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

  • Committer: Martin Albisetti
  • Date: 2008-04-03 23:02:32 UTC
  • mfrom: (450.1.18 trunk)
  • Revision ID: argentina@gmail.com-20080403230232-bj4zq3xs9i84e516
MergeĀ fromĀ trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
110
110
 
111
111
 
112
112
def icon_path(*args):
113
 
    return os.path.join(data_path(), *args)
 
113
    basedirs = [os.path.join(data_path()),
 
114
             "/usr/share/bzr-gtk", 
 
115
             "/usr/local/share/bzr-gtk"]
 
116
    for basedir in basedirs:
 
117
        path = os.path.join(basedir, 'icons', *args)
 
118
        if os.path.exists(path):
 
119
            return path
 
120
    return None
114
121
 
115
122
 
116
123
class GTKCommand(Command):
533
540
        from bzrlib.transport import get_transport
534
541
        if getattr(dbus, 'version', (0,0,0)) >= (0,41,0):
535
542
            import dbus.glib
536
 
        from bzrlib.plugins.dbus import activity
 
543
        BROADCAST_INTERFACE = "org.bazaarvcs.plugins.dbus.Broadcast"
537
544
        bus = dbus.SessionBus()
538
 
        # get the object so we can subscribe to callbacks from it.
539
 
        broadcast_service = bus.get_object(
540
 
            activity.Broadcast.DBUS_NAME,
541
 
            activity.Broadcast.DBUS_PATH)
542
545
 
543
546
        def catch_branch(revision_id, urls):
544
547
            # TODO: show all the urls, or perhaps choose the 'best'.
575
578
            except Exception, e:
576
579
                print e
577
580
                raise
578
 
        broadcast_service.connect_to_signal("Revision", catch_branch,
579
 
            dbus_interface=activity.Broadcast.DBUS_INTERFACE)
 
581
        bus.add_signal_receiver(catch_branch,
 
582
                                dbus_interface=BROADCAST_INTERFACE,
 
583
                                signal_name="Revision")
580
584
        pynotify.init("bzr commit-notify")
581
585
        gtk.main()
582
586