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

Returning to stored session doesn't work for some scripts #1896

Open
mobluse opened this issue Nov 3, 2021 · 2 comments
Open

Returning to stored session doesn't work for some scripts #1896

mobluse opened this issue Nov 3, 2021 · 2 comments

Comments

@mobluse
Copy link

mobluse commented Nov 3, 2021

Describe the bug

Storing my session on NumWorks site doesn't work: https://my.numworks.com/simulators/. I've tried to paste in my two programs many times, but they are removed and only a single line remains. Now the screen is black and nothing starts. It is returning to the session that doesn't work.
These are the programs I try to paste and they work by themselves in "My scripts":
https://my.numworks.com/python/mobluse/olpybasic
https://my.numworks.com/python/mobluse/test_olpybas
These scripts also work in the physical device.
These Python scripts are also available on GitHub:
https://github.com/mobluse/olpybasic

Screenshots

The screenshot file is 0 bytes.

To Reproduce

Steps to reproduce the behavior:

  1. Go to https://my.numworks.com/simulators/zzpnwo
  2. See that the screen is black.
  3. Create a new session.
  4. Try to paste in my two programs.
  5. Save the session after edit.
  6. Reload the shared link and se that it doesn't work or that the screens is black.

Expected behavior

The calculator should start in the state when it was saved i.e. in the Python shell having loaded my programs.

Environment

  • Epsilon version: 16.4.0
  • The platform(s) on which the problem happens: online simulator https://www.numworks.com/simulator/
    They work in the "My scripts" section with the same version.
    My browser is:
    Vivaldi 4.3.2439.56 (Stable channel) stable (32-bit)
    Revision a5e19200dd37281958aeb652add7f226dc091ab3
    OS Linux
    JavaScript V8 9.4.146.21
    User Agent Mozilla/5.0 (X11; Linux aarch64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.104 Safari/537.36
    and
    Chromium
    Version 92.0.4515.98 (Official Build) Built on Raspbian , running on Raspbian 10 (32-bit)
    My computer is: Raspberry Pi 4 B 8 GB.

They work in my NUMWORKS device with Epsilon 15.5.0

@LeaNumworks
Copy link
Collaborator

Thanks for writing this issue! The bug comes from the copy-pasting: we do not handle it properly on our simulator, we store the "Paste" event, but not the pasted content... So each time you run the script, the current content of you copy-paste buffer is what is pasted in your simulator session. Also, copying only works on Chrome for now. We should fix this by transforming the paste event into all the events forming the content of the copy-paste buffer.

@mobluse
Copy link
Author

mobluse commented Nov 22, 2021

It seems that nothing Python related is saved in the sessions (or it gets deleted when you return using the link). E.g. also the settings for the demo files: Auto import in shell are not saved in the session. Only the filename and the status of Auto import in shell is saved for your own program, and, as you say, the program is replaced by the current content of the clipboard.

There is a difference between copy and pasting programs in the simulator and the real device (I had Epsilon 15.5.0 when I tried this last): In the real device the clipboard is smaller so that e.g. an entire file doesn't fit; you have to copy and paste several times to copy an entire program from one file to another. This is perhaps due to a RAM limitation. However, it is good that this limitation is not emulated in the simulator, since you often want to paste from other sources in the browser.

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

No branches or pull requests

2 participants