Re: [Sugar-devel] Progress on getting sugar-runner working again

2024-03-04 Thread James Cameron
That's great.  When you're happy with the changes, you can make a pull request.

On Sun, Mar 03, 2024 at 09:39:29AM -0600, James Simmons wrote:
> James,
> 
> I didn't understand the purpose in forking before but now I do. A new fork 
> with
> my changes in a branch is here:
> 
> [1]https://github.com/jdsimmons/sugar-runner/tree/python3
> 
> I updated the README with suggestions on how to test.
> 
> I just tried:
> 
> sugar-activity3 GetIABooksActivity.GetIABooksActivity
> 
> and it worked. I had no idea it would. I haven't worked on Sugar Activities
> since 2014. After I wrote E-Book Enlightenment I went down a rabbit hole where
> I prepared lots of books for archive,org and Project Gutenberg, wrote and self
> published a memoir of my youth among the Hare Krishnas, figured out how to use
> LaTeX to bring public domain books back into print and self published a bunch
> of them until Amazon put a stop to it, and even started a novel.
> 
> I would have stayed in that rabbit hole if a bright eight year old boy had not
> decided that he wanted an old computer running Linux I had intended to give to
> his older brothers.
> 
> As for why I still want to get sugar-runner working, it is because it gives me
> the whole Sugar environment. After I use Get IA Books to download books I need
> to check the books out in the Journal and make sure they got in there OK and
> are readable. Activities using collaboration really need the whole environment
> working and making screenshots that look like what the Activity looks like on
> an XO laptop is easy with sugar-runner.
> 
> Thanks again,
> 
> James Simmons
> 
> On Sat, Mar 2, 2024 at 11:45 PM James Cameron <[2]qu...@laptop.org> wrote:
> 
> On Sat, Mar 02, 2024 at 08:14:20PM -0600, James Simmons wrote:
> > [...]
> > If someone wants to try this out I could post a branch with my
> > changes to GitHub if I was given needed permissions to do so.
> >
> > For now, I'm stuck.
> 
> Fork the repository, push your branch to your fork, then create a pull
> request with details on how to try it out.
> 
> Also, I'm curious, what does Sugar Runner get you that running
> "sugar-activity3" doesn't get you?
> 
> References:
> 
> [1] https://github.com/jdsimmons/sugar-runner/tree/python3
> [2] mailto:qu...@laptop.org
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] Progress on getting sugar-runner working again

2024-03-03 Thread James Simmons
James,

I didn't understand the purpose in forking before but now I do. A new fork
with my changes in a branch is here:

https://github.com/jdsimmons/sugar-runner/tree/python3

I updated the README with suggestions on how to test.

I just tried:

sugar-activity3 GetIABooksActivity.GetIABooksActivity

and it worked. I had no idea it would. I haven't worked on Sugar Activities
since 2014. After I wrote E-Book Enlightenment I went down a rabbit hole
where I prepared lots of books for archive,org and Project Gutenberg, wrote
and self published a memoir of my youth among the Hare Krishnas, figured
out how to use LaTeX to bring public domain books back into print and self
published a bunch of them until Amazon put a stop to it, and even started a
novel.

I would have stayed in that rabbit hole if a bright eight year old boy had
not decided that he wanted an old computer running Linux I had intended to
give to his older brothers.

As for why I still want to get sugar-runner working, it is because it gives
me the whole Sugar environment. After I use Get IA Books to download books
I need to check the books out in the Journal and make sure they got in
there OK and are readable. Activities using collaboration really need the
whole environment working and making screenshots that look like what the
Activity looks like on an XO laptop is easy with sugar-runner.

Thanks again,

James Simmons

On Sat, Mar 2, 2024 at 11:45 PM James Cameron  wrote:

> On Sat, Mar 02, 2024 at 08:14:20PM -0600, James Simmons wrote:
> > [...]
> > If someone wants to try this out I could post a branch with my
> > changes to GitHub if I was given needed permissions to do so.
> >
> > For now, I'm stuck.
>
> Fork the repository, push your branch to your fork, then create a pull
> request with details on how to try it out.
>
> Also, I'm curious, what does Sugar Runner get you that running
> "sugar-activity3" doesn't get you?
>
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] Progress on getting sugar-runner working again

2024-03-02 Thread James Cameron
On Sat, Mar 02, 2024 at 08:14:20PM -0600, James Simmons wrote:
> [...]
> If someone wants to try this out I could post a branch with my
> changes to GitHub if I was given needed permissions to do so.
> 
> For now, I'm stuck.

Fork the repository, push your branch to your fork, then create a pull
request with details on how to try it out.

Also, I'm curious, what does Sugar Runner get you that running
"sugar-activity3" doesn't get you?
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


[Sugar-devel] Progress on getting sugar-runner working again

2024-03-02 Thread James Simmons
When I used to work on Sugar Activities I made use of sugar-runner (then
called sugar-emulator) and I was disappointed to find out it was not
included in Fedora 39 and was no longer maintained.

I have been fooling with this and while I haven't got it working yet I feel
like I've made some progress, which I'd like to share with you.

The code is in this repo:

https://github.com/sugarlabs/sugar-runner

To build it you need to do autogen.sh, then make, then sudo make install.
There is a directory "scripts" which has four Python scripts (although the
files do not end in .py) and you need to convert them from Python 2 to
Python 3. There is an online utility to do this which can be used as a
starting point.

There is also a "lib" directory containing C code. I believe that this code
and the Makefile that builds and installs it does not need to be modified.
However, when you do sudo make install it will put the files in /usr/local
directories which Python 3 will need help to find:

export GI_TYPELIB_PATH=/usr/local/lib/girepository-1.0
export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH

These two commands run before sugar-runner seem to do the trick.

You will also need to install Xephyr:

sudo dnf install Xephyr

After you do this, sugar-runner will report a few places where your Python
2 code needs to be changed to Python 3. One of these is a complaint that
you are using strings when you should be using bytes. This is caused by a
difference in the way that Python reads files. Python 2 reads bytes by
default, Python 3 reads UTF-8 strings.

You can fix this by opening files as 'rb' and converting strings to bytes
using the .decode() method.  I'm pretty sure about the first one, not as
much about the second.

After all this when you run sugar-runner you get this:

sugar-runner
WARNING: Running setxkbmap against an Xwayland server

The XKEYBOARD keymap compiler (xkbcomp) reports:
> Warning:  Could not resolve keysym XF86CameraAccessEnable
> Warning:  Could not resolve keysym XF86CameraAccessDisable
> Warning:  Could not resolve keysym XF86CameraAccessToggle
> Warning:  Could not resolve keysym XF86NextElement

.. a bunch of warnings ...

No symbols defined for  (keycode 217)
No symbols defined for  (keycode 219)
No symbols defined for  (keycode 222)
No symbols defined for  (keycode 230)
No symbols defined for  (keycode 248)
discover_other_daemon: 1xinit: connection to X server lost

waiting for X server to shut down

The screen goes black for a moment and then you're back to the terminal. So
it looks like Xephyr is at least trying to start.

If someone wants to try this out I could post a branch with my changes to
GitHub if I was given needed permissions to do so.

For now, I'm stuck.

James Simmons
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel