[PythonCE] HPC:pcceshell.py update

Telion telionce@yahoo.com
Wed, 16 Oct 2002 20:03:12 -0700 (PDT)

I made a few changes in pcceshell.py for HPC.
These are the features I wanted for myself.

# Command history by Ctrl-B, Ctrl-N

By pressing Ctrl-B, previous command will come up.
You can repeat this until you get first command you typed,
or maximum of 30 commands.

This makes using Python much easier.
Instead of tapping screen or going up with arrow key,
Just CTRL-B will bring previously typed commands back,
ready for execution or re-editing.

By pressing Ctrl-N, you can return to newer commands, too.

It works for multiple line command, too. (Not perfect, though)

# Clear Screen by Alt-L

When you have many lines in Screen,
things get slow.
So, I created shortcut key for Clearing Screen, Alt-L.

It slows down because WM_SETREDRAW does not work
(according the comments by Mark?), and
EM_SETSEL, EM_REPLACESEL are done with screen refresh.

I tried some experiments to remedy this, 
but I was not successful, so far...

# Command logging: shell.log() for detail

This version of pcceshell.py takes log of 
every command you executed.
It is stored in sys.prefix+"\\cmdlog.txt"

If you don't want this feature, please comment out
Line 142.
    self.cmdlogname = sys.prefix+r"\cmdlog.txt"

You can change the name and/or location of logfile.
If you name it cmdlog.py, you can import that file as a script.

Type this for more detail.
>>> shell.log() 

# Half of Multiple line re-editing bug fixed

There was a bug that caused first line of multiple line
command to be repeated when re-editing.
I fixed that part of problem.

Yet another convenience feature.

os, sys, win32gui, win32event, and some other modules will be
available without importing them.
This does not affect performance because these modules were
already loaded during PythonCE startup, anyway.
This can be disabled by commenting out line 618.
   slocals.update(sys.modules) # You can use all modules that has been loaded
if you want

Unless I get negative comments, other than log feature and pre-importation
will be turned on by default in next release of HPC2000 version.

I will make PPC version of pcceshell.py with these feature later.
Most probably, I will merge PPC and HPC version together
because I don't want to work twice.

You can down load it from here.

- telionce@yahoo.com -

Do you Yahoo!?
Faith Hill - Exclusive Performances, Videos & More