SimonBiggs / scriptedforms

Quickly create live-update GUIs for Python packages using Markdown and simple HTML elements.
Apache License 2.0
508 stars 34 forks source link

name '_VariableHandler' is not defined #216

Closed olivercrask closed 6 years ago

olivercrask commented 6 years ago

I have been testing out all the new features in 0.8 dev3.

All of them seemed to work really well, but suddenly this error has occurred..

After it occurred once, whenever I start a new scripted form containing a variable I have the same error again

Do you have any suggestions?

It may be because of the way I installed the package, I transferred the files from the github repository into a 8.0 portable installation I had previously downloaded. Can only get the portable version to function while at work.. image

olivercrask commented 6 years ago

I imagine downloading 0.9 will resolve, will give this a go and then report back

SimonBiggs commented 6 years ago

Unfortunately in ScriptedForms current state the only way to get rid of that error is to press the kernel reset button.

How I imagine it happened is the page was reloaded during the boot up phase of ScriptedForms. Essentially the behind the scenes start up code didn't finish running.

My plan to fix this is via the following method:

https://github.com/SimonBiggs/scriptedforms/issues/129

That is another "big one" though and it will be a significant refactor. But it is quite a pain point in usage for myself also.

SimonBiggs commented 6 years ago

Also, would you be able to take a screenshot of the JavaScript console. Whenever a python error occurs, the point at which it occured is also printed in the JavaScript console. If you find the first error within the JavaScript console, and then also screenshot the items around it I can get a pretty good idea of what was trying to happen at the moment the error occured.

I really should provide the option for those error logs to be sent to me automatically.

SimonBiggs commented 6 years ago

Or at least make a "send logs of this error to developer(s)" button. It could then open up a mail to link with the contents of the error log visible to the user when they send the email.

SimonBiggs commented 6 years ago

I did just think of a way to solve this particular issue without a massive refactor. Below are notes for myself:

Instead of having the boot up code occur in multiple kernel sends, the startup process be building a code string to be sent in one single batch to the kernel. Have the end of that code string be a variable flag which identifies "start code has been successfully run". On form boot up, first check for the existence of that flag, if it doesn't exist (meaning startup hasn't happened or didn't previously successfully complete) then go about the kernel code startup process.

SimonBiggs commented 6 years ago

@OxygenLithium Okay, so I have done buckets of work making this nasty little bug go away :). I think I have also managed to knock the issues on the head you might have been having with the start section :) #217

Take scriptedforms-0.9.1.dev2 for a spin and let me know your mileage. :)