-
Notifications
You must be signed in to change notification settings - Fork 3
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
Port to Python3 #4
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- sugargame/init.py : change version to '1.3'
- f = open(_file_path, 'r') needs to be changed to f = open(_file_path, 'rb') open() under Python 2 return byte strings, while under Python 3 they return unicode strings
- Add K_KP3 and K_KP5 to event translation table
Checkout the changes made in sugargame activity during port to python3
Thanks @JuiP ..Changes have made as suggested by you. |
@Saumya-Mishra9129 Thanks for the pull request Please update sugargame |
Thanks. Reviewed. I also fetched the latest commit and compared to sugargame master, and there are some differences. Please resolve these. I've also cherry-picked 7b95d4b ("GObject to GLib") so please rebase. |
Signed-off-by: James Cameron <quozl@laptop.org>
Based on the git history, you seem to have just done a So I've done a rebase for you. Here's how the branches are rendered with gitk just before I push (sm is your repository); This shows a few things;
Check that you have done a "git remote add" for the sugarlabs repository? |
Reviewed. Tested in Terminal using sugar-activity3; Fixed and pushed, please test? I've run out of time for today. |
A completed change must be as close as possible to sugargame master. Also, there are calls to sys.exit(). Although this could have been taken care of when porting to sugargame v1.2, for now, we should match the semantics used by sugargamev1.3. |
c961223
to
7adaba9
Compare
@chimosky The above commits were necessary. I have removed them. |
7adaba9
to
f080d3e
Compare
@quozl I have tested, the activity is working without error but The license is not specified for this activity. |
@Saumya-Mishra9129 Thanks for the changes but the port is incomplete.
|
Hey, @ayushnawal I have seen your previous ports to sugargame v1.3, I have a silly doubt; What are the impacts of including sugargame as a git submodule? Adding it as submodules might help in updating to the latest sugargame version by just |
@JuiP I gave it a thought once. But many times I have hit activities that were unfinished, or unreleased, or don't work because they have not been maintained against changing library environment. So many times I got my PR stall and then I had to take help from james and srevin. Some of the issues which should be taken care of are: return on quit, pygame module initialization in PygameCanvas, detect stop button, etc. Ultimately what I think is when updating sugargame, we should try to match the semantics of activity with the test activity as close as possible. In many activities port to sugargame v1.2 was not done properly which needed to be fixed. That's why these days I am reviewing changes made in the codebase of sugargame, toolkit, etc. so that I can complete my remaining PR's too. So in my opinion No, just updating sugargame source files isn't sufficient for activities that are not maintained regularly. I guess I cleared your doubt because I too faced it many times 😓 |
@ayushnawal I have removed sys.exit calls from Proyecto.py. End of Line and shebang as well. I have tried to match the semantics used by sugargamev1.3 and used stick-hero-activity commit of you so that event queue will not become full. Review once. |
Thanks for the question about using submodules. Here's our history and current situation;
Submodules can be fantastic, but they aren't a good solution to the type of problems we have. Most of our problems are inattention, and requiring more attention to complicated tools works against that. |
Tested 209a09b.
|
Thanks! :) @ayushnawal and @quozl |
@Saumya-Mishra9129 sys.exit was used to close the activity, you must exit the activity after replacing it. We should allow sugar toolkit to cleanup. See the Sugargame test activity for how to exit properly. The event loop must be fixed. Calling sys.exit bypasses any of Sugar Toolkit activity closure actions. |
@Saumya-Mishra9129 you haven't tested the changes you made.
I would suggest you to please test the changes you made once |
@Saumya-Mishra9129, have a look at the control flow in the Sugargame test activity; both files. |
5f4e8af
to
209a09b
Compare
@quozl I have tried to fix CPU framerate and escape exit call in 981eea8.
The pygame here uses hardcoded screen sizes. It is designed for 1200X900 display . However, it should be working on all screens . This issue needs to be fixed first in order to ensure smooth functioning of activity. |
Thanks. The framerate limitation is effective, as is exit on escape key. Reviewed as at 981eea8 briefly, and observed some surprises;
On the other hand, the music happening at the same time as image loading delay could be a feature. An alternate way to solve this is to have two phases of loading; first phase loads the main menu image, and second phase loads all the other images once the main menu is flipped to the display. During the delay loading, a transparent window has covered the screen and isn't rendered until loading finishes. On particularly slow systems, or systems with disk I/O contention, a child may switch to another app because of the delay. |
PR include -
2.GObject to GLib
@quozl please make a review.