Skip to content

Conversation

@chimosky
Copy link
Member

@chimosky chimosky commented Mar 16, 2021

TODO

  • Fix activity resuming properly, also occurs on master. Activity resumes but with an empty canvas.

chimosky added 5 commits May 9, 2020 00:46
* Run 2to3
* Port telepathy static bindings to TelepathyGLib

Signed-off-by: Ibiam Chihurumnaya <ibiamchihurumnaya@gmail.com>
Activity uses telepathy tubes chan, this port aims to move collaboration to collabwrapper.
When a user opens the activity, the images shown in the activity are saved in a zip file and shared to other users when the activity is shared.
The joined users receive the zip file if they have enough disk space for it.

Replace the use of tempfile with activity_zip to save images as a zipfile.
Activity currently takes a while to load as load_journal_table searches for images from the root directory and it's subdirectories.

TODO
- Test collaboration.
- Fix issues with zipfile.
- Restrict image search to journal objects.

Signed-off-by: Ibiam Chihurumnaya <ibiamchihurumnaya@gmail.com>
Activity load time has reduced.

Signed-off-by: Ibiam Chihurumnaya <ibiamchihurumnaya@gmail.com>
Some things that were done are no longer needed, this commit removes them.
There's no need to extract any file anymore as they're all journal objects already.
Remove the redundant step when looping over journal objects.

Signed-off-by: Ibiam Chihurumnaya <ibiamchihurumnaya@gmail.com>
When activity is resumed this error is seen in the logs;

Warning: g_value_get_int: assertion 'G_VALUE_HOLDS_INT (value)' failed

This commit fixes that as it basically blocks the callbacks to the insert-text and activate signals, then sets the text in self.num_page_entry before unblocking both signals.

- Pass the path of self.activity_zip to _load_document
- Remove sensitive set on self._slides_toolbar.extract_image as the method
  was removed earlier and no longer exists.

Signed-off-by: Ibiam Chihurumnaya <ibiamchihurumnaya@gmail.com>
@quozl
Copy link
Contributor

quozl commented Apr 24, 2021

collabwrapper.py is not the latest, is that okay?

When testing on Ubuntu 20.04, this is what happens;

Traceback (most recent call last):
  File "/usr/bin/sugar-activity3", line 5, in <module>
    activityinstance.main()
  File "/usr/lib/python3/dist-packages/sugar3/activity/activityinstance.py", line 230, in main
    instance = create_activity_instance(activity_constructor, activity_handle)
  File "/usr/lib/python3/dist-packages/sugar3/activity/activityinstance.py", line 59, in create_activity_instance
    activity = constructor(handle)
  File "/usr/share/sugar/activities/ViewSlides.activity/viewslides.py", line 160, in __init__
    activity.Activity.__init__(self, handle)
  File "/usr/lib/python3/dist-packages/sugar3/activity/activity.py", line 468, in __init__
    self.set_icon_from_file(bundle.get_icon())
gi.repository.GLib.Error: rsvg-error-quark: Failed to load image “/usr/share/sugar/activities/ViewSlides.activity/activity/ViewSlides.svg”: XML parse error: error code=201 (3) in (null):28:45: Namespace prefix sodipodi for ry on path is not defined
 (0)

On Ubuntu 20.04 with librsvg 2.48.0 the activity does fail to start and
logs contain;

Traceback (most recent call last):
  File "/usr/bin/sugar-activity3", line 5, in <module>
    activityinstance.main()
  File "/usr/lib/python3/dist-packages/sugar3/activity/activityinstance.py", line 230, in main
    instance = create_activity_instance(activity_constructor, activity_handle)
  File "/usr/lib/python3/dist-packages/sugar3/activity/activityinstance.py", line 59, in create_activity_instance
    activity = constructor(handle)
  File "/usr/share/sugar/activities/ViewSlides.activity/viewslides.py", line 160, in __init__
    activity.Activity.__init__(self, handle)
  File "/usr/lib/python3/dist-packages/sugar3/activity/activity.py", line 468, in __init__
    self.set_icon_from_file(bundle.get_icon())
gi.repository.GLib.Error: rsvg-error-quark: Failed to load image “/usr/share/sugar/activities/ViewSlides.activity/activity/ViewSlides.svg”: XML parse error: error code=201 (3) in (null):28:45: Namespace prefix sodipodi for ry on path is not defined
 (0)

librsvg 2.47.0 introduced stricter namespaces in the XML parser,
https://gitlab.gnome.org/GNOME/librsvg/-/blob/master/NEWS#L67

so add namespace declarations.

Signed-off-by: Ibiam Chihurumnaya <ibiamchihurumnaya@gmail.com>
Signed-off-by: Ibiam Chihurumnaya <ibiamchihurumnaya@gmail.com>
@chimosky
Copy link
Member Author

chimosky commented Apr 26, 2021

collabwrapper.py is not the latest, is that okay?

Thanks for pointing that out, was testing something at the time and forgot to remove my changes, fixed in ceb20b3.

Kindly test 7524118 and let me know if the issue is fixed, also let me know if the librsvg version is wrong as that's the last you tested with when fixing a similar issue earlier.

Use context manager

Signed-off-by: Ibiam Chihurumnaya <ibiamchihurumnaya@gmail.com>
@chimosky chimosky mentioned this pull request Jul 2, 2021
@chimosky chimosky marked this pull request as ready for review July 2, 2021 23:18
@chimosky
Copy link
Member Author

chimosky commented Jul 2, 2021

At the moment the activity works as expected and the only existing issue like the one stated above still exist on master so I don't see that as a hindrance.

Although the port to collabwrapper is still a WIP, I think this can be merged and a release made and the port to collabwrapper fixed later. @quozl thoughts?

@quozl
Copy link
Contributor

quozl commented Jul 3, 2021 via email

@chimosky
Copy link
Member Author

chimosky commented Jul 3, 2021

Sure. Let not the good be the enemy of the perfect.

Agreed, thanks.

@chimosky chimosky merged commit ea15347 into master Jul 3, 2021
@chimosky chimosky deleted the python3-port branch July 3, 2021 10:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants