[Sugar-devel] [PATCH] don't return if HandleViewSource service available

Sascha Silbe sascha-ml-reply-to-2011-3 at silbe.org
Sat Jul 2 13:53:11 EDT 2011


Excerpts from Walter Bender's message of Mon Jun 06 20:26:08 +0200 2011:

[src/jarabe/view/viewsource.py]
> @@ -48,7 +48,6 @@ def setup_view_source(activity):
>      if service is not None:
>          try:
>              service.HandleViewSource()
> -            return
>          except dbus.DBusException, e:
>              expected_exceptions = ['org.freedesktop.DBus.Error.UnknownMethod',
>                      'org.freedesktop.DBus.Python.NotImplementedError']

The intention of this piece of code is to allow activities to override
the default View Source action with their own code. If an activity
implements HandleViewSource, it's supposed to handle the View Source
functionality entirely on the activity side. So if HandleViewSource()
succeeds, returning from setup_view_source() without any further action
is the right thing to do.

Activities that want the default View Source handler to be used should
either not implement the HandleViewSource dbus method at all or (in the
case of Python activities using the activity framework in sugar-toolkit)
raise NotImplementedError.

ImageViewer overrode the default View Source handler with a no-op method
[1], thereby unintentionally deactivating the View Source functionality.

Sascha

[1] https://bugs.sugarlabs.org/ticket/2862
-- 
http://sascha.silbe.org/
http://www.infra-silbe.de/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 500 bytes
Desc: not available
URL: <http://lists.sugarlabs.org/archive/sugar-devel/attachments/20110702/e94b8386/attachment-0001.pgp>


More information about the Sugar-devel mailing list