Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update the activity with sugarlabs/turtleart-activity and apply mexico patches #4

Closed
wants to merge 23 commits into from

Conversation

kiy4h
Copy link
Contributor

@kiy4h kiy4h commented Dec 18, 2019

I cloned https://github.com/sugarlabs/turtleart-activity/ to local and cherry-picked those three commits:

fbc466be30368b8e2ebd15445a5a5612acfcf231
8fbb3c7b686d607e441fb1084fe96f0a3209168d
acfeb4b519b796f51cb8986ae76bcd92217780b1

from the mexico branch (https://github.com/sugarlabs/turtleart-activity/tree/mexico) and resolved a few merge conflicts, then I ran ./pygi-convert.sh in the directory.
And finally, I pushed to the fork of TortugadeMexico.

@quozl
Copy link
Contributor

quozl commented Dec 18, 2019

Thanks, I will review what you did tomorrow, my time.

@srevinsaju
Copy link
Member

srevinsaju commented Dec 18, 2019

@kiy4h, you have committed turtleblocks.py. turtleblocks.py, turtleblocks and turtleblocks.desktop are currently not working and hadn't been ported to Python3 because of telepathy deprecation. To compat this all references of telepathy had to be refactored to TelepathyGLib as mentioned in the Python 3 Porting Guide. Some files have not been ported to TelepathyGLib. This includes the files in TurtleArt/ta*.py. There are 17 instances of telepathy in this port. But I think textchannelwrapper would be enough I suppose to manage collabortation. @quozl ? The other sources can be removed.

Tested logs contain Errors. It might be helpful


(sugar-activity3:14622): Gtk-WARNING **: 18:14:17.513: Theme parsing error: gtk-widgets.css:16:32: The style property GtkExpander:expander-size is deprecated and shouldn't be used anymore. It will be removed in a future version

(sugar-activity3:14622): Gtk-WARNING **: 18:14:17.514: Theme parsing error: gtk-widgets.css:17:35: The style property GtkExpander:expander-spacing is deprecated and shouldn't be used anymore. It will be removed in a future version
1576682058.647784 WARNING root: No icon with the name save-macro was found in the theme.
1576682058.649044 WARNING root: No icon with the name save-macro was found in the theme.
reskin already in palette extras, skipping...
Traceback (most recent call last):
  File "/home/srevinsaju/Totru/TortugadeMexico/TurtleArtActivity.py", line 547, in do_eraser_cb
    self.restore_challenge()
  File "/home/srevinsaju/Totru/TortugadeMexico/TurtleArtActivity.py", line 553, in restore_challenge
    self._load_level()
  File "/home/srevinsaju/Totru/TortugadeMexico/TurtleArtActivity.py", line 1831, in _load_level
    self.tw.canvas.setxy(int(-Gdk.Screen.width() / 2), 0,
AttributeError: 'TurtleGraphics' object has no attribute 'setxy'
Traceback (most recent call last):
  File "/home/srevinsaju/Totru/TortugadeMexico/TurtleArtActivity.py", line 547, in do_eraser_cb
    self.restore_challenge()
  File "/home/srevinsaju/Totru/TortugadeMexico/TurtleArtActivity.py", line 553, in restore_challenge
    self._load_level()
  File "/home/srevinsaju/Totru/TortugadeMexico/TurtleArtActivity.py", line 1831, in _load_level
    self.tw.canvas.setxy(int(-Gdk.Screen.width() / 2), 0,
AttributeError: 'TurtleGraphics' object has no attribute 'setxy'
Traceback (most recent call last):
  File "/home/srevinsaju/Totru/TortugadeMexico/TurtleArtActivity.py", line 581, in do_stop_cb
    self.stop_turtle_button.set_icon('hideshowoff')
AttributeError: 'ToolButton' object has no attribute 'set_icon'

Traceback (most recent call last):
  File "/home/srevinsaju/Totru/TortugadeMexico/TurtleArtActivity.py", line 547, in do_eraser_cb
    self.restore_challenge()
  File "/home/srevinsaju/Totru/TortugadeMexico/TurtleArtActivity.py", line 553, in restore_challenge
    self._load_level()
  File "/home/srevinsaju/Totru/TortugadeMexico/TurtleArtActivity.py", line 1831, in _load_level
    self.tw.canvas.setxy(int(-Gdk.Screen.width() / 2), 0,
AttributeError: 'TurtleGraphics' object has no attribute 'setxy'

The Error is caused by the difference in the TurtleArtActivity.py on the master branch of turtleart-activity and Tortugade-Mexico which is obvious to be different.
@quozl , I would be happy to know what makes Tortugade different from TurtleArts.

This might help, I am stuck with fixing collaboration. you can cherry pick TelepathyGLib port commits sugarlabs/turtleart-activity#73

@quozl
Copy link
Contributor

quozl commented Dec 19, 2019

I agree with everything up to d4e6b9f and have merged that. I'm now working on the next few commits.

@quozl
Copy link
Contributor

quozl commented Dec 19, 2019

@kiy4h, 5a12889 adds conflict markers, which means you hadn't finished it before making the commit, instead you removed the conflict markers in further commits.

Is suboptimal because we can't use git bisect in future, and can't easily cherry-pick again next time we have to synchronise the two source repositories.

Better is to get to the same place but by better series of commits.

Please start a new branch as at the new master d4e6b9f and try cherry-pick fbc466be30368b8e2ebd15445a5a5612acfcf231 again, but this time review the conflicts and fix them. Use an IDE that lets you see the change about to be committed, and lets you select specific lines to be included in a commit. I use emacs with magit for this, but there's gotta be other tools out there, I just don't know what they are yet.

Also, in comparing git diff d4e6b9f..c3de7d5 there are some important changes you've made that should be separated out and applied to both repositories. Because these aren't really part of the change set from TurtleBlocks to Tortuga de Mexico, and to have them here only makes the latter depart from the former.

@srevinsaju, thanks for testing. Your work on sugarlabs/turtleart-activity#73 to fix the activity for use in GNOME is yet to be merged, but when it is then I'd expect it to be also added to this activity.

@quozl
Copy link
Contributor

quozl commented Dec 19, 2019

Fixes #2

@kiy4h
Copy link
Contributor Author

kiy4h commented Dec 19, 2019

Sorry, that was due to my habit of autosaving a modified file.
I'm used to using VSCode as my code editor, I'll try to fix this mess by rebasing. Thanks for the detailed instruction!

Signed-off-by: James Cameron <quozl@laptop.org>
@quozl
Copy link
Contributor

quozl commented Dec 19, 2019

Thanks. I've taken your late porting changes that were in c2de7d5 and not in 0d0c724 and added them to the TurtleBlocks master branch as sugarlabs/turtleart-activity@9335bcd ("Late changes for porting to GTK 3").

Next I'll review and test just the two patches you've added here.

@kiy4h
Copy link
Contributor Author

kiy4h commented Dec 19, 2019

That was quick! Should I also apply the changes to this repository (in this PR)?

@quozl
Copy link
Contributor

quozl commented Dec 20, 2019

@kiy4h, if you like, doesn't matter, we can do it later. Now to review your two new patches against the previous patches; I set them side by side and scrolled down each pair;

At this point I stopped looking; whatever method you used to cherry-pick and resolve conflicts didn't work, or there has been a huge redesign of the change.

So please check you have properly integrated each change from sugarlabs/turtleart-activity@fbc466b adjusted as necessary for changes since that patch.

The way I would do this is start a new branch as of 0d0c724, use git rebase -i to reverse the order of the last two patches, make changes by hand while reading them from sugarlabs/turtleart-activity@fbc466b, and make commits for each major change. You would end up with a series of patches to show your work, which could be later collapsed into one.

@walterbender
Copy link
Member

walterbender commented Dec 22, 2019

File "/home/walter/Activities/TortugadeMexico/TurtleArt/talogo.py", line 26, in
import urllib.request, urllib.error, urllib.parse
ImportError: No module named request

Maybe grab the tautils.py from turtle-activity ???
import urllib2

@quozl
Copy link
Contributor

quozl commented Dec 22, 2019

Thanks. Reviewed ae927f2 against sugarlabs/turtleart-activity@fbc466b;

  • there's at least one call to gobject that hasn't been ported; remember than in applying this old patch, any new lines have to be ported to GTK 3 and ported to Python 3, because those two portings also happened along the mainline of descent since the patch was originally written,
  • the code fragment that creates the help button and connects to _do_help_cb is present in the old patch but missing in your patch,
  • the next two patch bands are missing, including the only call to _make_confusion_combo.

I stopped at that point.

Please make sure you check your work; set the two patches side by side and work through every change. Don't rely on automation (e.g. git) to achieve this. You have to understand the reason for every change, and if you don't yet then work on that until you do. If you have questions on specific changes in the original patch, point them out and ask.

@kiy4h
Copy link
Contributor Author

kiy4h commented Dec 23, 2019

@quozl excuse me, why does this error appear when I ran sugar-activity3 and clicked on the snail button in both TortugadeMexico and turtleart-activity?

Traceback (most recent call last):
  File "/home/kiyah/Activities/TortugadeMexico/TurtleArt/talogo.py", line 627, in doevalstep
    next(self.step)
  File "/home/kiyah/Activities/TortugadeMexico/TurtleArt/talogo.py", line 596, in _evalsym
    result = self.cfun.fcn(self, *self.arglist)
  File "/home/kiyah/Activities/TortugadeMexico/TurtleArt/taprimitive.py", line 327, in __call__
    new_prim.call_afterwards(*new_args, **new_kwargs)
  File "/home/kiyah/Activities/TortugadeMexico/TurtleArt/tabasics.py", line 1312, in after_move
    self.tw.coord_scale)
  File "/home/kiyah/Activities/TortugadeMexico/TurtleArt/talogo.py", line 1090, in update_label_value
    for block in self.value_blocks_to_update[name]:
AttributeError: 'LogoCode' object has no attribute 'value_blocks_to_update'

Is this a known issue, or did I miss installing something?

screenshot

@walterbender
Copy link
Member

can you reproduce the same error on the regular turtle-blocks activity?

@kiy4h
Copy link
Contributor Author

kiy4h commented Dec 23, 2019

@walterbender Yes, happens on both turtle activities.

walterbender added a commit to walterbender/turtle-activity that referenced this pull request Dec 23, 2019
sugarlabs/TortugadeMexico#4

In slow-mode, the value block labels are modified to show the current
value. But when there are no value blocks, there is an indexing error.
@walterbender
Copy link
Member

walterbender commented Dec 23, 2019

I pushed a fix to turtle-activity that can also be applied here.

walterbender/turtle-activity@d6e04f6

There seem to be more problems with turtle-activity that are resolved in my version. Not sure how we got out of sync.

kiy4h pushed a commit to kiy4h/TortugadeMexico that referenced this pull request Dec 24, 2019
sugarlabs#4

In slow-mode, the value block labels are modified to show the current
value. But when there are no value blocks, there is an indexing error.
kiy4h pushed a commit to kiy4h/TortugadeMexico that referenced this pull request Dec 25, 2019
sugarlabs#4

In slow-mode, the value block labels are modified to show the current
value. But when there are no value blocks, there is an indexing error.
kiy4h pushed a commit to kiy4h/TortugadeMexico that referenced this pull request Dec 25, 2019
sugarlabs#4

In slow-mode, the value block labels are modified to show the current
value. But when there are no value blocks, there is an indexing error.
kiy4h pushed a commit to kiy4h/TortugadeMexico that referenced this pull request Dec 25, 2019
sugarlabs#4

In slow-mode, the value block labels are modified to show the current
value. But when there are no value blocks, there is an indexing error.
@kiy4h
Copy link
Contributor Author

kiy4h commented Dec 25, 2019

During testing, I've encountered many errors and exceptions.

I'm guessing this one was caused by the ToolButton module itself, not related to the turtle activity

EDIT 1: This happens when you were trying to choose a block palette, and this error makes it impossible to show most of the blocks.

EDIT 2: They were already implemented in both turtle activities, https://github.com/sugarlabs/turtleart-activity/blob/9335bcdc64e379da54d051920aaf5319796be9dd/TurtleArt/util/helpbutton.py#L53 is the one from turtle activity.
I found out that the block palette doesn't want to open after I ran my turtle blocks (in my case, I used the 🐌 button), but I haven't found a fix.

EDIT 3: The only way to switch between block palettes is by using the arrow, clicking from the palette choices does nothing.

EDIT 4: After reading https://developer.sugarlabs.org/sugar3/sugar3.graphics.toolbutton.html , I changed set_current_palette to set_palette (https://github.com/sugarlabs/sugar-toolkit-gtk3/blob/e41c3a5f35ae796625e28beb6c30d91158120794/src/sugar3/graphics/toolbutton.py#L224) and it settled things up a bit. Except now self._palette is a string, and it returns a lot of AttributeError: 'str' object has no attribute 'props', 'popdown', 'is_up', etc

image

Traceback (most recent call last):
  File "/home/kiy4h/Activities/TortugadeMexico/TurtleArtActivity.py", line 485, in do_palette_buttons_cb
    self._help_button.set_current_palette(palette_names[i])
AttributeError: 'ToolButton' object has no attribute 'set_current_palette'

This one often appears in mexico turtle, but it doesn't happen in turtleart-activity:

Traceback (most recent call last):
  File "/home/kiy4h/Activities/TortugadeMexico/TurtleArtActivity.py", line 1769, in _levels_cb
    self._load_level()
  File "/home/kiy4h/Activities/TortugadeMexico/TurtleArtActivity.py", line 1780, in _load_level
    self.tw.canvas.setxy(int(-Gdk.Screen.width() / 2), 0,
AttributeError: 'TurtleGraphics' object has no attribute 'setxy'

Should I grab (necessary changes from) the tacanvas.py from turtleart-activity's mexico branch to solve this?
EDIT: found out that setxy is deprecated, but there's setxy2. What are the difference?

And this one, using the "clean" block:

Traceback (most recent call last):
  File "/home/kiy4h/Activities/TortugadeMexico/TurtleArt/talogo.py", line 629, in doevalstep
    next(self.step)
  File "/home/kiy4h/Activities/TortugadeMexico/TurtleArt/talogo.py", line 598, in _evalsym
    result = self.cfun.fcn(self, *self.arglist)
  File "/home/kiy4h/Activities/TortugadeMexico/TurtleArt/taprimitive.py", line 322, in __call__
    return_value = new_prim.func(*new_args, **new_kwargs)
  File "/home/kiy4h/Activities/TortugadeMexico/TurtleArt/taprimitive.py", line 709, in group
    return_val = prim()
  File "/home/kiy4h/Activities/TortugadeMexico/TurtleArt/taprimitive.py", line 322, in __call__
    return_value = new_prim.func(*new_args, **new_kwargs)
  File "/home/kiy4h/Activities/TortugadeMexico/TurtleArt/talogo.py", line 1054, in clear_value_blocks
    self.update_label_value(name)
  File "/home/kiy4h/Activities/TortugadeMexico/TurtleArt/talogo.py", line 1072, in update_label_value
    for block in self.value_blocks_to_update[name]:
KeyError: 'xcor'

I'm still trying to find out what caused this one, since it doesn't happen in turtleart-activity.

EDIT: The "clean" block only works if you clean (Ctrl+E) first.

image

@kiy4h kiy4h force-pushed the cherrypick-mexico branch 2 times, most recently from d158bcb to 3be4df3 Compare December 25, 2019 13:59
@kiy4h kiy4h force-pushed the cherrypick-mexico branch 4 times, most recently from f710eab to 88a1e9a Compare January 23, 2020 05:57
@quozl
Copy link
Contributor

quozl commented Jan 23, 2020

Rebased by hand based on your branch and pushed to master. Thanks!

@quozl quozl closed this Jan 23, 2020
@BharathSatheeshKumar
Copy link

I cloned https://github.com/sugarlabs/turtleart-activity/ to local and cherry-picked those three commits:

fbc466be30368b8e2ebd15445a5a5612acfcf231 8fbb3c7b686d607e441fb1084fe96f0a3209168d acfeb4b519b796f51cb8986ae76bcd92217780b1

from the mexico branch (https://github.com/sugarlabs/turtleart-activity/tree/mexico) and resolved a few merge conflicts, then I ran ./pygi-convert.sh in the directory. And finally, I pushed to the fork of TortugadeMexico.

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.

None yet

7 participants