![]() |
Not restarting
I got the netconsole working, so I can now see the output while the code is running.
I am using the "simple" example as a starting point, but the restart functionality is not working properly. When I hit the button for restart, I see the exception output on the netconsole, but the code is not restarted, it acts like it is just hung up. Is there something special I need to do to make the code restart once an exception is raised? |
Re: Not restarting
The example is outdated, the boot.py no longer reloads the code when an uncaught exception occurs. You can type 'reboot' at the NetConsole to reset the robot.
|
Re: Not restarting
Ah. Ok. Now that I re-read the 2012.1 announcement I see the note about restarting.
So, if I change the RuntimeError exception to SystemRestart, then the interpreter should be restarted -- or at least it should try to. There may be other issues around that, but for testing it may be usable. |
Re: Not restarting
Quote:
|
Re: Not restarting
I haven't had a chance to test this on the robot, but given the warnings around the SystemRestart exception ("This is still not all that reliable..."), I wonder if using Python's own reload() would be better?
This works on my local machine...any reason not to do something like this? Also, anyone have an idea how to improve it? robot.py: Code:
from my_exceptions import RestartExceptionCode:
class RestartException(Exception): passCode:
from my_exceptions import RestartException |
| All times are GMT -5. The time now is 19:52. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi