[PythonCAD] [PATCH] Save and restore autosplitting value in layer.py

Art Haas ahaas at airmail.net
Tue May 23 17:27:53 CEST 2006


On Mon, May 22, 2006 at 05:54:28PM -0500, Art Haas wrote:
> Hi.
> 
> The patch below addresses a problem I found regarding the newly added
> autosplitting code. The issue was that a layer would be set to not
> perform any autosplitting regardless of what the checkbox in the
> Preferences dialog setting.
> 
> By default, autosplitting is off when the program starts unless you
> install the 'prefs.py' file into /etc/pythoncad and set Autosplit
> to True. I'd done that on my development machine, so I didn't see
> this problem until running PythonCAD on another machine where
> the default autosplit value was still False. Now, when an object
> is added to the Layer, the object invokes its setParent() method
> to store the Layer as the parent entity. If the newly added object
> is a Point, the Image instance containing the Layer will call
> the setAutosplit() method of the Layer, and it is at this point
> that things break because the autosplitting state variable the
> Layer examines - self.__asplit in the code below - gets set
> to False and never toggled back to the True value. So, the Layer
> ends up never performing autosplitting.
> [ ... snip ... ]

Hi.

The patch I sent above works, but after thinking about the problem more
I am not certain the approach used in resolving the problem is the right
choice. Unfortunately I don't have a better patch available at the
moment, so it will have to do for now.

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


More information about the PythonCAD mailing list