Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#2862 closed defect (fixed)

doesn't support View Source

Reported by: sascha_silbe Owned by: sayamindu
Priority: Unspecified by Maintainer Milestone: Unspecified
Component: Imageviewer Version: Git as of bugdate
Severity: Unspecified Keywords:
Cc: Distribution/OS:
Bug Status: Unconfirmed

Description

Imageviewer doesn't support View Source at all. If you choose View Source from the Frame icon, nothing happens.

Imageviewer should show
a) its own source ("Activity Bundle Source") and
b) the XML data ("Instance Source") in case of SVG.

Attachments (1)

0001-don-t-return-if-HandleViewSource-service-available.patch (889 bytes) - added by walter 13 years ago.
this patch seems to fix the problem, but doesn't address mysterious root cause

Download all attachments as: .zip

Change History (6)

comment:1 follow-up: Changed 13 years ago by walter

Is there an error message in shell.log? It could be related to #2846 ???

comment:2 in reply to: ↑ 1 Changed 13 years ago by sascha_silbe

  • Version changed from Unspecified to Git as of bugdate

Replying to walter:

Is there an error message in shell.log?

There was no error message in either shell.org or org.laptop.ImageViewerActivity-1.log. The only View Source related messages were these (in shell.log):

1306071536.775400 DEBUG root: _key_pressed_cb: 55 9 <alt><shift>v
1306071536.997368 DEBUG root: _key_released_cb: 55 9

It could be related to #2846 ???

Imageviewer has all source files in the top-level directory, so I don't think #2846 has any impact on it.

comment:3 Changed 13 years ago by walter

There is a puzzling 'return' in setup_view_source that seems to be at the heart of the problem.

if service is not None:

try:

...
service.HandleViewSource()
return

The service.HandleViewSource ends up going to an Unimplemented call in activity.py and returns.
Not sure why ImageViewer ends up in this block whereas other activities don't, but if you don't return after the call to service.HandleViewSource(), but rather, drop through, View Source seems to work fine.

Changed 13 years ago by walter

this patch seems to fix the problem, but doesn't address mysterious root cause

comment:4 Changed 13 years ago by alsroot

  • Resolution set to fixed
  • Status changed from new to closed

http://git.sugarlabs.org/imageviewer/mainline/commit/d5513e35809cc72a64c8d9f9a4d7bf6889885ef4

The problem is that handle_view_source() in activity was just pass and sugar relies on raising an exception if it is not implemented but pylint treating raise NotImplementedError as a code that should be overriden in user code (which is obvious).

comment:5 Changed 13 years ago by erikos

The same is happening in Chat, Aleksey will fix it.

Note: See TracTickets for help on using tickets.