[Boa Constr] Boa files modified to support -s command line switch
Status: Beta
Brought to you by:
riaan
From: Patrick K. O'B. <po...@or...> - 2001-06-27 22:52:37
|
Attached are three modified files. (I'm pretty sure I started with the latest versions - Boa 0.0.9) The files have been changed to allow the command line switch -s to execute the PYTHONSTARTUP (or BOASTARTUP) script when Boa starts, just like IDLE. The key thing is that the startup scripts need to execute in the shell interpreter's namespace. I borrowed the basic technique from IDLE and modified it to fit the coding conventions used in Boa. These changes were tested with a good startup script as well as one that had an error. Boa loads gracefully in either case and reports the error if there is one. I also tried it with the -D filename debugging option and the startup stuff was ignored. I'm not sure why. I'll leave it up to Riaan to decide if that is appropriate behavior or not. I did NOT test it with the -T option. One difference that I found between my implementation and IDLE's concerns print statements within the startup script. In IDLE, print statements in the startup script appear in the shell itself, whereas in Boa the same print statements appear in the Python console. Again, I'll defer to Riaan on this issue. Here is an example of running Boa with the -s switch: C:\Python21\python.exe C:\Code\boa\Boa.py -s You can also run it from a Windows shortcut or menu (but not from a DOS prompt) with just the following: C:\Code\boa\Boa.py -s If there is a better way to submit patches like this, please let me know. If you think my code sucks, let me know that as well. <grin> --- Patrick K. O'Brien Orbtech "I am, therefore I think." |