pyobjc-dev Mailing List for PyObjC (Page 193)
Brought to you by:
ronaldoussoren
You can subscribe to this list here.
2000 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(9) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2001 |
Jan
(1) |
Feb
(2) |
Mar
(3) |
Apr
(30) |
May
(18) |
Jun
|
Jul
(4) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2002 |
Jan
(7) |
Feb
(2) |
Mar
(1) |
Apr
|
May
|
Jun
(3) |
Jul
(13) |
Aug
|
Sep
(23) |
Oct
(180) |
Nov
(291) |
Dec
(95) |
2003 |
Jan
(338) |
Feb
(352) |
Mar
(97) |
Apr
(46) |
May
(226) |
Jun
(184) |
Jul
(145) |
Aug
(141) |
Sep
(69) |
Oct
(161) |
Nov
(96) |
Dec
(90) |
2004 |
Jan
(66) |
Feb
(87) |
Mar
(98) |
Apr
(132) |
May
(115) |
Jun
(68) |
Jul
(150) |
Aug
(92) |
Sep
(59) |
Oct
(52) |
Nov
(17) |
Dec
(75) |
2005 |
Jan
(84) |
Feb
(191) |
Mar
(133) |
Apr
(114) |
May
(158) |
Jun
(185) |
Jul
(62) |
Aug
(28) |
Sep
(36) |
Oct
(88) |
Nov
(65) |
Dec
(43) |
2006 |
Jan
(85) |
Feb
(62) |
Mar
(92) |
Apr
(75) |
May
(68) |
Jun
(101) |
Jul
(73) |
Aug
(37) |
Sep
(91) |
Oct
(65) |
Nov
(30) |
Dec
(39) |
2007 |
Jan
(24) |
Feb
(28) |
Mar
(10) |
Apr
(2) |
May
(18) |
Jun
(16) |
Jul
(21) |
Aug
(6) |
Sep
(30) |
Oct
(31) |
Nov
(153) |
Dec
(31) |
2008 |
Jan
(63) |
Feb
(70) |
Mar
(47) |
Apr
(24) |
May
(59) |
Jun
(22) |
Jul
(12) |
Aug
(7) |
Sep
(14) |
Oct
(26) |
Nov
(5) |
Dec
(5) |
2009 |
Jan
(10) |
Feb
(41) |
Mar
(70) |
Apr
(88) |
May
(49) |
Jun
(62) |
Jul
(34) |
Aug
(15) |
Sep
(55) |
Oct
(40) |
Nov
(67) |
Dec
(21) |
2010 |
Jan
(60) |
Feb
(17) |
Mar
(26) |
Apr
(26) |
May
(29) |
Jun
(4) |
Jul
(21) |
Aug
(21) |
Sep
(10) |
Oct
(12) |
Nov
(3) |
Dec
(19) |
2011 |
Jan
(3) |
Feb
(13) |
Mar
(8) |
Apr
(8) |
May
(17) |
Jun
(20) |
Jul
(21) |
Aug
(7) |
Sep
|
Oct
|
Nov
(9) |
Dec
(11) |
2012 |
Jan
(3) |
Feb
|
Mar
|
Apr
(5) |
May
(4) |
Jun
(14) |
Jul
(5) |
Aug
(2) |
Sep
(15) |
Oct
(2) |
Nov
(23) |
Dec
(1) |
2013 |
Jan
(8) |
Feb
(1) |
Mar
|
Apr
|
May
(5) |
Jun
(1) |
Jul
(5) |
Aug
(4) |
Sep
|
Oct
(12) |
Nov
(10) |
Dec
(3) |
2014 |
Jan
(7) |
Feb
(14) |
Mar
(2) |
Apr
|
May
(2) |
Jun
(11) |
Jul
(10) |
Aug
(4) |
Sep
|
Oct
(8) |
Nov
(1) |
Dec
(2) |
2015 |
Jan
(9) |
Feb
(7) |
Mar
(1) |
Apr
|
May
(7) |
Jun
|
Jul
(5) |
Aug
(6) |
Sep
|
Oct
(1) |
Nov
(4) |
Dec
|
2016 |
Jan
(1) |
Feb
(1) |
Mar
(4) |
Apr
(2) |
May
(1) |
Jun
|
Jul
(6) |
Aug
(8) |
Sep
(21) |
Oct
(17) |
Nov
|
Dec
(36) |
2017 |
Jan
(6) |
Feb
(2) |
Mar
(4) |
Apr
(2) |
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
(1) |
Oct
|
Nov
(1) |
Dec
(6) |
2018 |
Jan
(2) |
Feb
(3) |
Mar
(3) |
Apr
(14) |
May
(2) |
Jun
(2) |
Jul
(4) |
Aug
(3) |
Sep
(6) |
Oct
(16) |
Nov
(1) |
Dec
(6) |
2019 |
Jan
(3) |
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(2) |
Aug
|
Sep
|
Oct
(6) |
Nov
|
Dec
|
2020 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
(2) |
Jun
(1) |
Jul
(7) |
Aug
(1) |
Sep
(1) |
Oct
|
Nov
(2) |
Dec
(1) |
2021 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
(2) |
Jul
|
Aug
(5) |
Sep
(1) |
Oct
|
Nov
(1) |
Dec
|
2023 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
(2) |
Oct
|
Nov
|
Dec
|
2025 |
Jan
(2) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Alex P. <ap...@st...> - 2004-04-04 18:13:50
|
Ronald et al, I lurk on the cocoa-dev mailing list, and recently saw a posting about PyObjC. Someone in #macpython on FreeNode told me you'd done the bulk (all?) of the work to make PyObjC work with GNUstep once upon a time. I'm the GNUstep website maintainer (one of a couple of others), and am putting together a page with a list of language bindings to demonstrate how many languages you can use with GNUstep. I'd love to help you resuscitate the GNUstep support in PyObjC and keep it actively working. I downloaded the CVS sources to PyObjC a day ago and attempted to get it to build, to no avail. Someone told me to look in Scripts/gen_all_protocols.py and it looks like there are some hardcoded paths in there. GNUstep system header files live in a slightly different place than they do on OS X. Foundation and AppKit headers are found in $GNUSTEP_SYSTEM_ROOT/Library/Headers/Foundation and $GNUSTEP_SYSTEM_ROOT/Library/Headers/AppKit, respectively. There are also some InterfaceBuilder (our IB-esque app is called GORM) in $GNUSTEP_SYSTEM_ROOT/Library/Headers/InterfaceBuilder. GNUstep also has a 100% API compatible AddressBook implementation, but it is not part of GNUstep proper, and as such may or may not be on any given machine. If it is, the headers would be in $GNUSTEP_LOCAL_ROOT/Library/Headers/AddressBook . For those of you who might be wondering, GNUstep lives in various places. I have it installed in / so my System folder is simply /System, local is /. Most distributions which package GNUstep put it in /usr/GNUstep or /usr/lib/GNUstep, which is why we must use system variables such as $GNUSTEP_SYSTEM_ROOT et al. Cheers for now, Alex Perez GNUstep.org web team |
From: James E. <ea...@ba...> - 2004-04-04 17:52:53
|
On 3 Apr 2004, at 17:56, Bob Ippolito wrote: > Try Twisted from SVN trunk and PyObjC from CVS HEAD and let me know if > there is still a bug, lots of stuff has been fixed on both sides > recently. Bob, you're beautiful! The CFreactor in subversion works like a charm. I haven't updated PyObjC, but I'll try that first if I have issues. Thanks! James -- The good Christian should beware of mathematicians.... The danger already exists that mathematicians have made a covenant with the devil to darken the spirit and confine man in the bonds of Hell. -- Saint Augustine |
From: Bob I. <bo...@re...> - 2004-04-04 17:16:17
|
On Apr 4, 2004, at 9:34 AM, Paul Donovan wrote: > > On 4 Apr 2004, at 09:29, Bob Ippolito wrote: > >> I have created a small Cocoa Bindings example and step by step >> tutorial that uses NSTableView in response to this question. >> Hopefully it is enough to get people started. >> >> The example itself is in PyObjC CVS at >> Examples/CocoaBindings/TableBindings/ >> > > Thanks for creating this example, it was very timely as I was about to > look at bindings this weekend. > > The code doesn't appear to be in CVS though, although the PDF is > enough to work with. It's there. Sourceforge is slow about updating their anonymous repository though. > One question - if one didn't want to use dictionaries but use objects > with straightforward attributes, how would the code and bindings be > altered? I remember some talk on the list about getattr() or something > like that, but didn't really follow it as I hadn't investigated Cocoa > Bindings at that time. The short answer is that dictionaries are easy, because otherwise you are probably going to need something that subclasses NSObject. It should work if you use straightforward attributes, but you will probably have to declare that class in your nib, and you may have to use accessor methods for those attributes. For more information about how Cocoa Bindings works, read the other examples and Apple's documentation ( http://developer.apple.com/documentation/Cocoa/Conceptual/ CocoaBindings/ ). -bob |
From: Paul D. <pa...@do...> - 2004-04-04 13:35:03
|
On 4 Apr 2004, at 09:29, Bob Ippolito wrote: > I have created a small Cocoa Bindings example and step by step > tutorial that uses NSTableView in response to this question. > Hopefully it is enough to get people started. > > The example itself is in PyObjC CVS at > Examples/CocoaBindings/TableBindings/ > Thanks for creating this example, it was very timely as I was about to look at bindings this weekend. The code doesn't appear to be in CVS though, although the PDF is enough to work with. One question - if one didn't want to use dictionaries but use objects with straightforward attributes, how would the code and bindings be altered? I remember some talk on the list about getattr() or something like that, but didn't really follow it as I hadn't investigated Cocoa Bindings at that time. Paul |
From: Bob I. <bo...@re...> - 2004-04-04 08:25:29
|
I have created a small Cocoa Bindings example and step by step tutorial that uses NSTableView in response to this question. Hopefully it is enough to get people started. The example itself is in PyObjC CVS at Examples/CocoaBindings/TableBindings/ Here are the URLs for the tutorial: http://undefined.org/python/passwdviewer_cocoabindings_tutorial.txt (ReST source) http://undefined.org/python/passwdviewer_cocoabindings_tutorial.pdf (pdf tutorial with screenshots) Please let me know if you have any questions or comments. -bob |
From: Birch B. <b.b...@cs...> - 2004-04-04 03:16:07
|
Bob, Thanks for your amazingly fast response. Right now I have a table, dataResults, that I'd like to populate with a list of lists: results = [['string 1', 0.00],['string 2', 1.25],['string 3', 2.75]] Since I'm generating the data, it wouldn't be a problem to use a dictionary: results = [{"Column 1":"string 1","Column 2":0.00},{"Column 1":"string 2","Column 2":1.25},{"Column 1":"string 3","Column 2":2.75}] I'd like to re-write such that the list holds objects to which I can assign values. As in: class Obj(object): def setValueOne(self, valueOne): self.__valueOne = valueOne ... obj = Obj() self.obj.setValueOne(self, valueOne) self.results.append(obj) but, I don't _have_ to do it this way. Since I'm still quite a newbie, you may be able to advise me as the the advantages/disadvantages of each route. I found notes from your presentation online, so I did a little reading about NSArrayControllers. IF I go this route, I think I'd need a little help setting up the bindings in Interface Builder in addition to some controller code. Thanks for any help. Birch On Apr 3, 2004, at 9:06 PM, Bob Ippolito wrote: > > On Apr 3, 2004, at 8:32 PM, Birch Browning wrote: > >> I have a python list that I'd like to use as a data source for a >> table view. >> >> Does anyone have a simple sample they could post? I've tried (and >> tried) to decipher the TableModel example without success. > > If you can depend on OS X 10.3+, then it is exceptionally easy using > Cocoa Bindings. I can create an example that uses them (I actually > did this from scratch in my PyCon presentation) if you want.. > > The real question is what is in your Python list? If it's just > dictionaries with string keys, you hardly have to write any code at > all using Cocoa Bindings. > > -bob > |
From: Bob I. <bo...@re...> - 2004-04-04 02:02:04
|
On Apr 3, 2004, at 8:32 PM, Birch Browning wrote: > I have a python list that I'd like to use as a data source for a table > view. > > Does anyone have a simple sample they could post? I've tried (and > tried) to decipher the TableModel example without success. If you can depend on OS X 10.3+, then it is exceptionally easy using Cocoa Bindings. I can create an example that uses them (I actually did this from scratch in my PyCon presentation) if you want.. The real question is what is in your Python list? If it's just dictionaries with string keys, you hardly have to write any code at all using Cocoa Bindings. -bob |
From: Birch B. <b.b...@cs...> - 2004-04-04 01:33:10
|
I have a python list that I'd like to use as a data source for a table view. Does anyone have a simple sample they could post? I've tried (and tried) to decipher the TableModel example without success. TIA! Birch |
From: Bob I. <bo...@re...> - 2004-04-03 22:52:13
|
On Apr 3, 2004, at 4:10 PM, James Eagan wrote: > I'm not sure if this is really more appropriate to the twisted or > pyobjc list, but hopefully this is the right place :-) > > I'm having trouble a PyObjC app using PyMacApp and Twisted -- When I > run the application in an idle state (that is, the application just > throws up a window and sits in the event loop, otherwise doing > nothing), the application gobbles up all available CPU. Here's the > offending __main__.py file: Try Twisted from SVN trunk and PyObjC from CVS HEAD and let me know if there is still a bug, lots of stuff has been fixed on both sides recently. -bob |
From: James E. <ea...@ba...> - 2004-04-03 21:10:57
|
I'm not sure if this is really more appropriate to the twisted or pyobjc list, but hopefully this is the right place :-) I'm having trouble a PyObjC app using PyMacApp and Twisted -- When I run the application in an idle state (that is, the application just throws up a window and sits in the event loop, otherwise doing nothing), the application gobbles up all available CPU. Here's the offending __main__.py file: import twisted.internet.cfreactor reactor = twisted.internet.cfreactor.install() from PyObjCTools import NibClassBuilder, AppHelper import sys import MyAppController if __name__ == '__main__': AppHelper.runEventLoop() (Note that the controller provides an action that is performed when a button is pressed -- it invokes __main__.reactor.run() and __main__.reactor.connectTCP(...)) If I comment out those first two lines (that is, I never install the twisted cfreactor), then the application no longer gobbles up all available cpu (of course, this breaks the twisted integration with the event loop). Can anyone give any suggestions as to what I'm doing wrong here? Is this a bug with the Twisted CFReactor? I'm inclined to think it is since the Cocoa/SimpleWebClient example from the Twisted distribution does the same thing. Is there a workaround anyone can suggest? (BTW, this is stock Panther python 2.3 and Twisted 1.2.0). Thanks! James -- It is by caffeine alone that I put my mind in motion; It is by the leaves of tea that my thoughts acquire speed; The hands aquire shakes; the shakes become a warning; It is by caffeine alone I put my thoughts in motion. |
From: <3d...@sh...> - 2004-04-03 15:09:26
|
<html> <head> <title>无标题文档</title> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <style type="text/css"> <!-- a:hover { color: #009999; text-decoration: none} --> </style> </head> <body bgcolor="#FFFFFF" text="#000000"> 尊敬的女士/先生:您好!(请汇款前电话确认有无您选中的书,多谢合作)<br> 精品图书.文史.禁书.专业图书等让您欣赏从古到今前所未有的精彩<br> 精品图书请登陆:<a href="http://www.linghuo.com">http://www.linghuo.com</a><br> 摆放到书架上,尽显您的档次.是送礼和收藏的最佳选择<br> (精品图书1折--5折)<br> <br> <table width="73%" border="1" cellspacing="1" cellpadding="0" height="510" align="center"> <tr> <td><font color="#FF0033" size="2">中国通史(彩图版全四卷)</font><font size="2"> 原价:¥1200 元 现价:¥160 元</font></td> </tr> <tr> <td><font color="#FF0033" size="2">世界文明史(彩图版全四卷)</font><font size="2"> 原价:¥1200 元 现价:¥160 元 </font></td> </tr> <tr> <td><font color="#FF0033" size="2">中国十大禁书 </font><font size="2"> 原价:¥1200 元 现价:¥170 元 </font></td> </tr> <tr> <td><font color="#FF0000" size="2">十大王朝(大16开10卷)</font><font size="2"> 原价:<s>¥3600元</s> 现价:¥360元 </font></td> </tr> <tr> <td><font color="#FF0033" size="2">中国禁史(全24册)</font><font size="2"> 原价:¥2980 元 现价:¥300 元 </font></td> </tr> <tr> <td><font color="#FF0033" size="2">世界野史(全十八册)</font><font size="2"> 原价:¥2280 元 现价:¥300 元 </font></td> </tr> <tr> <td><font color="#FF0000" size="2">清史通鉴(全十卷)</font><font size="2"> 原价:<s>¥3600 元</s> 现价:¥390 元 </font></td> </tr> <tr> <td><font color="#FF0033" size="2">明清十大禁书(插图版全十卷)</font><font size="2"> 原价:¥1290 元 现价:¥160 元 </font></td> </tr> <tr> <td><font color="#FF0000" size="2">彩图版中国古典名著鉴赏(大16开4卷)</font><font size="2"> 原价:¥1200 元 现价:¥160 元 </font></td> </tr> <tr> <td><font color="#FF0000" size="2">彩图版中国名画全集(大16开4卷)</font><font size="2"> 原价:¥1200 元 现价:¥160 元</font></td> </tr> <tr> <td><font color="#FF0000" size="2">彩图版世界名画全集(大16开4卷)</font><font size="2"> 原价:¥1200 元 现价:¥160 元</font></td> </tr> <tr> <td><font color="#FF0000" size="2">彩图版中国书法全集(大16开4卷)</font><font size="2"> 原价:¥1200 元 现价:¥160 元</font></td> </tr> <tr> <td><font color="#FF0033" size="2">彩图版中国青少年百科全书(大16开全4卷)</font><font size="2"> 原价:¥1200 元 现价:¥160 元 </font></td> </tr> <tr> <td><font color="#FF0033" size="2">彩图版家庭医疗保健百科全书(大16开全4卷)</font><font size="2"> 原价:¥1200 元 现价:¥180 元</font></td> </tr> <tr> <td><font color="#FF0033" size="2">彩图版中华成语故事(大16开全4卷)</font><font size="2"> 原价:¥1200 元 现价:¥160 元 </font></td> </tr> <tr> <td><font color="#FF0033" size="2">现代汉语辞海(大16开全4卷)</font><font size="2"> 原价:¥1200 元 现价:¥180 元</font></td> </tr> <tr> <td><font color="#FF0033" size="2">彩图版中华上下五千年(大16开全4卷)</font><font size="2"> 原价:¥1200 元 现价:¥160 元 </font></td> </tr> <tr> <td><font color="#FF0033" size="2">彩图版世界上下五千年(大16开全4卷)</font><font size="2"> 原价:¥1200 元 现价:¥160 元</font></td> </tr> <tr> <td><font color="#FF0000" size="2">彩图版唐诗宋词三百首(大16开全4卷) </font><font size="2"> 原价:¥1200 元 现价:¥160 元</font></td> </tr> </table> <p><font size="2"> 购买精品图书-北京五环以内免费送货,货到付款。 <br> 天津外环以内免费送货,货到付款。<br> 外地客户<a href="http://www.weininfuwu.com/111kai.htm">款到付货</a>或自提(价格以电话确认为准)<br> 北京:010-65675942<br> 联系人:罗女士<br> 天津:022-28322146/<font color="#333333"><font color="#000000">13502036227</font></font><br> 联系人:李女士<br> </font><font color="#000033"><b>北京为您服务图书大世界</b></font><br> <br> </p> </body> </html> |
From: SourceForge.net <no...@so...> - 2004-04-03 01:50:59
|
Bugs item #928678, was opened at 2004-04-03 01:50 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=114534&aid=928678&group_id=14534 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: David Remahl (chmod007) Assigned to: Nobody/Anonymous (nobody) Summary: FieldGraph images missing from project Resources group Initial Comment: The FieldGraph example crashes, when built and run using the .pbproj. Using buildapp.py works. The crash happens when mapImage is nil, and the reason it is nil, is that the project does not contain the two images as resources. The backtrace: 2004-04-03 03:49:20.119 FieldGraph[6779] An exception has occured: Traceback (most recent call last): File "/Users/chmod007/pyobjc/Examples/FieldGraph/build/ FieldGraph.app/Contents/Resources/Main.py", line 7, in ? AppHelper.runEventLoop() File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ python2.3/site-packages/PyObjC/PyObjCTools/AppHelper.py", line 71, in runEventLoop NSApplicationMain(argv) File "/Users/chmod007/pyobjc/Examples/FieldGraph/build/ FieldGraph.app/Contents/Resources/CGraphController.py", line 21, in awakeFromNib self.graphView.setMapImage(self.mapImage) File "/Users/chmod007/pyobjc/Examples/FieldGraph/build/ FieldGraph.app/Contents/Resources/CGraphView.py", line 67, in setMapImage self.mapRect = ((0, 0), mapImage.size()) AttributeError: 'NoneType' object has no attribute 'size' ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=114534&aid=928678&group_id=14534 |
From: Bob I. <bo...@re...> - 2004-04-01 20:44:03
|
I've added support for CFRunLoop (NSRunLoop) signal handling via Mach ports. This means that Ctrl-C (from a controlling terminal) will actually do something useful. If there is an NSApplication instance, it will send it a terminate: message, otherwise it will os._exit(1). This functionality is automatically enabled if you use PyObjCTools.AppHelper.runEventLoop(...) or the new runConsoleEventLoop(...) (uses NSRunLoop instead of NSApplication). It also means that more obscure uses of signals (handling of SIGHUP, etc.) can be done.. but you're on your own there. I have not documented any of it, but PyObjCTools.MachSignals sports essentially the same interface as the signal module. You shouldn't need to know about the implementation of the _machsignals module. Additionally, I've wrapped the ExceptionHandling framework to allow debugging of stuff easier. The only hooks you should need to use for this is the PyObjCTools.Debugging module and one of the following functions: installPythonExceptionHandler() (logs tracebacks for any python exception that crosses the PyObjC bridge) installVerboseExceptionHandler() (logs tracebacks and ObjC stack traces for any ObjC exception raised) I've done some experiments, and it doesn't seem to be useful to handle uncaught exceptions. If it were, I would add the functionality to AppHelper. From what I understand, NSRunLoop, NSTimer, etc. are going to catch exceptions and throw them away, and anything else should be automatically converted and raised as a Python exception. So essentially, if you come up with an exception that you are unsure of, and aren't ready to gdb it, then call one of the aforementioned functions before the exception is expected to occur (probably before you start your runloop). Somebody please feel free to go over these new modules and properly document them, patches/commits welcome :) -bob |
From: James M. <jm...@ro...> - 2004-03-31 09:54:45
|
On Mar 30, 2004, at 11:18 PM, Donovan Preston wrote: > You can use pdb to debug your application if you use Bob's new main.m > from PyMacApp, which embeds python instead of using execve to launch a > python process. I have checked in this new main.m to the PyObjC cvs > head, so you can use the template in the 'Xcode' directory to get > started. OK. I grabbed the latest PyObjC and was debugging in no time, even at 4 AM. :) > I am also working on a remote debugger for PyObjC which uses DO to > communicate with the child process, and will provide more capable > graphical debugging abilities. It is already working and all that > remains is to finish off the ui. I will make an announcement when I > have something slightly more featureful ready. Great! Thanks for all the replies everyone. So debugging is going to be possible...excellent. And thanks to everyone putting in work on PyObjC and tools so that I even have this option to go to. -jim |
From: Bob I. <bo...@re...> - 2004-03-31 04:18:36
|
On Mar 30, 2004, at 9:57 PM, James Mastro wrote: > What is the best way to go about debugging a PyObjC app? I have an app > I'm developing that is currently written in Objective C, but I'd > rather do it in Python with PyObjC. I remember reading somewhere when > I was first looking into this that source level debugging was going to > be a problem...but I can't find that link anymore. So, before I jump > into this, am I going to be stuck debugging with just print > statements? IMHO, gdb and Xcode is far better than pdb with.. nothing. I've been able to do pdb.set_trace() from within an PyObjC app, which works so long as you started it from a real console.. but it's not very pretty. Some people are working on better solutions (i.e., out-of-process Python debuggers), but they don't really exist yet. -bob |
From: Donovan P. <ds...@ma...> - 2004-03-31 04:18:21
|
On Mar 30, 2004, at 9:57 PM, James Mastro wrote: > What is the best way to go about debugging a PyObjC app? I have an app > I'm developing that is currently written in Objective C, but I'd > rather do it in Python with PyObjC. I remember reading somewhere when > I was first looking into this that source level debugging was going to > be a problem...but I can't find that link anymore. So, before I jump > into this, am I going to be stuck debugging with just print > statements? You can use pdb to debug your application if you use Bob's new main.m from PyMacApp, which embeds python instead of using execve to launch a python process. I have checked in this new main.m to the PyObjC cvs head, so you can use the template in the 'Xcode' directory to get started. You will need to start up your application with a hooked up stdin in order for this to work. You can either start the application from the terminal by executing YourApp.app/Contents/MacOS/YourApp or make sure the "Std In/Out" preference in the executable pane is set to "Pseudo terminal" in Xcode. You can break into pdb using the normal 'import pdb; pdb.set_trace()'. You can then set other breakpoints and continue. I am also working on a remote debugger for PyObjC which uses DO to communicate with the child process, and will provide more capable graphical debugging abilities. It is already working and all that remains is to finish off the ui. I will make an announcement when I have something slightly more featureful ready. dp |
From: James M. <jm...@ro...> - 2004-03-31 02:57:51
|
What is the best way to go about debugging a PyObjC app? I have an app I'm developing that is currently written in Objective C, but I'd rather do it in Python with PyObjC. I remember reading somewhere when I was first looking into this that source level debugging was going to be a problem...but I can't find that link anymore. So, before I jump into this, am I going to be stuck debugging with just print statements? -jim |
From: Bob S. <rsw...@tr...> - 2004-03-30 16:39:54
|
I'm trying to set up a second NIB for a modal dialog to display progress while my application does some processing in my Mac OS X app. We are using Python 2.3 with PyObjC 1.1b1. However, the "magic" that loads the classes from the NIB file doesn't seem to work for me. (That's the problem with magic - it is somewhat obscure 8-) ). My guess is that I'm missing some important step, but I can't figure out what it is and I don't see an example that covers this. In my main application, when it is time to show the modal dialog, I have: from mymodalpanelclass import MyModalPanel def showMyModalPanel(self): myModal = MyModalPanel.alloc() myModal.init() myModal.showDialog(application) while <more-work-to-do>: <do-some-work> myModal.runDialog() myModal.closeDialog() In a secondary NIB file called "MyModalPanel.nib" I created an NSPanel window, set the class of "File's Owner" to MyModalPanelController, created an outlet "myModalPanel" and connected it to the NSPanel window. In the file that implements MyModalPanel, I have: from PyObjCTools import NibClassBuilder NibClassBuilder.extractClasses("MyModalPanel") class MyModalPanelController(NibClassBuilder.AutoBaseClass): # the actual base class is NSObject # the following outlets are added to the class: # myModalPanel def showDialog(self, application): self.application = application self.myModalPanel.setWorksWhenModal(True) self._modalSession = self.application.beginModalSessionForWindow_(self.myModalPanel) def closeDialog(self): self.application.endModalSession_(self._modalSession) def runDialog(self): self.application.runModalSession_(self._modalSession) However, when I run this code, I find that self.myModalPanel is None and of course, nothing works. My impression was that the Panel would be created automatically when I created the MyModalPanelController instance. What do I need to do to get the NSPanel created? Thanks! - Bob |
From: Ryan W. <rya...@ma...> - 2004-03-30 12:58:32
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 3/29/04, at 8:08 PM, Donovan Preston said: >I committed the new Cocoa-Python Application Xcode template I have been=20 >working on for a while.=20 It Works Well For Me. (Thanks Donovan!) >I was mostly taking my time to make sure I got=20 >everything right. Committing turned out to be quite an ordeal because=20 >of the crappy way CVS deals with directories, and the fact that .xcode=20 >and .nib files are directories. (Does SVN make this any easier?) Somewhat. A lot of the operations with subversion are recursive - you do: % svn add someFolder and it will add someFolder and all of the files inside it. Same with commit= - it will commit all the added/modified files "in that location". (I like to run= it at the top of my repositories/modules as an easy way to "commit all these changes") It still doesn't treat a bundle as a single file, but the recursive operati= ons make things slightly easier on that front. My two cents, _Ryan Wilcox =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Wilcox Development Solutions: http://www.wilcoxd.com Toolsmiths for the Internet Age PGP: 0x2F4E9C31 -----BEGIN PGP SIGNATURE----- Version: PGP SDK 3.0.3 iQA/AwUBQGlu4m2DtKgvTpwxEQI/gwCg+2fWBx8a3YOE8aezZ5o+jhQDRLkAoK5P UdYMzv9rKQzW+E/1KKVfHvgp =3DZfrD -----END PGP SIGNATURE----- |
From: Donovan P. <ds...@ma...> - 2004-03-30 01:08:39
|
I committed the new Cocoa-Python Application Xcode template I have been working on for a while. I was mostly taking my time to make sure I got everything right. Committing turned out to be quite an ordeal because of the crappy way CVS deals with directories, and the fact that .xcode and .nib files are directories. (Does SVN make this any easier?) Anyway, please take a look and see if it survived the trip through CVS and tell me if I messed anything up. I will be moving on to a Document-based application template next. dp |
From: Bob I. <bo...@re...> - 2004-03-29 16:40:18
|
On Mar 25, 2004, at 6:03 PM, Bob Ippolito wrote: > > On Mar 25, 2004, at 4:23 PM, Ronald Oussoren wrote: > >> >> On 25-mrt-04, at 22:08, Burris T. Ewell wrote: >> >>> First off, I appreciate all of the help here... >>> >>> On Mar 25, 2004, at 12:19 PM, Ronald Oussoren wrote: >>>> If I remove those calls the application runs longer, e.g. it didn't >>>> crash yet :-) >>> >>> I don't think that's it... I tried that, holding a reference to the >>> cell, and also retaining the application delegate that holds >>> references to the controller objects. Still, inside the cell, the >>> controller attribute disappears inside drawInteriorWithFrame. Here >>> is a traceback from the full application, which is pretty much the >>> same as the demonstration. This shouldn't be possible since the >>> cell sets self.controller inside of init() and nowhere else is the >>> attribute removed. >> >> Hmm, doesn't NSTableView use -copy? That might explain why >> self.controller disappears. >> >> There's definitly something fishy going on, > > There's fishy things with threads in PyObjC in general.. try this, for > example (I just ran into this bug today): > > http://undefined.org/~bob/PyURLProtocol_broken.tgz > > My guess is that it doesn't release the GIL when doing the call, so > when it gets the callback it can't acquire the GIL and deadlocks. Just to follow this up, the barrage of recent GIL-related checkins have fixed this issue and I've created an example that uses it: Examples/PyDocURLProtocol The GUI sucks, because it's just a web-browser-with-no-support-code, but I think it demonstrates the URL protocol well enough. Feel free to spice it up. -bob |
From: Burris T. E. <bu...@gi...> - 2004-03-29 00:06:26
|
Are you sure the problem is that my custom cell doesn't do copyWithZone: properly? I created an objc subclass of NSCell with the controller ivar and a copyWithZone: that gives the copy a reference to the same controller (and a dealloc that releases it), then I subclassed this within Python and used that as my cell. I still get the same problem. thanks, burris |
From: Bob I. <bo...@re...> - 2004-03-28 19:52:45
|
On Mar 28, 2004, at 2:26 PM, Ronald Oussoren wrote: > On 28-mrt-04, at 18:36, Burris T. Ewell wrote: > >> Another clue: >> >> *** malloc[5538]: error for object 0x5b9f00: Double free >> >> Somewhere, memory management is going awry. > > That's consistent with my diagnosis. I'm thinking about a fix for > this, but I have not yet found a good solution for this. > > The problem is that __dict__ and attributes introduced by __slots__ > are 'PyObject*' attributes when you look at the object from > Objective-C. These are copied by the default copyWithZone: but without > updating the reference count (Py_INCREF-ing the value). That means > we're hosed when copy/copyWithZone: is used, because it is not > possible to fix the reference count using Python code. > > It is easy enough to silently introduce a copyWithZone: method that > does the right thing, but that won't work when someone tries to > implement a copyWithZone: method in Python (e.g. for customizing the > copy). > > When someone adds 'def copyWithZone_(self, zone)' to a new class, we > cannot insert the generic PyObjC-copyWithZone: implementation without > either adding serious hacks, e.g. looking for calls to the super-class > implementation of copyWithZone: and replacing them by calls to a > helper function, or changing the semantics. > > The best option seems to be to change the interface for copyWithZone_: > if you implement copyWithZone_ in Python it must have the following > interface: > > def copyWithZone_(self, zone, copy): > # Update copy here > return copy > > > I don't really like this, but don't see how we can have the normal > semantics and yet be able to insert our own method into the > call-chain. The reason I don't like this is that this interface > can/should only be used when subclassing a class that implements > NSCopying. > > Luckily we can give a usefull error-message when someone does > implement copyWithZone_ but doesn't use the right inteface. Why not just force a default copy and copyWithZone implementation (as far as Python is concerned), and instead use the __getstate__ and/or __reduce__ method of copying python things? -bob |
From: Ronald O. <ous...@ci...> - 2004-03-28 19:26:53
|
On 28-mrt-04, at 18:36, Burris T. Ewell wrote: > Another clue: > > *** malloc[5538]: error for object 0x5b9f00: Double free > > Somewhere, memory management is going awry. That's consistent with my diagnosis. I'm thinking about a fix for this, but I have not yet found a good solution for this. The problem is that __dict__ and attributes introduced by __slots__ are 'PyObject*' attributes when you look at the object from Objective-C. These are copied by the default copyWithZone: but without updating the reference count (Py_INCREF-ing the value). That means we're hosed when copy/copyWithZone: is used, because it is not possible to fix the reference count using Python code. It is easy enough to silently introduce a copyWithZone: method that does the right thing, but that won't work when someone tries to implement a copyWithZone: method in Python (e.g. for customizing the copy). When someone adds 'def copyWithZone_(self, zone)' to a new class, we cannot insert the generic PyObjC-copyWithZone: implementation without either adding serious hacks, e.g. looking for calls to the super-class implementation of copyWithZone: and replacing them by calls to a helper function, or changing the semantics. The best option seems to be to change the interface for copyWithZone_: if you implement copyWithZone_ in Python it must have the following interface: def copyWithZone_(self, zone, copy): # Update copy here return copy I don't really like this, but don't see how we can have the normal semantics and yet be able to insert our own method into the call-chain. The reason I don't like this is that this interface can/should only be used when subclassing a class that implements NSCopying. Luckily we can give a usefull error-message when someone does implement copyWithZone_ but doesn't use the right inteface. Ronald > > burris > > On Mar 27, 2004, at 11:24 PM, Ronald Oussoren wrote: > >> >> On 28-mrt-04, at 4:11, Burris T. Ewell wrote: >> >>> Okay, I've removed all of the threads from my application. It's >>> completely kosher. I use NSTasks for the workers, and DO for >>> callbacks. It works just fine most of the time. When I click >>> around between rows, especially when one or more rows are getting >>> frequent updates, I get the weird crash with the disappearing >>> attribute when the cell is redrawing. A race condition that causes >>> objects to get decref'd? >> >> From Subclassing NSCell at >> http://developer.apple.com/documentation/Cocoa/Conceptual/ >> ControlCell/index.html#//apple_ref/doc/uid/10000015i: >> >> <quote> >> If the subclass contains instance variables that hold pointers to >> objects, consider overriding copyWithZone: to duplicate the objects. >> The default version copies only pointers to the objects. >> </quote> >> >> You should implemented copyWithZone: unless you subclass has >> '__slots__ = ()', otherwise the copy of a cell will share its >> __dict__ with the original, without updating the reference count. >> That will give problems later on. >> >> Ronald >> -- >> X|support bv http://www.xsupport.nl/ >> T: +31 610271479 F: +31 204416173 >> > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: IBM Linux Tutorials > Free Linux tutorial presented by Daniel Robbins, President and CEO of > GenToo technologies. Learn everything from fundamentals to system > administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click > _______________________________________________ > Pyobjc-dev mailing list > Pyo...@li... > https://lists.sourceforge.net/lists/listinfo/pyobjc-dev > > -- X|support bv http://www.xsupport.nl/ T: +31 610271479 F: +31 204416173 |
From: Burris T. E. <bu...@gi...> - 2004-03-28 16:43:53
|
Perhaps this stack trace will help. Even though I build pyobjc with --debug I still don't seem to get debugging symbols... burris #0 0x95f71abc in _PyObject_New #1 0x002cb6b0 in PyObjC_CreateRegisteredStruct #2 0x002b845c in pythonify_c_struct #3 0x002b725c in pythonify_c_value #4 0x002b8530 in pythonify_c_struct #5 0x002b725c in pythonify_c_value #6 0x002ca92c in method_stub #7 0x002cde34 in ffi_closure_helper_DARWIN #8 0x002ce1c4 in ffi_closure_ASM #9 0x92e9f310 in -[NSCell drawWithFrame:inView:] #10 0x92ded704 in -[NSTableView drawRow:clipRect:] #11 0x92e1eecc in -[NSTableView drawRect:] #12 0x92dc73e8 in -[NSView _drawRect:clip:] #13 0x92dc3948 in -[NSView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect: rectIsVisibleRectForView:topView:] #14 0x92dc3bd8 in -[NSView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect: rectIsVisibleRectForView:topView:] #15 0x92dc3bd8 in -[NSView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect: rectIsVisibleRectForView:topView:] #16 0x92dc3bd8 in -[NSView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect: rectIsVisibleRectForView:topView:] #17 0x92dc3bd8 in -[NSView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect: rectIsVisibleRectForView:topView:] #18 0x92e10518 in -[NSFrameView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect: rectIsVisibleRectForView:topView:] #19 0x92df76e8 in -[NSThemeFrame _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect: rectIsVisibleRectForView:topView:] #20 0x92dd49b8 in -[NSView _displayRectIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:] #21 0x92ded8d0 in -[NSView displayIfNeeded] #22 0x92dfe598 in -[NSWindow displayIfNeeded] #23 0x92ddecc0 in -[NSImage compositeToPoint:fromRect:operation:fraction:] #24 0x90191ed0 in __CFRunLoopDoObservers #25 0x9019176c in __CFRunLoopRun #26 0x901960bc in CFRunLoopRunSpecific #27 0x927d632c in GetWindowList #28 0x927dca0c in GetMainEventQueue #29 0x927feb28 in BlockUntilNextEventMatchingListInMode #30 0x92dd25b8 in _DPSNextEvent #31 0x92de8f34 in -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] #32 0x92e581c8 in -[NSCell trackMouse:inRect:ofView:untilMouseUp:] #33 0x92e7da6c in -[NSTableView mouseDown:] #34 0x92df9368 in -[NSViewRectCache cacheRect:] #35 0x92df9368 in -[NSViewRectCache cacheRect:] #36 0x92e027c4 in -[NSWindow sendEvent:] #37 0x92df4e98 in -[NSApplication sendEvent:] #38 0x92dfd2a0 in -[NSApplication run] #39 0x92eb95f0 in NSApplicationMain #40 0x0063705c in objc_NSApplicationMain #41 0x95fa94a8 in PyEval_GetFuncDesc #42 0x95fa6c64 in PyEval_EvalCode #43 0x95fa7e30 in PyEval_EvalCodeEx #44 0x95fa97dc in PyEval_GetFuncDesc #45 0x95fa9580 in PyEval_GetFuncDesc #46 0x95fa6c64 in PyEval_EvalCode #47 0x95fa7e30 in PyEval_EvalCodeEx #48 0x95fa4734 in PyEval_EvalCode #49 0x95fc85f0 in PyRun_FileExFlags #50 0x95fc7668 in PyRun_SimpleFileExFlags #51 0x000083f8 in ?? #52 0x00007e3c in ?? #53 0x00007cb0 in ?? |