From sdb at cloud9.net Fri Nov 4 04:37:30 2005 From: sdb at cloud9.net (Stuart Brorson) Date: Thu, 3 Nov 2005 22:37:30 -0500 (EST) Subject: [PythonCAD] Scale? In-Reply-To: <20051027183021.GL27654@artsapartment.org> from "Art Haas" at Oct 27, 2005 01:30:21 PM Message-ID: <20051104033730.093D42AA07@earl-grey.cloud9.net> Hi guys -- I look forward to Art's return since I have a number of things to take up with him. Art, hurry back! One question for now is this: Does PythonCAD have the concept of drawing scale? That is, if I want to create a drawing with 100:1 scale (supposing I want to draw a bridge on 11x17 paper), how do I do that? I haven't seen any way to set the scale via the GUI. However, the code does have variables set aside for the drawing scale. How do I set the scale of my drawing? Thanks, Stuart From ahaas at airmail.net Fri Nov 4 14:07:13 2005 From: ahaas at airmail.net (Art Haas) Date: Fri, 4 Nov 2005 07:07:13 -0600 Subject: [PythonCAD] Scale? In-Reply-To: <20051104033730.093D42AA07@earl-grey.cloud9.net> References: <20051027183021.GL27654@artsapartment.org> <20051104033730.093D42AA07@earl-grey.cloud9.net> Message-ID: <20051104130713.GD21857@artsapartment.org> On Thu, Nov 03, 2005 at 10:37:30PM -0500, Stuart Brorson wrote: > Hi guys -- > > I look forward to Art's return since I have a number of things to take > up with him. Art, hurry back! I'm getting settled into the new place. The last couple of days have been spent unloading boxes and finding homes for dishes, books, etc. It was during this time that the washing machine and car both decided that they needed to become "troublesome". Ugh. Still, probably by the end of this weekend the house will look somewhat organized and I can focus again on PythonCAD. > One question for now is this: Does PythonCAD have the concept of > drawing scale? That is, if I want to create a drawing with 100:1 > scale (supposing I want to draw a bridge on 11x17 paper), how do I do > that? I haven't seen any way to set the scale via the GUI. However, > the code does have variables set aside for the drawing scale. > > How do I set the scale of my drawing? As you note there hasn't been any menu/dialog created to adjust the drawing scale, so by default everything is 1:1. In addition to cooking up a dialog for setting the scale, I'd like to have the scale factor being displayed all the time on the drawing window. 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 From scratchcomputing at gmail.com Fri Nov 4 18:53:21 2005 From: scratchcomputing at gmail.com (Eric Wilhelm) Date: Fri, 4 Nov 2005 09:53:21 -0800 Subject: [PythonCAD] Scale? In-Reply-To: <20051104130713.GD21857@artsapartment.org> References: <20051027183021.GL27654@artsapartment.org> <20051104033730.093D42AA07@earl-grey.cloud9.net> <20051104130713.GD21857@artsapartment.org> Message-ID: <200511040953.21721.ewilhelm@cpan.org> # from Art Haas # on Friday 04 November 2005 05:07 am: >As you note there hasn't been any menu/dialog created to adjust the >drawing scale, so by default everything is 1:1. In addition to cooking >up a dialog for setting the scale, I'd like to have the scale factor >being displayed all the time on the drawing window. Does the scale affect drafting in any way, or does it just control printing? --Eric -- "It is a mistake to allow any mechanical object to realize that you are in a hurry." --Ralph's Observation --------------------------------------------------- http://scratchcomputing.com --------------------------------------------------- From sdb at cloud9.net Sun Nov 6 15:25:54 2005 From: sdb at cloud9.net (Stuart Brorson) Date: Sun, 6 Nov 2005 09:25:54 -0500 (EST) Subject: [PythonCAD] Scale? In-Reply-To: <200511040953.21721.ewilhelm@cpan.org> from "Eric Wilhelm" at Nov 04, 2005 09:53:21 AM Message-ID: <20051106142554.EEDAE2AA07@earl-grey.cloud9.net> > >As you note there hasn't been any menu/dialog created to adjust the > >drawing scale, so by default everything is 1:1. In addition to cooking > >up a dialog for setting the scale, I'd like to have the scale factor > >being displayed all the time on the drawing window. > > Does the scale affect drafting in any way, or does it just control > printing? This is an issue staring with drafting. That is, if I am drawing a bridge whose basic structural objects are large (10s of feet long), then the internal representation of the bridge holds all lines, cicles, etc. in these large units. Then, when I want to print out, I can't because the basic drawing would require thousands of individual sheets of paper tiling the entire drawing. It also means that I can't put into the drawing a detailed view (say) of a subsection of the bridge at a different scale. But that's an advanced feature. . . . . The concept of scale factor *does* exist in the program, I just suspect that it is a feature which isn't fully implemented yet. I would like to fix a few other things first (by sending in patches), and then I don't mind looking at the scale issue. Stuart From john_g at cibolo.com Sun Nov 6 20:14:26 2005 From: john_g at cibolo.com (John Griessen) Date: Sun, 06 Nov 2005 13:14:26 -0600 Subject: [PythonCAD] Scale? In-Reply-To: <20051106142554.EEDAE2AA07@earl-grey.cloud9.net> References: <20051106142554.EEDAE2AA07@earl-grey.cloud9.net> Message-ID: <436E5612.3070505@cibolo.com> Hi, I was just checking the usability of pythoncad for drafting a wall-bed, (tilts into the wall to stow away). I read about a suggestion to make the line thickness 0.01 if the basic dim is inches, and am not getting any response to that pref menu item. It's always as it was on opening a test drawing of a box with dims. Is that a recent breakage? John Griessen geda pcb, gschem, gattrib user Stuart Brorson wrote: I > would like to fix a few other things first (by sending in patches), > and then I don't mind looking at the scale issue. From john_g at cibolo.com Sun Nov 6 20:28:01 2005 From: john_g at cibolo.com (John Griessen) Date: Sun, 06 Nov 2005 13:28:01 -0600 Subject: [PythonCAD] line thickness doesn't change In-Reply-To: <20051106142554.EEDAE2AA07@earl-grey.cloud9.net> References: <20051106142554.EEDAE2AA07@earl-grey.cloud9.net> Message-ID: <436E5941.1050308@cibolo.com> Hi, I was just checking the usability of pythoncad for drafting a wall-bed, (tilts into the wall to stow away). I read about a suggestion to make the line thickness 0.01 if the basic dim is inches, and am not getting any response to that pref menu item. It's always as it was on opening a test drawing of a box with dims. Is that a recent breakage? My pythoncad copy is At revision 2038. John Griessen geda pcb, gschem, gattrib user Stuart Brorson wrote: I > would like to fix a few other things first (by sending in patches), > and then I don't mind looking at the scale issue. -------------- next part -------------- A non-text attachment was scrubbed... Name: test2.xml.gz Type: application/x-gzip Size: 1265 bytes Desc: not available Url : http://mail.python.org/pipermail/pythoncad/attachments/20051106/bfd25b3b/test2.xml.bin From sdb at cloud9.net Mon Nov 7 22:55:02 2005 From: sdb at cloud9.net (Stuart Brorson) Date: Mon, 7 Nov 2005 16:55:02 -0500 (EST) Subject: [PythonCAD] Scale? In-Reply-To: <436E5612.3070505@cibolo.com> from "John Griessen" at Nov 06, 2005 01:14:26 PM Message-ID: <20051107215502.A65102AA08@earl-grey.cloud9.net> > I was just checking the usability of pythoncad for drafting > a wall-bed, (tilts into the wall to stow away). I read about > a suggestion to make the line thickness 0.01 if the basic dim is inches, > and am not getting any response to that pref menu item. It's always > as it was on opening a test drawing of a box with dims. > > Is that a recent breakage? It seems to work for me. I am using the most recent svn version, 2038. There is a little buglet with that pref item: if you type ".01", then the "." char doesn't get typed (or input). However, if you type "0.01", then everything is groovy. I have no idea what's up with that. > John Griessen > geda pcb, gschem, gattrib user ^^^^^^^^^^^^ Excellent!!! Glad to see you in another group, John! Stuart From ahaas at airmail.net Wed Nov 9 01:54:42 2005 From: ahaas at airmail.net (Art Haas) Date: Tue, 8 Nov 2005 18:54:42 -0600 Subject: [PythonCAD] Sorry about no updates recently Message-ID: <20051109005442.GM21857@artsapartment.org> Hi. The move is finished, but I've been busy trying to get the house in order and dealing with other things, so I've not been productive on the PythonCAD front lately. :-( 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 From sdb at cloud9.net Wed Nov 9 02:21:01 2005 From: sdb at cloud9.net (Stuart Brorson) Date: Tue, 8 Nov 2005 20:21:01 -0500 (EST) Subject: [PythonCAD] Sorry about no updates recently In-Reply-To: <20051109005442.GM21857@artsapartment.org> from "Art Haas" at Nov 08, 2005 06:54:42 PM Message-ID: <20051109012101.6CC712AA07@earl-grey.cloud9.net> Hi Art -- I'm glad to hear that you are getting set up again after the tragedy in New Orleans & surrounding area! I haven't done anything with PythonCAD recently either. However, I have a few questions: * Apropos highlighting: In light of our recent back and forth about signal sending and receiving, I have tried to wrap my head around teh signaling system. My question is: when an object is selected and highlighted, who should send the signal, and who should receive it? Also, what's the correct way to send a signal? If I do: foo.send('signal_name', bar) then the object "foo" is emitting the signal, right? But who is "bar"? The intended receiving object? Or is "bar" the emitter? Then what is "foo"? * About the layer model: I would like to fix the key event handling so that when I type a coordinate pair into PythonCAD, then the pair ends up in the entry widget at the bottom of the window. However, right now, if he layer display widget grabs the key events, then it opens up its own entry widget and eats the key press events. I submitted some patches to change this behavior, but they interfered with the layer display widget. Therefore, my question is: What's your vision for how the layer display widget works, and what is it supposed to do when a key is pressed? I'd like to fix this behavior once and for all . . . . Please forgive my ignorance! I am still trying to figure this out. . . . . . Stuart > > Hi. > > The move is finished, but I've been busy trying to get the house in > order and dealing with other things, so I've not been productive on the > PythonCAD front lately. :-( > > 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 > PythonCAD at python.org > http://mail.python.org/mailman/listinfo/pythoncad > From john_g at cibolo.com Wed Nov 9 22:31:46 2005 From: john_g at cibolo.com (John Griessen) Date: Wed, 09 Nov 2005 15:31:46 -0600 Subject: [PythonCAD] noticed some more wants using pycad for a cabinet drawing Message-ID: <43726AC2.8050106@cibolo.com> I have started using the constr. lines and have difficulty removing them. It seems like they are not selected the first try, but then after doing sel, mousepoint, esc., x they are deleted. Is there a unselect function? How about a keyboard shortcut file like many cad programs use? Could it have ways to combine existing functions so I could string together sel and then be pointing the mouse, for example? How about the method of using more than one window open on the same design? Possible with this implementation of window toolkit parts? The use of this is to zoom in to two zones, then make a polygon such as a rect. by clicking corners in each zoomed zone. Thanks, John Griessen From ahaas at airmail.net Thu Nov 10 17:57:41 2005 From: ahaas at airmail.net (Art Haas) Date: Thu, 10 Nov 2005 10:57:41 -0600 Subject: [PythonCAD] Sorry about no updates recently In-Reply-To: <20051109012101.6CC712AA07@earl-grey.cloud9.net> References: <20051109005442.GM21857@artsapartment.org> <20051109012101.6CC712AA07@earl-grey.cloud9.net> Message-ID: <20051110165741.GQ21857@artsapartment.org> On Tue, Nov 08, 2005 at 08:21:01PM -0500, Stuart Brorson wrote: > > * Apropos highlighting: In light of our recent back and forth about > signal sending and receiving, I have tried to wrap my head around teh > signaling system. My question is: when an object is selected and > highlighted, who should send the signal, and who should receive it? > Also, what's the correct way to send a signal? If I do: >> > foo.send('signal_name', bar) > > then the object "foo" is emitting the signal, right? But who is > "bar"? The intended receiving object? Or is "bar" the emitter? Then > what is "foo"? The code currently is set up that the 'selected_object' message is sent by an Image instance. Refer to the selectedObject() method in the 'image.py' file, around lines 1540 or so. The actual sendMessage() call looks like ... self.sendMessage('selected_object', obj) ... where 'self' is the Image instance and 'obj' is the selected object. The patch you'd sent with your selection/deselection work was structured so that the selected object itself would send the 'selected_object' message, so the sendMessage() call would look like ... obj.sendMessage('selected_object') ... where 'obj' is the selected entity. As for which one is right, that cannot be answered as both approaches can work. It is just a matter of picking one approach or the other and coding things. I'm leaning toward my approach as I think it fits in with the message name 'selected_object' better, but if the message name was just 'selected' than your approach would look better. As for sending messages themselves, your example above of with slight modifications looks like this: foo.sendMessage('some_message', bar) So, entity 'foo' is sending out the message 'some_message', and any entity that is listening for 'some_message' will receive argument 'bar' as an argument to the connected method. What is 'bar'? It can be any object you want it to be. An integer, boolean, float, a class instance, etc. There is no restriction on what 'bar' is so long as the code is valid Python code, of course. The sendMessage() method only requires one argument, the message string, and any other arguments are simply passed along to the method specified in the connect() call listening for the message. As for receiving a message, that depends on what you wish to do. Going back to the 'selected_object' message, if we pretend that the code is structured as I'd written it, like ... self.sendMessage('selected_object', obj) ... then I'd guess that initially a GTKImage instance would be listening for 'selected_object' messages. Here's what the handler of this message would start out like: def selectObjectHandler(self, image, *args): _alen = len(args) if _alen < 1: raise ValueError, "Invalid argument count" _obj = args[0] # # 'self' is a GTKImage, and argument 'image' will # be the same instance as 'self', and variable '_obj' # will be the selected object # ... do clever stuff to highlight the object here ... The handler would be specified by a 'connect' call probably in the GTKImage::__init__() method looking like self.connect('selected_object', self.selectObjectHandler) Don't forget there would also be a corresponding method and connect() call for the 'deselected_object' message as well. > * About the layer model: I would like to fix the key event handling > so that when I type a coordinate pair into PythonCAD, then the pair > ends up in the entry widget at the bottom of the window. However, > right now, if he layer display widget grabs the key events, then it > opens up its own entry widget and eats the key press events. > > I submitted some patches to change this behavior, but they interfered > with the layer display widget. Therefore, my question is: What's > your vision for how the layer display widget works, and what is it > supposed to do when a key is pressed? I'd like to fix this behavior > once and for all . . . . This problem is a tough one to fix. I think the way to fix it is to add a 'keypress_event' handler to the gtk.TreeView instance used for showing the layers in the drawing. The gtk.TreeView widget is one of the standard GTK widgets, so there is probably some way of providing a handler that will return 'False' so that the keypress event can be sent to the drawing area and handled there. I don't know the clever code to accomplish this, however, and ideally this clever code would not interfere with the other keyboard selecting and moving features that the TreeView widget offers. I agree 110% that this area needs work. Perhaps someone can recommend a GTK application that has some sample code for study? > Please forgive my ignorance! I am still trying to figure this > out. . . . . . There is nothing to forgive! I'm glad you're looking at the code and wanting to help. Always feel free to e-mail questions and I'll answer them as best as I can. I've not been as prompt as I wish lately due to the move and its after effects ... 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 From ahaas at airmail.net Thu Nov 10 20:59:09 2005 From: ahaas at airmail.net (Art Haas) Date: Thu, 10 Nov 2005 13:59:09 -0600 Subject: [PythonCAD] noticed some more wants using pycad for a cabinet drawing In-Reply-To: <43726AC2.8050106@cibolo.com> References: <43726AC2.8050106@cibolo.com> Message-ID: <20051110195909.GR21857@artsapartment.org> On Wed, Nov 09, 2005 at 03:31:46PM -0600, John Griessen wrote: > I have started using the constr. lines and have difficulty removing them. > It seems like they are not selected the first try, but then after doing sel, > mousepoint, esc., x they are deleted. The problem is a long-standing issue in the user interface. There is no indication that you've selected the entity when you click on it or enclose it within a box, but as you found out when you did +x they were selected and cut. This selection shortcoming has been the focus of some recent patches and discussion, and hopefully the next release of PythonCAD will have addressed this problem. > Is there a unselect function? There is code in the interface neutral part for deselecting a selected entity, but there is unfortunately no menu/mouse code in place for actually doing this task. :-( > How about a keyboard shortcut file like many cad programs use? Could it > have ways to combine existing functions so I could string together > sel and then be pointing the mouse, for example? There are some keyboard shortcuts already in place. I'm not sure what your example above does, however. You want to select something and then point the mouse? > How about the method of using more than one window open on the same design? > Possible with this implementation of window toolkit parts? The use of this > is to zoom in to two zones, then make a polygon such as a rect. by clicking > corners in each zoomed zone. This is something I've wanted to have for a while, and while currently it is not possible to do (or would be extremely kludgy), this ability will be part of PythonCAD. I'd started working on some code to restructure the display of the drawings - look in the gtkshell.py file for the current state of things - and when the switchover from the GTKImage class to the ImageView/ImageDisplay classes happens then there should be the means to display a drawing in various windows, and in each window view distinct regions of a drawing while using all the displayed windows for selections. I'd hoped by now that PythonCAD would have made the switch, but the last couple of months have not been my most productive time. 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 From ahaas at airmail.net Fri Nov 11 17:11:30 2005 From: ahaas at airmail.net (Art Haas) Date: Fri, 11 Nov 2005 10:11:30 -0600 Subject: [PythonCAD] Sample patch for selection highlighting In-Reply-To: <20051110165741.GQ21857@artsapartment.org> References: <20051109005442.GM21857@artsapartment.org> <20051109012101.6CC712AA07@earl-grey.cloud9.net> <20051110165741.GQ21857@artsapartment.org> Message-ID: <20051111161130.GS21857@artsapartment.org> On Thu, Nov 10, 2005 at 10:57:41AM -0600, Art Haas wrote: > On Tue, Nov 08, 2005 at 08:21:01PM -0500, Stuart Brorson wrote: > > > > * Apropos highlighting: In light of our recent back and forth about > > signal sending and receiving, I have tried to wrap my head around teh > > signaling system. My question is: when an object is selected and > > highlighted, who should send the signal, and who should receive it? > > Also, what's the correct way to send a signal? If I do: > > > > foo.send('signal_name', bar) > > > > then the object "foo" is emitting the signal, right? But who is > > "bar"? The intended receiving object? Or is "bar" the emitter? Then > > what is "foo"? > > The code currently is set up that the 'selected_object' message is sent > by an Image instance. Refer to the selectedObject() method in the > 'image.py' file, around lines 1540 or so. The actual sendMessage() call > looks like ... > > self.sendMessage('selected_object', obj) > > ... where 'self' is the Image instance and 'obj' is the selected object. > > The patch you'd sent with your selection/deselection work was structured > so that the selected object itself would send the 'selected_object' > message, so the sendMessage() call would look like ... > > obj.sendMessage('selected_object') > > ... where 'obj' is the selected entity. > > As for which one is right, that cannot be answered as both approaches > can work. It is just a matter of picking one approach or the other and > coding things. I'm leaning toward my approach as I think it fits in > with the message name 'selected_object' better, but if the message name > was just 'selected' than your approach would look better. > > As for sending messages themselves, your example above of with slight > modifications looks like this: > > foo.sendMessage('some_message', bar) > > So, entity 'foo' is sending out the message 'some_message', and any > entity that is listening for 'some_message' will receive argument 'bar' > as an argument to the connected method. What is 'bar'? It can be any > object you want it to be. An integer, boolean, float, a class instance, > etc. There is no restriction on what 'bar' is so long as the code is > valid Python code, of course. The sendMessage() method only requires > one argument, the message string, and any other arguments are simply > passed along to the method specified in the connect() call listening for > the message. > > As for receiving a message, that depends on what you wish to do. Going > back to the 'selected_object' message, if we pretend that the code is > structured as I'd written it, like ... > > self.sendMessage('selected_object', obj) > > ... then I'd guess that initially a GTKImage instance would be listening > for 'selected_object' messages. Here's what the handler of this message > would start out like: > > def selectObjectHandler(self, image, *args): > _alen = len(args) > if _alen < 1: > raise ValueError, "Invalid argument count" > _obj = args[0] > # > # 'self' is a GTKImage, and argument 'image' will > # be the same instance as 'self', and variable '_obj' > # will be the selected object > # > ... do clever stuff to highlight the object here ... > > The handler would be specified by a 'connect' call probably in the > GTKImage::__init__() method looking like > > self.connect('selected_object', self.selectObjectHandler) > > Don't forget there would also be a corresponding method and connect() > call for the 'deselected_object' message as well. Hi. I fiddled around a bit yesterday evening and added the first take at 'clever stuff' to do the highlighting. I've attached my patch below. When an entity is selected, it is redrawn with the color '#ff7733', which is somewhat orangish. This patch is not commited yet, by the way, as I probably don't want to rely on a hardcoded value for the selection color. I think the patch also serves as a nice example of using the messaging system, especially with the recent e-mails regarding the sending and receiving of messages. The 'print' statements in the handlers were just for debugging, so they'll eventually be commented out or turned into print_debug() calls. Also, instead of calling redraw() to show the selection the gtk.DrawingArea method queue_draw() is used, providing a big speedup in that we skip having to query and redraw all the entities in the drawing but simply redisplay the current pixmap. Finally, the tests for visibility ensure that the draw operation is only performed if both the entity and its parent Layer are visible. I'll cook up a deselect patch shortly and fill in this missing piece in dealing with entity selection. Comments? Art Index: PythonCAD/Interface/Gtk/gtkimage.py =================================================================== --- PythonCAD/Interface/Gtk/gtkimage.py (revision 2038) +++ PythonCAD/Interface/Gtk/gtkimage.py (working copy) @@ -441,6 +441,11 @@ self.__tolerance = 1e-10 # + + self.connect('selected_object', self._selectedObject) + self.connect('deselected_object', self._deselectedObject) + + # # set the background color # @@ -457,6 +462,35 @@ super(GTKImage, self).close() self.__window.destroy() + def _selectedObject(self, img, *args): + _alen = len(args) + if _alen < 1: + raise ValueError, "Invalid argument count: %d" % _alen + _obj = args[0] + print "Selected object: " + `_obj` + _parent = _obj.getParent() + if _parent.isVisible() and _obj.isVisible(): + print "Redrawing ..." + _obj.draw(self, self.getOption('BACKGROUND_COLOR')) + self.__da.queue_draw() + _color = Color('#ff7733') + _obj.draw(self, _color) + self.__da.queue_draw() + + def _deselectedObject(self, img, *args): + _alen = len(args) + if _alen < 1: + raise ValueError, "Invalid argument count: %d" % _alen + _obj = args[0] + print "Deselected object: " + `_obj` + _parent = _obj.getParent() + if _parent.isVisible() and _obj.isVisible(): + print "Redrawing ..." + _obj.draw(self, self.getOption('BACKGROUND_COLOR')) + self.__da.queue_draw() + _obj.draw(self) + self.__da.queue_draw() + #------------------------------------------------------------------ def getAccel(self): """Return the gtk.AccelGroup in the GTKImage. -- 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 From sdb at cloud9.net Sat Nov 12 17:29:10 2005 From: sdb at cloud9.net (Stuart Brorson) Date: Sat, 12 Nov 2005 11:29:10 -0500 (EST) Subject: [PythonCAD] Sample patch for selection highlighting In-Reply-To: <20051111161130.GS21857@artsapartment.org> from "Art Haas" at Nov 11, 2005 10:11:30 AM Message-ID: <20051112162910.5212C2AA07@earl-grey.cloud9.net> Art -- > Hi. > > I fiddled around a bit yesterday evening and added the first take at > 'clever stuff' to do the highlighting. I've attached my patch below. > When an entity is selected, it is redrawn with the color '#ff7733', > which is somewhat orangish. This patch is not commited yet, by the way, > as I probably don't want to rely on a hardcoded value for the selection > color. Thanks for the patch and all your explanations! I hope you're settled in your new house now, and the car is fixed! I applied your patch & I like it. I have made some mods so that when you hit it has my prefered behavior: The first just puts you back in "idle" mode, and the second clears the selected objects. I will upload a .diff file with my mods later today. You can then see if you like it. Beyond that, I see no reason to not incorporate the patch into the SVN archive. (Fixing the hardcoded color can happen later, no?) On a different subject: I think I will next fool around with the layer window on the left. I am still unhappy that any keystrokes I make end up opening a pop-up window where they get eaten. A feature of PythonCD which I like very much is taht I can type coordinates into the program instead of being constrained to only using the mouse. Since my old patches to fix this didn't make it into the SVN archive, I want to try getting this feature fully working. But first, I want to preserve your desire to make the layer window work the way you intend. Therefore, my question: What is the preferred behavior of the layer window? I am honestly not that sure about what it is for, and how it should act. . . . . Thanks for taking the time to answer my questions! Stuart From sdb at cloud9.net Sat Nov 12 20:42:27 2005 From: sdb at cloud9.net (Stuart Brorson) Date: Sat, 12 Nov 2005 14:42:27 -0500 (EST) Subject: [PythonCAD] Sample patch for selection highlighting In-Reply-To: <20051111161130.GS21857@artsapartment.org> from "Art Haas" at Nov 11, 2005 10:11:30 AM Message-ID: <20051112194227.976EB2AA07@earl-grey.cloud9.net> Art -- Please find my patch attached. The diff was done against the version in SVN. The patch incorporates your changes as well as my change to the gtkimage:reset fcn. The purpose of the change is to implement my preferred behavior for highlighting when you hit the key. Try it out; maybe you'll like it too. There's also some minor debug changes. You can skip over them if you like. Diff file is small. Stuart Index: PythonCAD/Interface/Gtk/gtkimage.py =================================================================== --- PythonCAD/Interface/Gtk/gtkimage.py (revision 2038) +++ PythonCAD/Interface/Gtk/gtkimage.py (working copy) @@ -53,7 +53,7 @@ # Global variables # -_debug = False ## SDB debug stuff +_debug = True ## SDB debug stuff globals.gtkcolors = {} globals.gtklinetypes = {} @@ -99,8 +99,8 @@ #------------------------------------------------------------------ def window_general_event(widget, event, gtkimage): _type = event.type - debug_print("window_general_event: Event type: %d" % _type) - debug_print("widget: " + `widget`) + # debug_print("window_general_event: Event type: %d" % _type) + # debug_print("widget: " + `widget`) if _type == gtk.gdk.BUTTON_PRESS: _button = event.button debug_print("BUTTON_PRESS: %d" % _button) @@ -441,6 +441,11 @@ self.__tolerance = 1e-10 # + + self.connect('selected_object', self._selectedObject) + self.connect('deselected_object', self._deselectedObject) + + # # set the background color # @@ -458,6 +463,41 @@ self.__window.destroy() #------------------------------------------------------------------ + def _selectedObject(self, img, *args): + _alen = len(args) + if _alen < 1: + raise ValueError, "Invalid argument count: %d" % _alen + _obj = args[0] + if _debug: + print("Selected object: " + `_obj`) + _parent = _obj.getParent() + if _parent.isVisible() and _obj.isVisible(): + if _debug: + print "In _selectedObject . . . .calling obj.draw ..." + _obj.draw(self, self.getOption('BACKGROUND_COLOR')) + self.__da.queue_draw() + _color = Color('#ff7733') + _obj.draw(self, _color) + self.__da.queue_draw() + + #------------------------------------------------------------------ + def _deselectedObject(self, img, *args): + _alen = len(args) + if _alen < 1: + raise ValueError, "Invalid argument count: %d" % _alen + _obj = args[0] + if _debug: + print "Deselected object: " + `_obj` + _parent = _obj.getParent() + if _parent.isVisible() and _obj.isVisible(): + if _debug: + print "In deselectedObject. . . . .calling obj.draw ..." + _obj.draw(self, self.getOption('BACKGROUND_COLOR')) + self.__da.queue_draw() + # _obj.draw(self) + # self.__da.queue_draw() + + #------------------------------------------------------------------ def getAccel(self): """Return the gtk.AccelGroup in the GTKImage. @@ -1007,6 +1047,8 @@ redraw() """ + if _debug: + print ("Entered redraw") _da = self.__da if (_da.flags() & gtk.MAPPED): _xmin = self.__xmin @@ -1060,8 +1102,21 @@ reset() """ + # If __tool is none, deselect any selected objects in view. + # This way, if you are currently using a tool, then the + # first time you hit escape, you just clear the tool. + # The second time clears all selections. + debug_print("Entered reset") + if self.__tool is None: + debug_print(".....This is second time to be in reset") + self.redraw() + _objs = self.getSelectedObjects() + if len(_objs): + for [_layer, _obj] in _objs: + _obj.sendMessage('deselected_object', _obj) + + self.__tool = None - self.redraw() self.setPrompt("Enter command") #------------------------------------------------------------------ From ahaas at airmail.net Mon Nov 14 21:10:17 2005 From: ahaas at airmail.net (Art Haas) Date: Mon, 14 Nov 2005 14:10:17 -0600 Subject: [PythonCAD] Sample patch for selection highlighting In-Reply-To: <20051112194227.976EB2AA07@earl-grey.cloud9.net> References: <20051111161130.GS21857@artsapartment.org> <20051112194227.976EB2AA07@earl-grey.cloud9.net> Message-ID: <20051114201017.GA7171@artsapartment.org> On Sat, Nov 12, 2005 at 02:42:27PM -0500, Stuart Brorson wrote: > Art -- > > Please find my patch attached. The diff was done against the version > in SVN. The patch incorporates your changes as well as my change to > the gtkimage:reset fcn. The purpose of the change is to implement my > preferred behavior for highlighting when you hit the key. > Try it out; maybe you'll like it too. > > There's also some minor debug changes. You can skip over them if you > like. Diff file is small. > [ ... snip patch ... ] I took the diff you provided and used it as a starting point to implement the reset() changes you proposed. In doing this change I made some changes to the getSelectedObjects() and clearSelectedObjects() methods in the Image class, and made a change to the redraw() method in the GTKImage class so that selected entities will be redrawn in the highlighting color. I've commited all these changes to my subversion repo and sent them to the the public repo as well, so if you do an 'svn update' you'll see how things look. I'd still like to make the highlighting color adjustable, but for now using the hardcoded value will work. Thanks again for the patches! The long-standing problem in not displaying selected entities is starting to be fixed. 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 From sdb at cloud9.net Tue Nov 15 17:09:42 2005 From: sdb at cloud9.net (Stuart Brorson) Date: Tue, 15 Nov 2005 11:09:42 -0500 (EST) Subject: [PythonCAD] Sample patch for selection highlighting In-Reply-To: <20051114201017.GA7171@artsapartment.org> from "Art Haas" at Nov 14, 2005 02:10:17 PM Message-ID: <20051115160942.9B0322AA07@earl-grey.cloud9.net> Hi Art -- I just grabbed the latest out of SVN (ver 2041). I like the way it works. Very nice -- thank you! One minor buglet: If I select an individual graphic element (e.g. a segment), selecting works fine. If I do a region select, I don't get the "Click on the items you want to select" message after the region select. That is, I click on the first point in the region, then the prompt says "Click on another point to select the region". Then when I click on teh second point to close the region select, the prompt still says "Click on another point to select the region". I attach a very minor patch below to fix this problem. One issue with this is that the different prompt messages get set all over the place, which might lead to confusion. However, it is part of the way the program is architected, in that different callbacks are invoked depending upon whether you've entered the first, second, or whatever click. Not a big enough issue ot be a showstopper, IMO. Finally, I am still interesting in hearing your thoughts about the layer window on the left. In particular, how should it behave? I really want to fix this issue with entering corrdinates into the entry box at the bottom of the top level window, and understanding how the layer window is supposed to behave will help me figure out how to fix it. Stuart Index: PythonCAD/Interface/Gtk/gtkedit.py =================================================================== --- PythonCAD/Interface/Gtk/gtkedit.py (revision 2041) +++ PythonCAD/Interface/Gtk/gtkedit.py (working copy) @@ -58,6 +58,7 @@ if len(_objs): for _obj in _objs: gtkimage.selectObject(_obj) + gtkimage.setPrompt("Click on the items you want to select.") select_mode_init(tool) def select_motion_notify(gtkimage, widget, event, tool): From ahaas at airmail.net Tue Nov 15 17:39:40 2005 From: ahaas at airmail.net (Art Haas) Date: Tue, 15 Nov 2005 10:39:40 -0600 Subject: [PythonCAD] Sample patch for selection highlighting In-Reply-To: <20051115160942.9B0322AA07@earl-grey.cloud9.net> References: <20051114201017.GA7171@artsapartment.org> <20051115160942.9B0322AA07@earl-grey.cloud9.net> Message-ID: <20051115163940.GG7171@artsapartment.org> On Tue, Nov 15, 2005 at 11:09:42AM -0500, Stuart Brorson wrote: > Hi Art -- > > I just grabbed the latest out of SVN (ver 2041). I like the way it > works. Very nice -- thank you! Glad to know it works for you and you like it. > One minor buglet: If I select an individual graphic element (e.g. a > segment), selecting works fine. If I do a region select, I don't get > the "Click on the items you want to select" message after the region > select. That is, I click on the first > point in the region, then the prompt says "Click on another point to > select the region". Then when I click on teh second point to close > the region select, the prompt still says "Click on another point to > select the region". > > I attach a very minor patch below to fix this problem. I've applied it. Thanks. I've also made some other changes that have made their way to the public repo, so doing an 'svn update' will get those adjustments as well. > One issue with this is that the different prompt messages get set all > over the place, which might lead to confusion. However, it is part of > the way the program is architected, in that different callbacks are > invoked depending upon whether you've entered the first, second, or > whatever click. Not a big enough issue ot be a showstopper, IMO. A long-term goal is to make things consistent, and setting the prompt after some action will need tinkering. > Finally, I am still interesting in hearing your thoughts about the > layer window on the left. In particular, how should it behave? I > really want to fix this issue with entering corrdinates into the entry > box at the bottom of the top level window, and understanding how the > layer window is supposed to behave will help me figure out how to fix > it. The layer display should allow you to use the arrow keys to select which layer is active, as well as selecting the active layer by typing it. Also, when using the arrow keys, pressing the 'shift' key allows you to collapse or expand the displayed layer list. All these features came "free" because the display is built using the gtk.TreeView and gtk.TreeStore widgets. To fix things so that all the functionality above remains while adding the ability to type in a coordinate pair will probably involve adding a keypress_event handler to the gtk.TreeView instance in the LayerDisplay class (see gtkshell.py). The handler needs to do some sort of processing on what the user types and either let the TreeView accept the keystroke or bail out. If we bail out, then the 'window_general_event' handler in the GTKImage class will be called, and we can add some code there to try and parse what has been typed and turn it into coordinates. How we accomplish these tasks I don't know right now. I'd suggest reading up on the TreeView and TreeModel widgets for starters, and also try to find a program that uses these widgets and has a 'keypress_event' handler that we can examine. 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 From sdb at cloud9.net Tue Nov 15 18:22:47 2005 From: sdb at cloud9.net (Stuart Brorson) Date: Tue, 15 Nov 2005 12:22:47 -0500 (EST) Subject: [PythonCAD] Sample patch for selection highlighting In-Reply-To: <20051115163940.GG7171@artsapartment.org> from "Art Haas" at Nov 15, 2005 10:39:40 AM Message-ID: <20051115172247.755422AA07@earl-grey.cloud9.net> Art -- > The layer display should allow you to use the arrow keys to select which > layer is active, as well as selecting the active layer by typing it. > Also, when using the arrow keys, pressing the 'shift' key allows you to > collapse or expand the displayed layer list. All these features came > "free" because the display is built using the gtk.TreeView and > gtk.TreeStore widgets. Ok, I just added a couple of child layers to a drawing and tried this out. Yes, the arrow keys do move the selected layer up and down, and I can also type in the name of the layer I want to select & it gets selected. Some questions/issues: * Drawing in a new layer seems to draw only white. The nice yellow color which I am used to is not drawn. All new layers only draw white. Is this the desired behavior? * The new layer doesn't inherit the line width of the parent layer. Any ideas about how to fix that? I guess I can look at it myself. . . . * I can add children to "top layer" , but I can't add a layer at the same level. From a philosophical perspective, what does this imply about the top layer's role in a drawing? I guess I am confused about why one would have hierarchical layers, unless it's to draw the leaders and notes to a drawing on a child layer. But why aren't multiple top layers possible (i.e. different drawings of different components in a single file)? Stuart From ahaas at airmail.net Tue Nov 15 20:04:04 2005 From: ahaas at airmail.net (Art Haas) Date: Tue, 15 Nov 2005 13:04:04 -0600 Subject: [PythonCAD] Sample patch for selection highlighting In-Reply-To: <20051115172247.755422AA07@earl-grey.cloud9.net> References: <20051115163940.GG7171@artsapartment.org> <20051115172247.755422AA07@earl-grey.cloud9.net> Message-ID: <20051115190404.GJ7171@artsapartment.org> On Tue, Nov 15, 2005 at 12:22:47PM -0500, Stuart Brorson wrote: > Some questions/issues: > > * Drawing in a new layer seems to draw only white. The nice yellow > color which I am used to is not drawn. All new layers only draw > white. Is this the desired behavior? When you switch from one layer to another the current drawing style, color, linetype, and thickness should not change, so if you are drawing yellow lines in one layer, then create a new layer, you should get yellow lines in it as well. > * The new layer doesn't inherit the line width of the parent layer. > Any ideas about how to fix that? I guess I can look at it > myself. . . . The line thickness should not change when you add a new layer. Again, I'll take a look-see and see if something is going on. > * I can add children to "top layer" , but I can't add a layer at the > same level. From a philosophical perspective, what does this imply > about the top layer's role in a drawing? I guess I am confused about > why one would have hierarchical layers, unless it's to draw the > leaders and notes to a drawing on a child layer. But why aren't > multiple top layers possible (i.e. different drawings of different > components in a single file)? The way to think about it is analagous to the unix file system. The top level of a drawing is the '/' directory, and you can have any number of sublayers below it just like there can be lots of subdirectories below '/', ad infinitum. To me this arrangement makes sense. When I used AutoCAD many years ago that program allowed numerous layers in a drawing, but the layers were not arranged in a hierarchy, just in a sequence. After using AutoCAD I worked at a company that used ME-10, and it offered the hierarchical arrangement to nest layers, which they called 'parts'. I found that setup more flexible and useful than what I could do with AutoCAD, so I implemented PythonCAD to be similar to ME-10. The drawings in ME-10 were often structured so that certain features or views were in one layer/part, and the top level of the drawing was named after the particular part-number of the piece in the drawing. This approach worked well, and allowed a lot of flexibility. 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 From ahaas at airmail.net Wed Nov 16 17:43:17 2005 From: ahaas at airmail.net (Art Haas) Date: Wed, 16 Nov 2005 10:43:17 -0600 Subject: [PythonCAD] Recent updates to the repo Message-ID: <20051116164317.GO7171@artsapartment.org> Hi. There have been a few updates to the repo lately, the biggest is the work in highlighting selected entities. If you've been following some of the recent threads regarding this issue then you would have seen that the code has been commited into my subversion repo and sent out. A couple of other small changes lately have resulted from the selection work - a reworking of the Image class storage and retrieval of the selected objects in an image, a rework of the global Selection class so it utilizes the parent/child relationship between entities, layers, and Images, and also a nice fix regarding the undo/redo operations when an entity style is changed. 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 From pierre.vaudrey at gmail.com Mon Nov 21 14:10:11 2005 From: pierre.vaudrey at gmail.com (Pierre Vaudrey) Date: Mon, 21 Nov 2005 14:10:11 +0100 Subject: [PythonCAD] PythonCAD on OS X 10.4.3 Message-ID: <22E5047E-1282-4CCB-89A4-42C12BBA9B31@gmail.com> I'm trying to run PythonCAD from subversion on OS X 10.4.3 with python 2.4.1 and PyObjC 1.3.7. After installing : powerbook-g4-de-pierre-vaudrey:~/Documents/pythonCAD pierreva$ sudo python setup.py install and building : powerbook-g4-de-pierre-vaudrey:~/Documents/pythonCAD pierreva$ python buildapp.py --semi-standalone build Finding module dependencies Building 'build/PythonCad.app' Copying files Adding Python modules Warning: couldn't find the following submodules: (Note that these could be false alarms -- it's not always possible to distinguish between "from package import submodule" and "from package import name") ? AppKit.NSApplication ? AppKit.NSCancelButton ? AppKit.NSChangeDone ? AppKit.NSDocumentController ? AppKit.NSFontManager ? AppKit.NSItalicFontMask ? AppKit.NSMenu ? AppKit.NSMenuItem ? AppKit.NSOKButton ? AppKit.NSOutlineView ? AppKit.NSPanel ? AppKit.NSSavePanel ? AppKit.NSShiftKeyMask ? AppKit.NSTextView ? AppKit.NSWindowController ? ExceptionHandling.NSExceptionHandler ? ExceptionHandling.NSLogUncaughtExceptionMask ? ExceptionHandling.NSStackTraceKey ? Foundation.NSBundle ? Foundation.NSDictionary ? Foundation.NSLog ? Foundation.NSMakePoint ? Foundation.NSMakeRect ? Foundation.NSMakeSize ? Foundation.NSNotFound ? Foundation.NSNotification ? Foundation.NSNotificationCenter ? Foundation.NSNotificationNoCoalescing ? Foundation.NSNotificationQueue ? Foundation.NSObject ? Foundation.NSPostASAP ? Foundation.NSPostWhenIdle ? Foundation.NSString ? objc.setSignatureForSelector Warning: couldn't find the following modules: ? OverrideFrom23._Res ? SOCKS ? _dummy_threading ? _emx_link ? _xmlplus ? java.lang ? msvcrt ? os.path ? rourl2path Done. and running the application : Traceback (most recent call last): File "/Applications/PythonCad.app/Contents/Resources/ PythonCad.py", line 45, in ? import PythonCAD.Interface.Cocoa.ImageDocument File "/Users/pierreva/Documents/pythonCAD/build/PythonCad.app/ Contents/Resources/PythonCAD/Interface/Cocoa/ImageDocument.py", line 38, in ? File "/Users/pierreva/Documents/pythonCAD/build/PythonCad.app/ Contents/Resources/PythonCAD/Interface/Cocoa/ ImageWindowController.py", line 31, in ? File "/Users/pierreva/Documents/pythonCAD/build/PythonCad.app/ Contents/Resources/PythonCAD/Interface/Cocoa/AppController.py", line 28, in ? File "/Users/pierreva/Documents/pythonCAD/build/PythonCad.app/ Contents/Resources/PythonCAD/Interface/Cocoa/CocoaConobjs.py", line 26, in ? File "/Users/pierreva/Documents/pythonCAD/build/PythonCad.app/ Contents/Resources/PythonCAD/Interface/Cocoa/CocoaEntities.py", line 29, in ? ImportError: cannot import name ImageDocument I cannot understand what I'm doing wrong ? Thanks for your help. Pierre From ahaas at airmail.net Mon Nov 21 14:27:35 2005 From: ahaas at airmail.net (Art Haas) Date: Mon, 21 Nov 2005 07:27:35 -0600 Subject: [PythonCAD] PythonCAD on OS X 10.4.3 In-Reply-To: <22E5047E-1282-4CCB-89A4-42C12BBA9B31@gmail.com> References: <22E5047E-1282-4CCB-89A4-42C12BBA9B31@gmail.com> Message-ID: <20051121132735.GA29129@artsapartment.org> On Mon, Nov 21, 2005 at 02:10:11PM +0100, Pierre Vaudrey wrote: > I'm trying to run PythonCAD from subversion on OS X 10.4.3 with > python 2.4.1 and PyObjC 1.3.7. > > After installing : > > powerbook-g4-de-pierre-vaudrey:~/Documents/pythonCAD pierreva$ sudo > python setup.py install > > and building : > > powerbook-g4-de-pierre-vaudrey:~/Documents/pythonCAD pierreva$ python > buildapp.py --semi-standalone build > Finding module dependencies > Building 'build/PythonCad.app' > Copying files > Adding Python modules > Warning: couldn't find the following submodules: > (Note that these could be false alarms -- it's not always > possible to distinguish between "from package import submodule" > and "from package import name") > ? AppKit.NSApplication > ? AppKit.NSCancelButton > ? AppKit.NSChangeDone > ? AppKit.NSDocumentController > ? AppKit.NSFontManager > ? AppKit.NSItalicFontMask > ? AppKit.NSMenu > ? AppKit.NSMenuItem > ? AppKit.NSOKButton > ? AppKit.NSOutlineView > ? AppKit.NSPanel > ? AppKit.NSSavePanel > ? AppKit.NSShiftKeyMask > ? AppKit.NSTextView > ? AppKit.NSWindowController > ? ExceptionHandling.NSExceptionHandler > ? ExceptionHandling.NSLogUncaughtExceptionMask > ? ExceptionHandling.NSStackTraceKey > ? Foundation.NSBundle > ? Foundation.NSDictionary > ? Foundation.NSLog > ? Foundation.NSMakePoint > ? Foundation.NSMakeRect > ? Foundation.NSMakeSize > ? Foundation.NSNotFound > ? Foundation.NSNotification > ? Foundation.NSNotificationCenter > ? Foundation.NSNotificationNoCoalescing > ? Foundation.NSNotificationQueue > ? Foundation.NSObject > ? Foundation.NSPostASAP > ? Foundation.NSPostWhenIdle > ? Foundation.NSString > ? objc.setSignatureForSelector > Warning: couldn't find the following modules: > ? OverrideFrom23._Res > ? SOCKS > ? _dummy_threading > ? _emx_link > ? _xmlplus > ? java.lang > ? msvcrt > ? os.path > ? rourl2path > Done. > > and running the application : > > Traceback (most recent call last): > File "/Applications/PythonCad.app/Contents/Resources/ > PythonCad.py", line 45, in ? > import PythonCAD.Interface.Cocoa.ImageDocument > File "/Users/pierreva/Documents/pythonCAD/build/PythonCad.app/ > Contents/Resources/PythonCAD/Interface/Cocoa/ImageDocument.py", line > 38, in ? > File "/Users/pierreva/Documents/pythonCAD/build/PythonCad.app/ > Contents/Resources/PythonCAD/Interface/Cocoa/ > ImageWindowController.py", line 31, in ? > File "/Users/pierreva/Documents/pythonCAD/build/PythonCad.app/ > Contents/Resources/PythonCAD/Interface/Cocoa/AppController.py", line > 28, in ? > File "/Users/pierreva/Documents/pythonCAD/build/PythonCad.app/ > Contents/Resources/PythonCAD/Interface/Cocoa/CocoaConobjs.py", line > 26, in ? > File "/Users/pierreva/Documents/pythonCAD/build/PythonCad.app/ > Contents/Resources/PythonCAD/Interface/Cocoa/CocoaEntities.py", line > 29, in ? > ImportError: cannot import name ImageDocument > > I cannot understand what I'm doing wrong ? Hi. You're probably doing nothing wrong. Instead the problem is that PythonCAD needs some work to get it to run on OS X/PyObjC again. About nine or ten releases ago there was someone working on making PythonCAD run there, and for a while it did work, but he was unable to continue his work, so things stopped working. I don't have an OS X machine to try and revive things, though I did take a shot at it but my efforts didn't work. Would you be interested in trying to get things working again under PyObjC? I can describe some of what will be involve in getting the port to work again. 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 From pierre.vaudrey at gmail.com Mon Nov 21 17:03:37 2005 From: pierre.vaudrey at gmail.com (Pierre Vaudrey) Date: Mon, 21 Nov 2005 17:03:37 +0100 Subject: [PythonCAD] PythonCAD on OS X 10.4.3 In-Reply-To: <20051121132735.GA29129@artsapartment.org> References: <22E5047E-1282-4CCB-89A4-42C12BBA9B31@gmail.com> <20051121132735.GA29129@artsapartment.org> Message-ID: Art, Le 21 nov. 05 ? 14:27, Art Haas a ?crit : > Would you be interested in trying to get things working again under > PyObjC? I accept to try, but I'm not an expert neither in python nor in cocoa ! > I can describe some of what will be involve in getting the port > to work again. I wait for your information. Pierre From ahaas at airmail.net Tue Nov 22 02:55:41 2005 From: ahaas at airmail.net (Art Haas) Date: Mon, 21 Nov 2005 19:55:41 -0600 Subject: [PythonCAD] PythonCAD on OS X 10.4.3 In-Reply-To: References: <22E5047E-1282-4CCB-89A4-42C12BBA9B31@gmail.com> <20051121132735.GA29129@artsapartment.org> Message-ID: <20051122015541.GB29129@artsapartment.org> On Mon, Nov 21, 2005 at 05:03:37PM +0100, Pierre Vaudrey wrote: > Art, > > Le 21 nov. 05 ? 14:27, Art Haas a ?crit : > > >Would you be interested in trying to get things working again under > > PyObjC? > I accept to try, but I'm not an expert neither in python nor in cocoa ! > > I can describe some of what will be involve in getting the port > > to work again. > I wait for your information. Great! The first thing that needs to be done is to adjust all the 'import' statements. They need to look something like one of the following formats ... import PythonCAD.Generic.foo or from PythonCAD.Generic import foo Replace 'foo' above with the appropriate module, i.e point, segment, etc. Part of the reason the PyObjC port broke was the PythonCAD files were moved into a 'PythonCAD' subdirectory. This move was done to make PythonCAD be a better neighbor with other Python software that a user could install, such as Zope. By moving the files into a 'PythonCAD' subdirectory, the likelyhood of accidentally bringing in a PythonCAD module went down to essentially zero. Once all the 'import' statements have been adjusted, the next step will be fixing up the connect() messages so the PyObjC front-end will be correctly tied into the interface neutral back end. Let me know when you can start trying that and I'll explain what needs to be done. Thanks for looking at the Cocoa/PyObjC front end! Art Haas -- 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 From pierre.vaudrey at gmail.com Tue Nov 22 17:11:59 2005 From: pierre.vaudrey at gmail.com (Pierre Vaudrey) Date: Tue, 22 Nov 2005 17:11:59 +0100 Subject: [PythonCAD] PythonCAD on OS X 10.4.3 In-Reply-To: <20051122015541.GB29129@artsapartment.org> References: <22E5047E-1282-4CCB-89A4-42C12BBA9B31@gmail.com> <20051121132735.GA29129@artsapartment.org> <20051122015541.GB29129@artsapartment.org> Message-ID: <3585BB3D-5947-435B-99D7-8DFC33D4A0F8@gmail.com> Art, Le 22 nov. 05 ? 02:55, Art Haas a ?crit : > The first thing that needs to be done is to adjust all the 'import' > statements. They need to look something like one of the following > formats ... I understand the work to adjust all the 'import' statements. But before I start, I would agree with you on a method of notification of the changes i've made : have you the possibility to let me use a branch in Subversion ? In this case I need somme training because i've used it only for downloading files. Is the work of the second step, work with Interface Builder ? I'll have some time in the next days, so you can you can send me information on both steps. Pierre From ahaas at airmail.net Tue Nov 22 21:25:52 2005 From: ahaas at airmail.net (Art Haas) Date: Tue, 22 Nov 2005 14:25:52 -0600 Subject: [PythonCAD] PythonCAD on OS X 10.4.3 In-Reply-To: <3585BB3D-5947-435B-99D7-8DFC33D4A0F8@gmail.com> References: <22E5047E-1282-4CCB-89A4-42C12BBA9B31@gmail.com> <20051121132735.GA29129@artsapartment.org> <20051122015541.GB29129@artsapartment.org> <3585BB3D-5947-435B-99D7-8DFC33D4A0F8@gmail.com> Message-ID: <20051122202552.GC29129@artsapartment.org> On Tue, Nov 22, 2005 at 05:11:59PM +0100, Pierre Vaudrey wrote: > Art, > > Le 22 nov. 05 ? 02:55, Art Haas a ?crit : > > >The first thing that needs to be done is to adjust all the 'import' > >statements. They need to look something like one of the following > >formats ... > > I understand the work to adjust all the 'import' statements. But > before I start, I would agree with you on a method of notification of > the changes i've made : have you the possibility to let me use a > branch in Subversion ? In this case I need somme training because > i've used it only for downloading files. I don't think we need to worry about you working on a branch, as to my knowledge there is no one else involved in the Cocoa/PyObjC code at this time. As long as the changes you make are solely within the PythonCAD/Interface/Cocoa directory, you can simply send me your changes and I'll apply them. Then, after I apply them, I'll copy my local subversion repo, the one with your changes, to the public repo, and you can update your repository by running 'svn update'. How about you make some small change to one of the files in the Cocoa subdirectory, then send me the diff. Lets use the 'ImageDocument.py' file as our testcase. Just make a small change to it, then run $ svn diff PythonCAD/Interface/Cocoa/ImageDocument.py > filename Mail me the diff in 'filename' and I'll apply it, push the change out to the public repo, then you can do an 'svn update' and we'll see how smart subversion is when it performs the update. > Is the work of the second step, work with Interface Builder ? > I'll have some time in the next days, so you can you can send me > information on both steps. I suspect the second step is going to be just getting a Cocoa window to pop up on your screen. When all the 'import' statements are correct, and any various 'import' statements regarding the PyObjC code are fixed, we'll work on getting a window to appear. After that we'll start working on getting the entities to draw, working on menus, etc. I don't know what is involved with the InterfaceBuilder. If I had an machine running OS X I think I would have been able to keep the Cocoa front-end working somewhat. 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 From pierre.vaudrey at gmail.com Wed Nov 23 14:36:34 2005 From: pierre.vaudrey at gmail.com (Pierre Vaudrey) Date: Wed, 23 Nov 2005 14:36:34 +0100 Subject: [PythonCAD] PythonCAD on OS X 10.4.3 In-Reply-To: <20051122202552.GC29129@artsapartment.org> References: <22E5047E-1282-4CCB-89A4-42C12BBA9B31@gmail.com> <20051121132735.GA29129@artsapartment.org> <20051122015541.GB29129@artsapartment.org> <3585BB3D-5947-435B-99D7-8DFC33D4A0F8@gmail.com> <20051122202552.GC29129@artsapartment.org> Message-ID: Art, Le 22 nov. 05 ? 21:25, Art Haas a ?crit : > Mail me the diff in 'filename' and I'll apply it, push the change out > to the public repo, then you can do an 'svn update' and we'll see how > smart subversion is when it performs the update. Please find attached a first import adjustment : -------------- next part -------------- A non-text attachment was scrubbed... Name: ImageDocumentDiff.py Type: text/x-python-script Size: 902 bytes Desc: not available Url : http://mail.python.org/pipermail/pythoncad/attachments/20051123/1af8c9a7/ImageDocumentDiff.bin -------------- next part -------------- Pierre From ahaas at airmail.net Wed Nov 23 19:10:32 2005 From: ahaas at airmail.net (Art Haas) Date: Wed, 23 Nov 2005 12:10:32 -0600 Subject: [PythonCAD] PythonCAD on OS X 10.4.3 In-Reply-To: References: <22E5047E-1282-4CCB-89A4-42C12BBA9B31@gmail.com> <20051121132735.GA29129@artsapartment.org> <20051122015541.GB29129@artsapartment.org> <3585BB3D-5947-435B-99D7-8DFC33D4A0F8@gmail.com> <20051122202552.GC29129@artsapartment.org> Message-ID: <20051123181032.GE29129@artsapartment.org> On Wed, Nov 23, 2005 at 02:36:34PM +0100, Pierre Vaudrey wrote: > Art, > > Le 22 nov. 05 ? 21:25, Art Haas a ?crit : > > >Mail me the diff in 'filename' and I'll apply it, push the change out > >to the public repo, then you can do an 'svn update' and we'll see how > >smart subversion is when it performs the update. > Please find attached a first import adjustment : [ ... snip ... ] Patch applied, and the public repo has been updated. Try 'svn update' and see what subversion does. Thanks! Art Haas -- 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 From pierre.vaudrey at gmail.com Wed Nov 23 22:59:39 2005 From: pierre.vaudrey at gmail.com (Pierre Vaudrey) Date: Wed, 23 Nov 2005 22:59:39 +0100 Subject: [PythonCAD] PythonCAD on OS X 10.4.3 In-Reply-To: <20051123181032.GE29129@artsapartment.org> References: <22E5047E-1282-4CCB-89A4-42C12BBA9B31@gmail.com> <20051121132735.GA29129@artsapartment.org> <20051122015541.GB29129@artsapartment.org> <3585BB3D-5947-435B-99D7-8DFC33D4A0F8@gmail.com> <20051122202552.GC29129@artsapartment.org> <20051123181032.GE29129@artsapartment.org> Message-ID: Le 23 nov. 05 ? 19:10, Art Haas a ?crit : > Try 'svn update' > and see what subversion does. after svn update find attached new import adjustments : -------------- next part -------------- A non-text attachment was scrubbed... Name: ImageWindowControllerDiff.py Type: text/x-python-script Size: 1028 bytes Desc: not available Url : http://mail.python.org/pipermail/pythoncad/attachments/20051123/aaf82d81/ImageWindowControllerDiff.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: AppControllerDiff.py Type: text/x-python-script Size: 1105 bytes Desc: not available Url : http://mail.python.org/pipermail/pythoncad/attachments/20051123/aaf82d81/AppControllerDiff.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: CocoaConobjsDiff.py Type: text/x-python-script Size: 552 bytes Desc: not available Url : http://mail.python.org/pipermail/pythoncad/attachments/20051123/aaf82d81/CocoaConobjsDiff.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: CocoaEntitiesDiff.py Type: text/x-python-script Size: 628 bytes Desc: not available Url : http://mail.python.org/pipermail/pythoncad/attachments/20051123/aaf82d81/CocoaEntitiesDiff.bin -------------- next part -------------- with the following result at running : Traceback (most recent call last): File "/Users/pierreva/Documents/pythoncad2/build/PythonCad.app/ Contents/Resources/PythonCad.py", line 45, in ? import PythonCAD.Interface.Cocoa.ImageDocument File "/Users/pierreva/Documents/pythoncad2/build/PythonCad.app/ Contents/Resources/PythonCAD/Interface/Cocoa/ImageDocument.py", line 40, in ? import PythonCAD.Interface.Cocoa.ImageWindowController File "/Users/pierreva/Documents/pythoncad2/build/PythonCad.app/ Contents/Resources/PythonCAD/Interface/Cocoa/ ImageWindowController.py", line 31, in ? import PythonCAD.Interface.Cocoa.AppController File "/Users/pierreva/Documents/pythoncad2/build/PythonCad.app/ Contents/Resources/PythonCAD/Interface/Cocoa/AppController.py", line 28, in ? import PythonCAD.Interface.Cocoa.CocoaConobjs File "/Users/pierreva/Documents/pythoncad2/build/PythonCad.app/ Contents/Resources/PythonCAD/Interface/Cocoa/CocoaConobjs.py", line 26, in ? import PythonCAD.Interface.Cocoa.CocoaEntities File "/Users/pierreva/Documents/pythoncad2/build/PythonCad.app/ Contents/Resources/PythonCAD/Interface/Cocoa/CocoaEntities.py", line 80, in ? Globals.s = None NameError: name 'Globals' is not defined Pierre From ahaas at airmail.net Thu Nov 24 14:51:51 2005 From: ahaas at airmail.net (Art Haas) Date: Thu, 24 Nov 2005 07:51:51 -0600 Subject: [PythonCAD] PythonCAD on OS X 10.4.3 In-Reply-To: References: <22E5047E-1282-4CCB-89A4-42C12BBA9B31@gmail.com> <20051121132735.GA29129@artsapartment.org> <20051122015541.GB29129@artsapartment.org> <3585BB3D-5947-435B-99D7-8DFC33D4A0F8@gmail.com> <20051122202552.GC29129@artsapartment.org> <20051123181032.GE29129@artsapartment.org> Message-ID: <20051124135151.GH29129@artsapartment.org> On Wed, Nov 23, 2005 at 10:59:39PM +0100, Pierre Vaudrey wrote: > > Le 23 nov. 05 ? 19:10, Art Haas a ?crit : > > >Try 'svn update' > >and see what subversion does. > after svn update find attached new import adjustments : > [ ... snip ... ] I've applied all these patches. Thanks! > with the following result at running : > > Traceback (most recent call last): > [ ... snip ... ] > File "/Users/pierreva/Documents/pythoncad2/build/PythonCad.app/ > Contents/Resources/PythonCAD/Interface/Cocoa/CocoaEntities.py", line > 80, in ? > Globals.s = None > NameError: name 'Globals' is not defined As you've changed the import statement to this form ... import PythonCAD.Interface.Cocoa.Globals ... the 'Globals' variables now need to be referenced with the complete path. So, the error above would be fixed by changing that line to ... PythonCAD.Interface.Cocoa.Globals.s = None That is a lot of typing, so it may be better to again adjust the 'import' statments to look like this ... from PythonCAD.Interface.Cocoa import Globals Using the 'from' style of module importing allows for shorter module references in the code, so the 'Globals.s' line above would be valid. Art Haas -- 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 From pierre.vaudrey at gmail.com Thu Nov 24 18:38:28 2005 From: pierre.vaudrey at gmail.com (Pierre Vaudrey) Date: Thu, 24 Nov 2005 18:38:28 +0100 Subject: [PythonCAD] PythonCAD on OS X 10.4.3 In-Reply-To: <20051124135151.GH29129@artsapartment.org> References: <22E5047E-1282-4CCB-89A4-42C12BBA9B31@gmail.com> <20051121132735.GA29129@artsapartment.org> <20051122015541.GB29129@artsapartment.org> <3585BB3D-5947-435B-99D7-8DFC33D4A0F8@gmail.com> <20051122202552.GC29129@artsapartment.org> <20051123181032.GE29129@artsapartment.org> <20051124135151.GH29129@artsapartment.org> Message-ID: Art, Le 24 nov. 05 ? 14:51, Art Haas a ?crit : > That is a lot of typing, so it may be better to again adjust the > 'import' statments to look like this ... > > from PythonCAD.Interface.Cocoa import Globals agreed : -------------- next part -------------- A non-text attachment was scrubbed... Name: CocoaEntitiesDiff.py Type: text/x-python-script Size: 400 bytes Desc: not available Url : http://mail.python.org/pipermail/pythoncad/attachments/20051124/b9ea709c/CocoaEntitiesDiff.bin -------------- next part -------------- but above rule was not applied in PythonCad.py -------------- next part -------------- A non-text attachment was scrubbed... Name: PythonCadDiff.py Type: text/x-python-script Size: 1458 bytes Desc: not available Url : http://mail.python.org/pipermail/pythoncad/attachments/20051124/b9ea709c/PythonCadDiff.bin -------------- next part -------------- Application is now running with the following exception : 2005-11-24 18:24:09.624 PythonCad[1684] An exception has occured: Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ python2.4/site-packages/PyObjC/PyObjCTools/AppHelper.py", line 235, in runEventLoop main(argv) File "/Users/pierreva/Documents/pythoncad2/build/PythonCad.app/ Contents/Resources/PythonCAD/Interface/Cocoa/ImageDocument.py", line 157, in init self.setImage(PythonCAD.Generic.image.Image()) File "/Users/pierreva/Documents/pythoncad2/build/PythonCad.app/ Contents/Resources/PythonCAD/Generic/image.py", line 148, in __init__ add_defaults(self) File "/Users/pierreva/Documents/pythoncad2/build/PythonCad.app/ Contents/Resources/PythonCAD/Generic/image.py", line 2076, in add_defaults image.setOption('DIM_STYLE', _ds) File "/Users/pierreva/Documents/pythoncad2/build/PythonCad.app/ Contents/Resources/PythonCAD/Generic/image.py", line 1715, in setOption if value != _gval: _set = True File "/Users/pierreva/Documents/pythoncad2/build/PythonCad.app/ Contents/Resources/PythonCAD/Generic/dimension.py", line 2280, in __ne__ return not self == obj File "/Users/pierreva/Documents/pythoncad2/build/PythonCad.app/ Contents/Resources/PythonCAD/Generic/dimension.py", line 2256, in __eq__ if ((_key == 'DIM_PRIMARY_TEXT_SIZE') or TypeError: 'bool' object is not callable Pierre From ahaas at airmail.net Fri Nov 25 22:12:07 2005 From: ahaas at airmail.net (Art Haas) Date: Fri, 25 Nov 2005 15:12:07 -0600 Subject: [PythonCAD] PythonCAD on OS X 10.4.3 In-Reply-To: References: <20051121132735.GA29129@artsapartment.org> <20051122015541.GB29129@artsapartment.org> <3585BB3D-5947-435B-99D7-8DFC33D4A0F8@gmail.com> <20051122202552.GC29129@artsapartment.org> <20051123181032.GE29129@artsapartment.org> <20051124135151.GH29129@artsapartment.org> Message-ID: <20051125211207.GK29129@artsapartment.org> On Thu, Nov 24, 2005 at 06:38:28PM +0100, Pierre Vaudrey wrote: > Art, > > Le 24 nov. 05 ? 14:51, Art Haas a ?crit : > > >That is a lot of typing, so it may be better to again adjust the > >'import' statments to look like this ... > > > >from PythonCAD.Interface.Cocoa import Globals > agreed : [ ... snip ... ] Patches applied. Thanks! > > Application is now running with the following exception : > > 2005-11-24 18:24:09.624 PythonCad[1684] An exception has occured: > Traceback (most recent call last): > [ ... snip ... ] > Contents/Resources/PythonCAD/Generic/dimension.py", line 2256, in __eq__ > if ((_key == 'DIM_PRIMARY_TEXT_SIZE') or > TypeError: 'bool' object is not callable Fixed. There was a missing 'or' statement in the __eq__() method. Your next 'svn update' will get this fix to 'dimension.py' as well as the patches to the Cocoa interface files. Art Haas -- 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 From pierre.vaudrey at gmail.com Sat Nov 26 09:07:05 2005 From: pierre.vaudrey at gmail.com (Pierre Vaudrey) Date: Sat, 26 Nov 2005 09:07:05 +0100 Subject: [PythonCAD] PythonCAD on OS X 10.4.3 In-Reply-To: <20051125211207.GK29129@artsapartment.org> References: <20051121132735.GA29129@artsapartment.org> <20051122015541.GB29129@artsapartment.org> <3585BB3D-5947-435B-99D7-8DFC33D4A0F8@gmail.com> <20051122202552.GC29129@artsapartment.org> <20051123181032.GE29129@artsapartment.org> <20051124135151.GH29129@artsapartment.org> <20051125211207.GK29129@artsapartment.org> Message-ID: <0C1907FA-C34B-4042-8D84-206E51EDD1FB@gmail.com> Art, Le 25 nov. 05 ? 22:12, Art Haas a ?crit : > Your > next 'svn update' will get this fix to 'dimension.py' as well as the > patches to the Cocoa interface files. Running after svn update give : 2005-11-26 09:04:01.742 PythonCad[3120] An exception has occured: Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ python2.4/site-packages/PyObjC/PyObjCTools/AppHelper.py", line 235, in runEventLoop main(argv) File "/Users/pierreva/Documents/pythoncad2/build/PythonCad.app/ Contents/Resources/PythonCAD/Interface/Cocoa/ImageDocument.py", line 157, in init self.setImage(PythonCAD.Generic.image.Image()) File "/Users/pierreva/Documents/pythoncad2/build/PythonCad.app/ Contents/Resources/PythonCAD/Interface/Cocoa/ImageDocument.py", line 391, in setImage image.connect("added_object", _m, CocoaMessenger.added_object_event) TypeError: connect() takes exactly 3 arguments (4 given) Pierre From ahaas at airmail.net Mon Nov 28 17:39:29 2005 From: ahaas at airmail.net (Art Haas) Date: Mon, 28 Nov 2005 10:39:29 -0600 Subject: [PythonCAD] PythonCAD on OS X 10.4.3 In-Reply-To: <0C1907FA-C34B-4042-8D84-206E51EDD1FB@gmail.com> References: <20051122015541.GB29129@artsapartment.org> <3585BB3D-5947-435B-99D7-8DFC33D4A0F8@gmail.com> <20051122202552.GC29129@artsapartment.org> <20051123181032.GE29129@artsapartment.org> <20051124135151.GH29129@artsapartment.org> <20051125211207.GK29129@artsapartment.org> <0C1907FA-C34B-4042-8D84-206E51EDD1FB@gmail.com> Message-ID: <20051128163929.GC7596@artsapartment.org> On Sat, Nov 26, 2005 at 09:07:05AM +0100, Pierre Vaudrey wrote: > Art, > > Le 25 nov. 05 ? 22:12, Art Haas a ?crit : > > >Your > >next 'svn update' will get this fix to 'dimension.py' as well as the > >patches to the Cocoa interface files. > > Running after svn update give : > > 2005-11-26 09:04:01.742 PythonCad[3120] An exception has occured: > [ ... snip ... ] > Contents/Resources/PythonCAD/Interface/Cocoa/ImageDocument.py", line > 391, in setImage > image.connect("added_object", _m, > CocoaMessenger.added_object_event) > TypeError: connect() takes exactly 3 arguments (4 given) Hmmm. It looks like we're at the point where the connect() messages need to be fixed. Previously the calls to connect() required passing an instance of a class and a class method, so in the code above the variable '_m' was the instance, and 'CocoaMessenger.added_object_event' was the method. I simplified connect() by consolidating the arguments, so that now a bound instance method is the only argument. I'll change the 'ImageDocument.py' file, commit my change, and then when you next do an 'svn update' please let me know if my changes fix the problem. Art Haas -- 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 From pierre.vaudrey at gmail.com Mon Nov 28 18:10:19 2005 From: pierre.vaudrey at gmail.com (Pierre Vaudrey) Date: Mon, 28 Nov 2005 18:10:19 +0100 Subject: [PythonCAD] PythonCAD on OS X 10.4.3 In-Reply-To: <20051128163929.GC7596@artsapartment.org> References: <20051122015541.GB29129@artsapartment.org> <3585BB3D-5947-435B-99D7-8DFC33D4A0F8@gmail.com> <20051122202552.GC29129@artsapartment.org> <20051123181032.GE29129@artsapartment.org> <20051124135151.GH29129@artsapartment.org> <20051125211207.GK29129@artsapartment.org> <0C1907FA-C34B-4042-8D84-206E51EDD1FB@gmail.com> <20051128163929.GC7596@artsapartment.org> Message-ID: <45B2BC47-1D89-4AAE-A59A-19AC4DE31AA5@gmail.com> Art, Le 28 nov. 05 ? 17:39, Art Haas a ?crit : > I simplified connect() by consolidating the arguments, > so that now a bound instance method is the only argument. I'll change > the 'ImageDocument.py' file, commit my change, and then when you > next do > an 'svn update' please let me know if my changes fix the problem. running after svn update : 2005-11-28 18:05:24.677 PythonCad[5236] An exception has occured: Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ python2.4/site-packages/PyObjC/PyObjCTools/AppHelper.py", line 235, in runEventLoop main(argv) File "/Users/pierreva/Documents/pythoncad2/build/PythonCad.app/ Contents/Resources/PythonCAD/Interface/Cocoa/ImageDocument.py", line 191, in makeWindowControllers _wc = ImageWindowController.alloc().initWithWindowNibName_owner_ (_nib,self) NameError: global name 'ImageWindowController' is not defined Pierre From ahaas at airmail.net Mon Nov 28 18:35:28 2005 From: ahaas at airmail.net (Art Haas) Date: Mon, 28 Nov 2005 11:35:28 -0600 Subject: [PythonCAD] PythonCAD on OS X 10.4.3 In-Reply-To: <45B2BC47-1D89-4AAE-A59A-19AC4DE31AA5@gmail.com> References: <20051122202552.GC29129@artsapartment.org> <20051123181032.GE29129@artsapartment.org> <20051124135151.GH29129@artsapartment.org> <20051125211207.GK29129@artsapartment.org> <0C1907FA-C34B-4042-8D84-206E51EDD1FB@gmail.com> <20051128163929.GC7596@artsapartment.org> <45B2BC47-1D89-4AAE-A59A-19AC4DE31AA5@gmail.com> Message-ID: <20051128173528.GD7596@artsapartment.org> On Mon, Nov 28, 2005 at 06:10:19PM +0100, Pierre Vaudrey wrote: > Art, > > Le 28 nov. 05 ? 17:39, Art Haas a ?crit : > > > I simplified connect() by consolidating the arguments, > >so that now a bound instance method is the only argument. I'll change > >the 'ImageDocument.py' file, commit my change, and then when you > >next do > >an 'svn update' please let me know if my changes fix the problem. > running after svn update : > > [ ... snip ... ] > Contents/Resources/PythonCAD/Interface/Cocoa/ImageDocument.py", line > 191, in makeWindowControllers > _wc = ImageWindowController.alloc().initWithWindowNibName_owner_ > (_nib,self) > NameError: global name 'ImageWindowController' is not defined > Fixed by adjusting the importation of this module to use the 'from' method of import. 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 From pierre.vaudrey at gmail.com Mon Nov 28 18:41:08 2005 From: pierre.vaudrey at gmail.com (Pierre Vaudrey) Date: Mon, 28 Nov 2005 18:41:08 +0100 Subject: [PythonCAD] PythonCAD on OS X 10.4.3 In-Reply-To: <20051128173528.GD7596@artsapartment.org> References: <20051122202552.GC29129@artsapartment.org> <20051123181032.GE29129@artsapartment.org> <20051124135151.GH29129@artsapartment.org> <20051125211207.GK29129@artsapartment.org> <0C1907FA-C34B-4042-8D84-206E51EDD1FB@gmail.com> <20051128163929.GC7596@artsapartment.org> <45B2BC47-1D89-4AAE-A59A-19AC4DE31AA5@gmail.com> <20051128173528.GD7596@artsapartment.org> Message-ID: <66842787-2DB8-43C0-AA23-802163941B50@gmail.com> Le 28 nov. 05 ? 18:35, Art Haas a ?crit : > Fixed by adjusting the importation of this module to use the 'from' > method of import. Result is : 2005-11-28 18:39:22.873 PythonCad[5284] An exception has occured: Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ python2.4/site-packages/PyObjC/PyObjCTools/AppHelper.py", line 235, in runEventLoop main(argv) File "/Users/pierreva/Documents/pythoncad2/build/PythonCad.app/ Contents/Resources/PythonCAD/Interface/Cocoa/ImageDocument.py", line 191, in makeWindowControllers _wc = ImageWindowController.alloc().initWithWindowNibName_owner_ (_nib,self) AttributeError: 'module' object has no attribute 'alloc' Pierre From ahaas at airmail.net Mon Nov 28 19:20:54 2005 From: ahaas at airmail.net (Art Haas) Date: Mon, 28 Nov 2005 12:20:54 -0600 Subject: [PythonCAD] PythonCAD on OS X 10.4.3 In-Reply-To: <66842787-2DB8-43C0-AA23-802163941B50@gmail.com> References: <20051123181032.GE29129@artsapartment.org> <20051124135151.GH29129@artsapartment.org> <20051125211207.GK29129@artsapartment.org> <0C1907FA-C34B-4042-8D84-206E51EDD1FB@gmail.com> <20051128163929.GC7596@artsapartment.org> <45B2BC47-1D89-4AAE-A59A-19AC4DE31AA5@gmail.com> <20051128173528.GD7596@artsapartment.org> <66842787-2DB8-43C0-AA23-802163941B50@gmail.com> Message-ID: <20051128182054.GE7596@artsapartment.org> On Mon, Nov 28, 2005 at 06:41:08PM +0100, Pierre Vaudrey wrote: > > Le 28 nov. 05 ? 18:35, Art Haas a ?crit : > > >Fixed by adjusting the importation of this module to use the 'from' > >method of import. > Result is : > > 2005-11-28 18:39:22.873 PythonCad[5284] An exception has occured: > Traceback (most recent call last): > File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ > python2.4/site-packages/PyObjC/PyObjCTools/AppHelper.py", line 235, > in runEventLoop > main(argv) > File "/Users/pierreva/Documents/pythoncad2/build/PythonCad.app/ > Contents/Resources/PythonCAD/Interface/Cocoa/ImageDocument.py", line > 191, in makeWindowControllers > _wc = ImageWindowController.alloc().initWithWindowNibName_owner_ > (_nib,self) > AttributeError: 'module' object has no attribute 'alloc' > I think alloc() may been part of the PyObjC bindings. Can you find any info on this? 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 From pierre.vaudrey at gmail.com Tue Nov 29 09:02:17 2005 From: pierre.vaudrey at gmail.com (Pierre Vaudrey) Date: Tue, 29 Nov 2005 09:02:17 +0100 Subject: [PythonCAD] PythonCAD on OS X 10.4.3 In-Reply-To: <20051128182054.GE7596@artsapartment.org> References: <20051123181032.GE29129@artsapartment.org> <20051124135151.GH29129@artsapartment.org> <20051125211207.GK29129@artsapartment.org> <0C1907FA-C34B-4042-8D84-206E51EDD1FB@gmail.com> <20051128163929.GC7596@artsapartment.org> <45B2BC47-1D89-4AAE-A59A-19AC4DE31AA5@gmail.com> <20051128173528.GD7596@artsapartment.org> <66842787-2DB8-43C0-AA23-802163941B50@gmail.com> <20051128182054.GE7596@artsapartment.org> Message-ID: <62BED51F-F62D-4ACB-9912-82F155D58C28@gmail.com> Art, Le 28 nov. 05 ? 19:20, Art Haas a ?crit : > I think alloc() may been part of the PyObjC bindings. Can you find any > info on this? Before i search info, svn update this morning gives : U PythonCAD/Generic/dimension.py U PythonCAD/Generic/text.py Updated to revision 2073. and at running : Traceback (most recent call last): File "/Users/pierreva/Documents/pythoncad2/build/PythonCad.app/ Contents/Resources/PythonCad.py", line 29, in ? import PythonCAD.Generic.imageio File "/Users/pierreva/Documents/pythoncad2/build/PythonCad.app/ Contents/Resources/PythonCAD/Generic/imageio.py", line 32, in ? import xml.dom ImportError: No module named dom I'm surprised because : $ python Python 2.4.1 (#2, Mar 31 2005, 00:05:10) [GCC 3.3 20030304 (Apple Computer, Inc. build 1666)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import xml.dom >>> Have you an idea ? Pierre From ahaas at airmail.net Tue Nov 29 13:37:12 2005 From: ahaas at airmail.net (Art Haas) Date: Tue, 29 Nov 2005 06:37:12 -0600 Subject: [PythonCAD] PythonCAD on OS X 10.4.3 In-Reply-To: <62BED51F-F62D-4ACB-9912-82F155D58C28@gmail.com> References: <20051124135151.GH29129@artsapartment.org> <20051125211207.GK29129@artsapartment.org> <0C1907FA-C34B-4042-8D84-206E51EDD1FB@gmail.com> <20051128163929.GC7596@artsapartment.org> <45B2BC47-1D89-4AAE-A59A-19AC4DE31AA5@gmail.com> <20051128173528.GD7596@artsapartment.org> <66842787-2DB8-43C0-AA23-802163941B50@gmail.com> <20051128182054.GE7596@artsapartment.org> <62BED51F-F62D-4ACB-9912-82F155D58C28@gmail.com> Message-ID: <20051129123712.GG7596@artsapartment.org> On Tue, Nov 29, 2005 at 09:02:17AM +0100, Pierre Vaudrey wrote: > Art, > > Le 28 nov. 05 ? 19:20, Art Haas a ?crit : > > >I think alloc() may been part of the PyObjC bindings. Can you find any > >info on this? > > Before i search info, svn update this morning gives : > U PythonCAD/Generic/dimension.py > U PythonCAD/Generic/text.py > Updated to revision 2073. > and at running : > Traceback (most recent call last): > File "/Users/pierreva/Documents/pythoncad2/build/PythonCad.app/ > Contents/Resources/PythonCad.py", line 29, in ? > import PythonCAD.Generic.imageio > File "/Users/pierreva/Documents/pythoncad2/build/PythonCad.app/ > Contents/Resources/PythonCAD/Generic/imageio.py", line 32, in ? > import xml.dom > ImportError: No module named dom > > I'm surprised because : > $ python > Python 2.4.1 (#2, Mar 31 2005, 00:05:10) > [GCC 3.3 20030304 (Apple Computer, Inc. build 1666)] on darwin > Type "help", "copyright", "credits" or "license" for more information. > >>> import xml.dom > >>> > > Have you an idea ? That is a strange error, as the 'xml.dom' module is a standard part of Python, plus you demonstrated that your Python installation could 'import' it without problem. Weird, and no idea at the moment ... 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