Lots of updates at repo - initial rework of command handling

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Lots of updates at repo - initial rework of command handling

Art Haas
Hi.

I'm pleased to say I've come up with what looks to be a good approach in
getting commands working again within PythonCAD. Not all the current
commands have been adjusted yet, but you can type things like 'hcl',
'vcl', 'cir' and other various drawing and editing commands and things
work.

The existing command handling code has relied on code in the 'Generic'
directory executing code in the 'Interface/Gtk' directory. This approach
worked for a while but makes the command handling code interface
specfic. The new approach is interface neutral, a definite plus.
The approach now used is built around the messaging system and, in
particular, the 'tool_changed' message now sent out by an Image class
instance. In short, a Tool instance is placed in an Image via setTool(),
then the 'tool_changed' message is sent out. The interface code then
can receive and handle this message, which is what happens in the
GTKImage class instance.

There are lots of changes to the code in both the 'Generic' and
'Interface/Gtk' directories. If you do an 'svn update' you'll get
all the changes and help me test things out. Look at the 'prompt.py'
file for the valid commands - also look at 'keywords.py' to see
how they can be invoked.

Expect more changes in the next few days as I convert more code to the
new approach and get more commands working again. And, as always, Let
me know of any errors you find.

Art
--
Man once surrendering his reason, has no remaining guard against absurdities
the most monstrous, and like a ship without rudder, is the sport of every wind.

-Thomas Jefferson to James Smith, 1822
_______________________________________________
PythonCAD mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/pythoncad