From vip at avatar.com.au Wed Jul 1 00:13:47 2009 From: vip at avatar.com.au (DavidW) Date: Wed, 1 Jul 2009 08:13:47 +1000 Subject: [Pythonmac-SIG] MacPython v2.5 on OS 10.5 yet? Message-ID: <603452B4-4E95-407F-AD79-67E35ABC81F4@avatar.com.au> On http://www.python.org/download/mac/ we read > Python comes pre-installed on Mac OS X, but due to Apple's release > cycle, it's often one or even two years old. The overwhelming > recommendation of the "MacPython" community is to upgrade your > Python by downloading and installing a newer version from the Python > standard release page. > > If you are using Mac OS X 10.5, see the Leopard wiki page for > detailed information. > The Leopard wiki page (http://wiki.python.org/moin/MacPython/Leopard) says > Python releases have progressed far enough that it may be worth > installing the current MacPythondistribution, however there may be > conflicts between MacPython installations and Mac OS X development > tools, such as problems building PyObjC applications in Xcode. Mac > OS X 10.5.x (Leopard) comes with the 2.5.1 Python distribution pre- > installed, with an integrated Python Launcher.app. At the time of > Leopard's launch, the official release version of Python was also > 2.5.1. So some users may wish to avoid installing the pythonmac.org > distribution and use the built-in python. (EditText (last edited 2009-04-28) Is this still current? Have the issues been resolved to the point of being able to unconditionally recommend say v2.5 or 2.5 on OX10.5? ________________________________________________ David Worrall. - Experimental Polymedia: worrall.avatar.com.au - Sonification: www.sonifiction.com.au - Education for Financial Independence: www.mindthemarkets.com.au From santagada at gmail.com Wed Jul 1 03:16:18 2009 From: santagada at gmail.com (Leonardo Santagada) Date: Tue, 30 Jun 2009 22:16:18 -0300 Subject: [Pythonmac-SIG] MacPython v2.5 on OS 10.5 yet? In-Reply-To: <603452B4-4E95-407F-AD79-67E35ABC81F4@avatar.com.au> References: <603452B4-4E95-407F-AD79-67E35ABC81F4@avatar.com.au> Message-ID: <6582F594-567E-4B7E-8BDB-053B5885CEC0@gmail.com> On Jun 30, 2009, at 7:13 PM, DavidW wrote: > > On http://www.python.org/download/mac/ we read >> Python comes pre-installed on Mac OS X, but due to Apple's release >> cycle, it's often one or even two years old. The overwhelming >> recommendation of the "MacPython" community is to upgrade your >> Python by downloading and installing a newer version from the >> Python standard release page. >> >> If you are using Mac OS X 10.5, see the Leopard wiki page for >> detailed information. >> > The Leopard wiki page (http://wiki.python.org/moin/MacPython/ > Leopard) says > >> Python releases have progressed far enough that it may be worth >> installing the current MacPythondistribution, however there may be >> conflicts between MacPython installations and Mac OS X development >> tools, such as problems building PyObjC applications in Xcode. Mac >> OS X 10.5.x (Leopard) comes with the 2.5.1 Python distribution pre- >> installed, with an integrated Python Launcher.app. At the time of >> Leopard's launch, the official release version of Python was also >> 2.5.1. So some users may wish to avoid installing the pythonmac.org >> distribution and use the built-in python. > (EditText (last edited 2009-04-28) > > Is this still current? Have the issues been resolved to the point of > being able to unconditionally recommend say v2.5 or 2.5 on OX10.5? I remember that Google App Engine had troubles with default python on osx. Also there was probably a reason for python versions 2.5.2, 2.5.3 and 2.5.4 be released (and you could look on the changelog). I would say that if none of the bugs that were fixed on python 2.5.1 onward affect you, you have no need to upgrade. Maybe someone has a better answer than mine... What I don't understand is why apple doesn't update the python package on new minor releases... they do ship some new libraries why not python? -- Leonardo Santagada santagada at gmail.com From dwf at cs.toronto.edu Wed Jul 1 05:59:04 2009 From: dwf at cs.toronto.edu (David Warde-Farley) Date: Tue, 30 Jun 2009 23:59:04 -0400 Subject: [Pythonmac-SIG] MacPython v2.5 on OS 10.5 yet? In-Reply-To: <6582F594-567E-4B7E-8BDB-053B5885CEC0@gmail.com> References: <603452B4-4E95-407F-AD79-67E35ABC81F4@avatar.com.au> <6582F594-567E-4B7E-8BDB-053B5885CEC0@gmail.com> Message-ID: <7A7CAD67-FB6D-4233-9059-11130D7F9144@cs.toronto.edu> On 30-Jun-09, at 9:16 PM, Leonardo Santagada wrote: > I remember that Google App Engine had troubles with default python > on osx. Also there was probably a reason for python versions 2.5.2, > 2.5.3 and 2.5.4 be released (and you could look on the changelog). I > would say that if none of the bugs that were fixed on python 2.5.1 > onward affect you, you have no need to upgrade. Google App Engine, do you mean the dev environment? You're probably better off using Python.org Python for that, yes, since the 10.5 System Python predates GAE by a fair while. .. > What I don't understand is why apple doesn't update the python > package on new minor releases... they do ship some new libraries why > not python? In short, not many system-critical apps depend on Python (if any) and Apple just doesn't see it a big enough deal to commit resources to updates. I don't think they update Ruby or Perl either (irb --version tells me I'm running a release from 2005). If you disagree, you should voice your concern to Apple. Also, Python.org provides binaries for the most up-to-date releases, and users of course are free to build it from source themselves. AFAIK PyObjC now easy_install's fine with these builds, so the only thing missing will be the closed-source stuff that Apple doesn't make public (i.e. the CoreGraphics SWIG wrappers which seem to be leaky anyway). David From lists at mostrom.pp.se Wed Jul 1 07:05:20 2009 From: lists at mostrom.pp.se (=?UTF-8?Q?Ja=6E_E=72ik_M=6Fs=74=72=C3=B6?= =?UTF-8?Q?m?=) Date: Wed, 1 Jul 2009 07:05:20 +0200 Subject: [Pythonmac-SIG] Trying to use appscript need some help In-Reply-To: <1A76DCF6-7539-4C1E-93B6-9726FFD497F2@virgin.net> Message-ID: On 09-06-30 at 21.15, has wrote: >ASTranslate is wrong here; it should be 'date_' with a trailing >underscore, not 'date'. Thanks, now it works perfectly jem -- Jan Erik Mostr?m, http://mostrom.eu From howes at ll.mit.edu Wed Jul 1 17:46:42 2009 From: howes at ll.mit.edu (Brad Howes) Date: Wed, 1 Jul 2009 11:46:42 -0400 Subject: [Pythonmac-SIG] Pyslimp3: Python iTunes Controller using SLiMP3 Message-ID: <567C7A5C-8C9B-415B-8B7F-36E8C56FA045@ll.mit.edu> FYI, I created a new projected on Google Code called Pyslimp3 that interfaces the original SlimDevices SLiMP3 player + remote control with iTunes using Python and appscript. Although this may be an esoteric application that only I use, I thought others might be interested in the iTunesXML module that loads the iTunes XML file and interacts with iTunes via appscript. You can download the software using Subversion (sorry, no tarballs yet). The project page is at http://code.google.com/p/pyslimp3/ Enjoy! Brad -- Brad Howes Group 42 MIT Lincoln Laboratory ? 244 Wood St. ? Lexington, MA 02173 Phone: 781.981.5292 ? Fax: 781.981.3495 ? Secretary: 781.981.7420 From howes at ll.mit.edu Wed Jul 1 17:46:42 2009 From: howes at ll.mit.edu (Brad Howes) Date: Wed, 1 Jul 2009 11:46:42 -0400 Subject: [Pythonmac-SIG] Pyslimp3: Python iTunes Controller using SLiMP3 Message-ID: <567C7A5C-8C9B-415B-8B7F-36E8C56FA045@ll.mit.edu> FYI, I created a new projected on Google Code called Pyslimp3 that interfaces the original SlimDevices SLiMP3 player + remote control with iTunes using Python and appscript. Although this may be an esoteric application that only I use, I thought others might be interested in the iTunesXML module that loads the iTunes XML file and interacts with iTunes via appscript. You can download the software using Subversion (sorry, no tarballs yet). The project page is at http://code.google.com/p/pyslimp3/ Enjoy! Brad -- Brad Howes Group 42 MIT Lincoln Laboratory ? 244 Wood St. ? Lexington, MA 02173 Phone: 781.981.5292 ? Fax: 781.981.3495 ? Secretary: 781.981.7420 From LChou at PLXTech.com Fri Jul 3 08:45:04 2009 From: LChou at PLXTech.com (Lance Chou) Date: Thu, 2 Jul 2009 23:45:04 -0700 Subject: [Pythonmac-SIG] py2app failed to pack codes with wxPython Message-ID: <0684F6CF442FC14E8A8DF086E9F6083C4B3F66@exch2003.plx.plxtech.com> Hi All, Recently, I have been trying to pack my application on Mac OS X. The application is written in Python and wxPython for its UI. I pack it by following the tutorial shown on the py2app website. The packing is successful but encountes exception while running it. According to the exception messages, it shows the application cannot find the library "wx.lib.platebtn". It reminds me of when I ran my application on Mac OS X with python interpretor, the python interpretor also complaint about missing library "wx.lib.platebtn". After I re-installed wxPython, it can be run successfully. When I pack my application on Mac OS X, the problem comes again. I'm wondering if there's any solution that I could tell py2app to include the library in when packing it. Any comments or helps are appreciative. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Brendan.Simon at eTRIX.com.au Sat Jul 4 02:30:29 2009 From: Brendan.Simon at eTRIX.com.au (Brendan Simon (eTRIX)) Date: Sat, 04 Jul 2009 10:30:29 +1000 Subject: [Pythonmac-SIG] py2app failed to pack codes with wxPython In-Reply-To: References: Message-ID: <4A4EA2A5.2080803@eTRIX.com.au> pythonmac-sig-request at python.org wrote: > Subject: > [Pythonmac-SIG] py2app failed to pack codes with wxPython > From: > "Lance Chou" > Date: > Thu, 2 Jul 2009 23:45:04 -0700 > > > Hi All, > > > > Recently, I have been trying to pack my application on Mac OS X. The > application is written in Python and wxPython for its UI. > > I pack it by following the tutorial shown on the py2app website. The > packing is successful but encountes exception while running it. > > According to the exception messages, it shows the application cannot > find the library ?wx.lib.platebtn?. It reminds me of when I ran my > application on Mac OS X with python interpretor, the python > interpretor also complaint about missing library ?wx.lib.platebtn?. > After I re-installed wxPython, it can be run successfully. > > When I pack my application on Mac OS X, the problem comes again. I?m > wondering if there?s any solution that I could tell py2app to include > the library in when packing it. > > > > Any comments or helps are appreciative. > It's not installed as an egg is it ??? Py2App doesn't deal with eggs yet. -------------- next part -------------- A non-text attachment was scrubbed... Name: Brendan_Simon.vcf Type: text/x-vcard Size: 279 bytes Desc: not available URL: From tangle1 at mindspring.com Wed Jul 8 02:06:52 2009 From: tangle1 at mindspring.com (tangle1 at mindspring.com) Date: Tue, 7 Jul 2009 20:06:52 -0400 (EDT) Subject: [Pythonmac-SIG] QSettings not working with py2app build Message-ID: <21763241.1247011612870.JavaMail.root@elwamui-cypress.atl.sa.earthlink.net> Hello, I developed a Python2.51/PyQt4 script on Mac which saves data using QSettings. I use py2app to build stand-alone app that I can distribute to other macs without PyQt,Qt. - All is good when running from terminal shell and I verified QSettings saved to file: /Users/dev/Library/Preferences/com.imagemoversdigital.win2mac.plist - I build app using py2app and two bads: i) upon closing app, error window pops up (see attached) ii) no new data is saved to QSettings file. I use QSettings.fileName() method to get file path and display in status field. Even when running in app mode, script returns correct file path. I use callback from SIGNAL("aboutToQuit") to write out QSettings data upon closing. No difference when I used closeEvent(). The crash-on-close behavior goes away if I do not save QSettings data on close Thanks in advance!! Suzanne -------------- next part -------------- A non-text attachment was scrubbed... Name: win2mac_exerr.png Type: image/png Size: 28092 bytes Desc: not available URL: From Brendan.Simon at eTRIX.com.au Fri Jul 10 11:16:27 2009 From: Brendan.Simon at eTRIX.com.au (Brendan Simon (eTRIX)) Date: Fri, 10 Jul 2009 19:16:27 +1000 Subject: [Pythonmac-SIG] open program via a protocol (eg. myapp:command) Message-ID: <4A5706EB.3080007@eTRIX.com.au> I have an OS X python program that is invoked via a uri on a webpage -- eg. "myapp:command" The app is invoked fine (via the plist), but I can't seem to extract the "command" from the system args. sys.argv contains the name of the application and some other values. example: sys.argv[0] = 'myapp sys.argv[1] = '-psn_0_22123800' How can I my program read the _uri_ that caused the program to be invoked. Thanks, Brendan. -------------- next part -------------- A non-text attachment was scrubbed... Name: Brendan_Simon.vcf Type: text/x-vcard Size: 267 bytes Desc: not available URL: From hengist.podd at virgin.net Fri Jul 10 15:13:42 2009 From: hengist.podd at virgin.net (has) Date: Fri, 10 Jul 2009 14:13:42 +0100 Subject: [Pythonmac-SIG] open program via a protocol (eg. myapp:command) In-Reply-To: References: Message-ID: Brendan Simon (eTRIX) wrote: > I have an OS X python program that is invoked via a uri on a webpage > -- > eg. "myapp:command" > > The app is invoked fine (via the plist), but I can't seem to extract > the > "command" from the system args. sys.argv contains the name of the > application and some other values. > example: > sys.argv[0] = 'myapp > sys.argv[1] = '-psn_0_22123800' > > > How can I my program read the _uri_ that caused the program to be > invoked. You need to install an Apple event handler that responds to the GetURL event. Various ways you can do that, depending on whether your Python application is Carbon or Cocoa based, has an event loop or runs in batch mode, uses argvemulation, etc. For more specific advice, provide more details. HTH has -- Control AppleScriptable applications from Python, Ruby and ObjC: http://appscript.sourceforge.net From Brendan.Simon at eTRIX.com.au Fri Jul 10 15:45:31 2009 From: Brendan.Simon at eTRIX.com.au (Brendan Simon (eTRIX)) Date: Fri, 10 Jul 2009 23:45:31 +1000 Subject: [Pythonmac-SIG] open program via a protocol (eg. myapp:command) In-Reply-To: References: Message-ID: <4A5745FB.2040305@eTRIX.com.au> has wrote: > Brendan Simon (eTRIX) wrote: > >> I have an OS X python program that is invoked via a uri on a webpage -- >> eg. "myapp:command" >> >> The app is invoked fine (via the plist), but I can't seem to extract the >> "command" from the system args. sys.argv contains the name of the >> application and some other values. >> example: >> sys.argv[0] = 'myapp >> sys.argv[1] = '-psn_0_22123800' >> >> >> How can I my program read the _uri_ that caused the program to be >> invoked. > > You need to install an Apple event handler that responds to the GetURL > event. Various ways you can do that, depending on whether your Python > application is Carbon or Cocoa based, has an event loop or runs in batch > mode, uses argvemulation, etc. For more specific advice, provide more > details. I'm using wxPython. I think setting argvemulation to True may be the key. I commented it out when adding the plist option as I didn't know the correct way to add to the setup options. DATA_FILES = [] OPTIONS = {'argv_emulation': True} URLTYPES=[ { 'CFBundleURLName' : "MyApp", 'CFBundleURLSchemes' : [ "myapp" ] } ] setup( app=APP, data_files=DATA_FILES, #options={'py2app': OPTIONS}, options=dict(py2app=dict( plist=dict( CFBundleURLTypes=URLTYPES, ), )), setup_requires=['py2app'], ) I will play around and see how I go. Thanks, Brendan. -------------- next part -------------- A non-text attachment was scrubbed... Name: Brendan_Simon.vcf Type: text/x-vcard Size: 267 bytes Desc: not available URL: From codyprecord at gmail.com Fri Jul 10 15:54:53 2009 From: codyprecord at gmail.com (Cody Precord) Date: Fri, 10 Jul 2009 08:54:53 -0500 Subject: [Pythonmac-SIG] open program via a protocol (eg. myapp:command) In-Reply-To: <4A5745FB.2040305@eTRIX.com.au> References: <4A5745FB.2040305@eTRIX.com.au> Message-ID: Hello, On Fri, Jul 10, 2009 at 8:45 AM, Brendan Simon (eTRIX) wrote: > has wrote: >> Brendan Simon (eTRIX) wrote: >> >>> I have an OS X python program that is invoked via a uri on a webpage -- >>> eg. "myapp:command" >>> >>> The app is invoked fine (via the plist), but I can't seem to extract the >>> "command" from the system args. ?sys.argv contains the name of the >>> application and some other values. >>> example: >>> ? sys.argv[0] = 'myapp >>> ? sys.argv[1] = '-psn_0_22123800' >>> >>> >>> How can I my program read the _uri_ that caused the program to be >>> invoked. >> >> You need to install an Apple event handler that responds to the GetURL >> event. Various ways you can do that, depending on whether your Python >> application is Carbon or Cocoa based, has an event loop or runs in batch >> mode, uses argvemulation, etc. For more specific advice, provide more >> details. > > I'm using wxPython. The wx.App object has some builtin method for handling some common apple events. I would have to check the wxWidgets source to remember exactly which event it responds to but you might want to try and override the following method in your App object class. def MacOpenFile(self, filename) IIRC it will be called with the path of the file that is sent to the app for getURL events. If not you need a c extension to add an additional apple event handler to your wxApp object. This is actually quite easy to do, but I think that the above should do what your looking for. Cody From hengist.podd at virgin.net Fri Jul 10 16:21:38 2009 From: hengist.podd at virgin.net (has) Date: Fri, 10 Jul 2009 15:21:38 +0100 Subject: [Pythonmac-SIG] open program via a protocol (eg. myapp:command) In-Reply-To: <4A5745FB.2040305@eTRIX.com.au> References: <4A5745FB.2040305@eTRIX.com.au> Message-ID: <6B2A52DD-9727-46AA-8E78-230E1D8CA657@virgin.net> On 10 Jul 2009, at 14:45, Brendan Simon (eTRIX) wrote: > has wrote: >> Brendan Simon (eTRIX) wrote: >> >>> I have an OS X python program that is invoked via a uri on a >>> webpage -- >>> eg. "myapp:command" >>> [...] >> You need to install an Apple event handler that responds to the >> GetURL >> event. Various ways you can do that, depending on whether your Python >> application is Carbon or Cocoa based, has an event loop or runs in >> batch >> mode, uses argvemulation, etc. For more specific advice, provide more >> details. > > I'm using wxPython. > > I think setting argvemulation to True may be the key. The argvemulation option uses Python 2.x's plat-mac/argvemulation.py module to handle incoming 'open document' Apple events, unpack their direct argument as a list of file paths, and add those paths to sys.argv. It doesn't recognise GetURL events, however. I've no idea if there's anything you need to watch for when Apple events in a wxPython-based application, so you might need to do a bit of research on that front. The basic code for handling a GetURL event should go something like this: from Carbon import AE from Carbon.AppleEvents import * def geturl(requestevent, replyevent): # event handler desc = requestevent.AEGetParamDesc(keyDirectObject, typeUTF8Text) url = desc.data.decode('utf8') # do stuff with URL here... AE.AEInstallEventHandler(kAEInternetSuite, kAEISGetURL, geturl) Studying the argvemulation.py module's implementation may also be informative. HTH has -- Control AppleScriptable applications from Python, Ruby and ObjC: http://appscript.sourceforge.net From Brendan.Simon at eTRIX.com.au Sat Jul 11 04:40:06 2009 From: Brendan.Simon at eTRIX.com.au (Brendan Simon (eTRIX)) Date: Sat, 11 Jul 2009 12:40:06 +1000 Subject: [Pythonmac-SIG] open program via a protocol (eg. myapp:command) In-Reply-To: <6B2A52DD-9727-46AA-8E78-230E1D8CA657@virgin.net> References: <4A5745FB.2040305@eTRIX.com.au> <6B2A52DD-9727-46AA-8E78-230E1D8CA657@virgin.net> Message-ID: <4A57FB86.9060402@eTRIX.com.au> has wrote: > On 10 Jul 2009, at 14:45, Brendan Simon (eTRIX) wrote: > >> has wrote: >>> Brendan Simon (eTRIX) wrote: >>> >>>> I have an OS X python program that is invoked via a uri on a webpage -- >>>> eg. "myapp:command" >>>> [...] >>> You need to install an Apple event handler that responds to the GetURL >>> event. Various ways you can do that, depending on whether your Python >>> application is Carbon or Cocoa based, has an event loop or runs in batch >>> mode, uses argvemulation, etc. For more specific advice, provide more >>> details. >> >> I'm using wxPython. >> >> I think setting argvemulation to True may be the key. > > The argvemulation option uses Python 2.x's plat-mac/argvemulation.py > module to handle incoming 'open document' Apple events, unpack their > direct argument as a list of file paths, and add those paths to > sys.argv. It doesn't recognise GetURL events, however. I can confirm that the url does NOT get added to sys.argv when using argv_emulation :( > I've no idea if there's anything you need to watch for when Apple events > in a wxPython-based application, so you might need to do a bit of > research on that front. The basic code for handling a GetURL event > should go something like this: > > from Carbon import AE > from Carbon.AppleEvents import * > > > def geturl(requestevent, replyevent): # event handler > desc = requestevent.AEGetParamDesc(keyDirectObject, typeUTF8Text) > url = desc.data.decode('utf8') > # do stuff with URL here... > > AE.AEInstallEventHandler(kAEInternetSuite, kAEISGetURL, geturl) > > Studying the argvemulation.py module's implementation may also be > informative. I had a look at argv_emulation.py and it seems to have most of this stuff already. It handles OpenApplication and OpenDocuments Apple Events. Guess the 'proper' thing to do would be to extend argv_emulation.py to handle the IsGetURL event as described above. I will give it a go and post the results. Cheers, Brendan. -------------- next part -------------- A non-text attachment was scrubbed... Name: Brendan_Simon.vcf Type: text/x-vcard Size: 267 bytes Desc: not available URL: From Brendan.Simon at eTRIX.com.au Sat Jul 11 05:35:57 2009 From: Brendan.Simon at eTRIX.com.au (Brendan Simon (eTRIX)) Date: Sat, 11 Jul 2009 13:35:57 +1000 Subject: [Pythonmac-SIG] open program via a protocol (eg. myapp:command) In-Reply-To: <4A57FB86.9060402@eTRIX.com.au> References: <4A5745FB.2040305@eTRIX.com.au> <6B2A52DD-9727-46AA-8E78-230E1D8CA657@virgin.net> <4A57FB86.9060402@eTRIX.com.au> Message-ID: <4A58089D.9040802@eTRIX.com.au> Brendan Simon (eTRIX) wrote: >> I've no idea if there's anything you need to watch for when Apple events >> in a wxPython-based application, so you might need to do a bit of >> research on that front. The basic code for handling a GetURL event >> should go something like this: >> >> from Carbon import AE >> from Carbon.AppleEvents import * >> >> >> def geturl(requestevent, replyevent): # event handler >> desc = requestevent.AEGetParamDesc(keyDirectObject, typeUTF8Text) >> url = desc.data.decode('utf8') >> # do stuff with URL here... >> >> AE.AEInstallEventHandler(kAEInternetSuite, kAEISGetURL, __geturl) >> >> Studying the argvemulation.py module's implementation may also be >> informative. > > I had a look at argv_emulation.py and it seems to have most of this > stuff already. It handles OpenApplication and OpenDocuments Apple > Events. Guess the 'proper' thing to do would be to extend > argv_emulation.py to handle the IsGetURL event as described above. > > I will give it a go and post the results. I registered the __geturl() event handler but it never gets called. How can I determine if the events are being sent to MyApp ?? I tried: $ export AEDebugSends=1; export AEDebugReceives=1 $ open myapp:xyz Obviously some event is causing MyApp to open when I type "open myapp:xyz", but does that actually mean MyApp will receive the event or just some internal framework that causes the application to be launched ?? Thanks, Brendan. -------------- next part -------------- A non-text attachment was scrubbed... Name: Brendan_Simon.vcf Type: text/x-vcard Size: 267 bytes Desc: not available URL: From codyprecord at gmail.com Sat Jul 11 05:55:56 2009 From: codyprecord at gmail.com (Cody Precord) Date: Fri, 10 Jul 2009 22:55:56 -0500 Subject: [Pythonmac-SIG] open program via a protocol (eg. myapp:command) In-Reply-To: <4A58089D.9040802@eTRIX.com.au> References: <4A5745FB.2040305@eTRIX.com.au> <6B2A52DD-9727-46AA-8E78-230E1D8CA657@virgin.net> <4A57FB86.9060402@eTRIX.com.au> <4A58089D.9040802@eTRIX.com.au> Message-ID: Hello, On Jul 10, 2009, at 10:35 PM, Brendan Simon (eTRIX) wrote: > Brendan Simon (eTRIX) wrote: >>> > > I registered the __geturl() event handler but it never gets called. > > How can I determine if the events are being sent to MyApp ?? > I tried: > $ export AEDebugSends=1; export AEDebugReceives=1 > $ open myapp:xyz > > > Obviously some event is causing MyApp to open when I type "open > myapp:xyz", but does that actually mean MyApp will receive the event > or > just some internal framework that causes the application to be > launched ?? Did you see my previous reply (I see it in the archives but not in your replies)? Here it is again. The wx.App object has some builtin method for handling some common apple events. I would have to check the wxWidgets source to remember exactly which event it responds to but you might want to try and override the following method in your App object class. def MacOpenFile(self, filename) IIRC it will be called with the path of the file that is sent to the app for getURL events. If not you need a c extension to add an additional apple event handler to your wxApp object. This is actually quite easy to do (see examples in wxPython wiki), but I think that the above should do what your looking for. Cody From Brendan.Simon at eTRIX.com.au Sat Jul 11 08:31:15 2009 From: Brendan.Simon at eTRIX.com.au (Brendan Simon (eTRIX)) Date: Sat, 11 Jul 2009 16:31:15 +1000 Subject: [Pythonmac-SIG] open program via a protocol (eg. myapp:command) In-Reply-To: References: <4A5745FB.2040305@eTRIX.com.au> <6B2A52DD-9727-46AA-8E78-230E1D8CA657@virgin.net> <4A57FB86.9060402@eTRIX.com.au> <4A58089D.9040802@eTRIX.com.au> Message-ID: <4A5831B3.7040809@eTRIX.com.au> Cody Precord wrote: > Hello, > > On Jul 10, 2009, at 10:35 PM, Brendan Simon (eTRIX) wrote: > >> Brendan Simon (eTRIX) wrote: >>>> >> >> I registered the __geturl() event handler but it never gets called. >> >> How can I determine if the events are being sent to MyApp ?? >> I tried: >> $ export AEDebugSends=1; export AEDebugReceives=1 >> $ open myapp:xyz >> >> >> Obviously some event is causing MyApp to open when I type "open >> myapp:xyz", but does that actually mean MyApp will receive the event or >> just some internal framework that causes the application to be >> launched ?? > > Did you see my previous reply (I see it in the archives but not in your > replies)? Here it is again. > > The wx.App object has some builtin method for handling some common > apple events. I would have to check the wxWidgets source to remember > exactly which event it responds to but you might want to try and > override the following method in your App object class. > > def MacOpenFile(self, filename) > > IIRC it will be called with the path of the file that is sent to the > app for getURL events. If not you need a c extension to add an > additional apple event handler to your wxApp object. This is actually > quite easy to do (see examples in wxPython wiki), but I think that the > above should do what your > looking for. Hi Cody, Yes I did see your previous reply. I implemented the MacOpenFile() method as part of MyApp but it never got called. It didn't work for me. Google searches seemed to suggest that this only worked for applications that were already running, rather than a file that causes an application for be launched. Also, it may not be called for URLs which is what I'm using. You mention a C extension may be needed. I will have a look on the wxPython wiki ... as you suggest :) Brendan. -------------- next part -------------- A non-text attachment was scrubbed... Name: Brendan_Simon.vcf Type: text/x-vcard Size: 267 bytes Desc: not available URL: From Brendan.Simon at eTRIX.com.au Sat Jul 11 12:30:18 2009 From: Brendan.Simon at eTRIX.com.au (Brendan Simon (eTRIX)) Date: Sat, 11 Jul 2009 20:30:18 +1000 Subject: [Pythonmac-SIG] [SOLVED] open program via a protocol (eg. myapp:command) In-Reply-To: <4A5831B3.7040809@eTRIX.com.au> References: <4A5745FB.2040305@eTRIX.com.au> <6B2A52DD-9727-46AA-8E78-230E1D8CA657@virgin.net> <4A57FB86.9060402@eTRIX.com.au> <4A58089D.9040802@eTRIX.com.au> <4A5831B3.7040809@eTRIX.com.au> Message-ID: <4A5869BA.7030007@eTRIX.com.au> Brendan Simon (eTRIX) wrote: > > Cody Precord wrote: >> Hello, >> >> On Jul 10, 2009, at 10:35 PM, Brendan Simon (eTRIX) wrote: >> >>> Brendan Simon (eTRIX) wrote: >>> I registered the __geturl() event handler but it never gets called. I forget to add self to the 'method' that's why it failed. It does in fact get called when the method is defined properly :) I modified argv_emulation.py from the py2app package. Added an event handler for the GetURL to extract the url and append to sys.argv. The code was based on the existing handler for OpenDocuments event and the snippet that 'has' posted (changed typeUTF8Text to typeWildCard as typeUTF8Text didn't exist on my system). Here is the diff. k9m:bootstrap $ diff argv_emulation.py.orig argv_emulation.py 10c10,11 < kAEOpenDocuments, keyDirectObject, typeAEList, typeAlias --- > kAEOpenDocuments, keyDirectObject, typeAEList, typeAlias, \ > kAEInternetSuite, kAEISGetURL, typeWildCard 25a27,29 > #AE.AEInstallEventHandler(kAEInternetSuite, kAEISGetURL, > AE.AEInstallEventHandler('GURL', 'GURL', > self.__geturl) 29a34,35 > #AE.AERemoveEventHandler(kAEInternetSuite, kAEISGetURL) > AE.AERemoveEventHandler('GURL', 'GURL') 93a100,111 > def __geturl(self, requestevent, replyevent): # event handler > try: > listdesc = requestevent.AEGetParamDesc(keyDirectObject, typeAEList) > for i in range(listdesc.AECountItems()): > desc = listdesc.AEGetNthDesc(i+1, typeWildCard)[1] > url = desc.data.decode('utf8') > sys.argv.append(url) > except Exception, e: > print "argvemulator.py warning: can't unpack an GetURL event" > > self._quit() > Should I submit this as a patch somewhere ??? Thanks, Brendan. -------------- next part -------------- A non-text attachment was scrubbed... Name: Brendan_Simon.vcf Type: text/x-vcard Size: 267 bytes Desc: not available URL: From dpeterson at enthought.com Wed Jul 15 21:38:43 2009 From: dpeterson at enthought.com (Dave Peterson) Date: Wed, 15 Jul 2009 14:38:43 -0500 Subject: [Pythonmac-SIG] Trouble getting py2app to create self-contained app bundles Message-ID: <4A5E3043.7040208@enthought.com> Hello, I've been having a lot of trouble getting py2app (version 0.3.6) to create truely self-contained app bundles. I'm thinking that either I'm doing something so obviously wrong, or else py2app doesn't really create self-contained bundles. I've tried using it in both Apple's standard Python framework environment (launch python via /usr/bin/python, site-packages in /Library/Python/2.5/site-packages, etc.) and in an EPD Python framework environment (installs to /Library/Frameworks/Python.framework/Versions/4.3.0). Here's what I'm doing. Does anyone see something wrong? Create a directory tree: /home/dpeterson/temp/ setup.py test/ __init__.py main.py The setup.py looks like this: from setuptools import setup, find_packages setup( name='test', version='0.1', packages=find_packages(), entry_points = dict( console_scripts = [ "test = test.main:main", ], ), # py2app stuff app = ['test/main.py'], options = dict(py2app = dict( extension = '.app', )), setup_requires = ['py2app'], ) The test/__init__.py is an empty file and test/main.py looks like this: def main(): print "Hello, world!" if __name__ == "__main__": main() I then delete any pre-existing build and dist directories, then run "python setup.py py2app" which outputs a lot of stuff, but doesn't report any errors, and then try to run the generated app bundle's executable via "dist/test.app/Contents/MacOS/test" -- it runs and prints "Hello, world!" as expected. BUT there is no Python.framework inside the generated app bundle under the "dist" directory. And indeed, when I look inside dist/test.app/Contents/Info.plist, I see the following lines which seems to imply the bundle is falling back on the Python.framework version 2.5 installed in a system location. PyRuntimeLocations @executable_path/../Frameworks/Python.framework/Versions/2.5/Python /System/Library/Frameworks/Python.framework/Versions/2.5/Python Can anyone see what I'm doing wrong? I want to ensure my distributed app bundle is self-contained and will continue to work even when Apple stops shipping Python 2.5. Actually, I'd ideally like to use EPD to build my app bundle then have it work even if that version of EPD isn't installed on my co-workers machines. But I'd be happy to solve the problem with Apple's python first. Thanks in advance! -- Dave From jliu at hanwave.net Fri Jul 17 20:44:04 2009 From: jliu at hanwave.net (Jeff Liu) Date: Fri, 17 Jul 2009 11:44:04 -0700 (PDT) Subject: [Pythonmac-SIG] Gtk issues In-Reply-To: <23920808.post@talk.nabble.com> References: <786164.38114.qm@web57207.mail.re3.yahoo.com> <23810538.post@talk.nabble.com> <5465ee790906071204y6cdb12a9s77d13fb243c9d384@mail.gmail.com> <23920808.post@talk.nabble.com> Message-ID: <24539725.post@talk.nabble.com> Hi, I have an issue with running configure for pygobject. I'm using the same version 2.12.3 as you, but the configure fails with the error: Could not run GLIB test program. Even passing the option --disable-glibtest doesn't work. The log from config.log seems to report that it can't find glib.h I've set and confirmed that the framework is there under PKG_CONFIG_PATH. I know that this Framework is okay as I've been able to install Perl-GTK bindings and run "zim" with no issues. Any ideas? Like you, I would rather avoid macports of fink if possible. Thanks in advance, Jeff genemartin wrote: > > i type > > PKG_CONFIG_PATH=/Library/Frameworks/GLib.framework/Resources/dev/lib/pkgconfig:/Library/Frameworks/Gtk.framework/Resources/dev/lib/pkgconfig:/Library/Frameworks/Cairo.framework/Resources/dev/lib/pkgconfig:/Library/Frameworks/Python.framework/Versions/2.5/lib/pkgconfig: > ./configure --prefix=/Library/Frameworks/Python.framework/Versions/2.5 > > with > PKG_CONFIG_PATH=/Library/Frameworks/GLib.framework/Resources/dev/lib/pkgconfig: > -> for Glib > /Library/Frameworks/Gtk.framework/Resources/dev/lib/pkgconfig: -> for gtk > /Library/Frameworks/Cairo.framework/Resources/dev/lib/pkgconfig: -> for > cairo > /Library/Frameworks/Python.framework/Versions/2.5/lib/pkgconfig -> for > pygobject.2.0.pc, you need to find this file in your system > ./configure --prefix=/Library/Frameworks/Python.framework/Versions/2.5 -> > my python (MacPython and no system python) > -- View this message in context: http://www.nabble.com/Gtk-issues-tp23803508p24539725.html Sent from the Python - pythonmac-sig mailing list archive at Nabble.com. From jliu at hanwave.net Fri Jul 17 20:41:41 2009 From: jliu at hanwave.net (Jeff Liu) Date: Fri, 17 Jul 2009 11:41:41 -0700 (PDT) Subject: [Pythonmac-SIG] Gtk issues In-Reply-To: <23920808.post@talk.nabble.com> References: <786164.38114.qm@web57207.mail.re3.yahoo.com> <23810538.post@talk.nabble.com> <5465ee790906071204y6cdb12a9s77d13fb243c9d384@mail.gmail.com> <23920808.post@talk.nabble.com> Message-ID: <24539693.post@talk.nabble.com> Hi, I have an issue with running configure for pygobject. I'm using the same version 2.12.3 as you, but the configure fails with the error: Could not run GLIB test program. Even passing the option --disable-glibtest doesn't work. The log from config.log seems to report that it can't find glib.h I've set and confirmed that the framework is there under PKG_CONFIG_PATH. I know that this Framework is okay as I've been able to install Perl-GTK bindings and run "zim" with no issues. Any ideas? Like you, I would rather avoid macports of fink if possible. Thanks in advance, Jeff genemartin wrote: > > i type > > PKG_CONFIG_PATH=/Library/Frameworks/GLib.framework/Resources/dev/lib/pkgconfig:/Library/Frameworks/Gtk.framework/Resources/dev/lib/pkgconfig:/Library/Frameworks/Cairo.framework/Resources/dev/lib/pkgconfig:/Library/Frameworks/Python.framework/Versions/2.5/lib/pkgconfig: > ./configure --prefix=/Library/Frameworks/Python.framework/Versions/2.5 > > with > PKG_CONFIG_PATH=/Library/Frameworks/GLib.framework/Resources/dev/lib/pkgconfig: > -> for Glib > /Library/Frameworks/Gtk.framework/Resources/dev/lib/pkgconfig: -> for gtk > /Library/Frameworks/Cairo.framework/Resources/dev/lib/pkgconfig: -> for > cairo > /Library/Frameworks/Python.framework/Versions/2.5/lib/pkgconfig -> for > pygobject.2.0.pc, you need to find this file in your system > ./configure --prefix=/Library/Frameworks/Python.framework/Versions/2.5 -> > my python (MacPython and no system python) > -- View this message in context: http://www.nabble.com/Gtk-issues-tp23803508p24539693.html Sent from the Python - pythonmac-sig mailing list archive at Nabble.com. From charles.hartman at conncoll.edu Mon Jul 20 20:22:37 2009 From: charles.hartman at conncoll.edu (Charles Hartman) Date: Mon, 20 Jul 2009 14:22:37 -0400 Subject: [Pythonmac-SIG] py2app refresher? Message-ID: <338812E1-826D-42D3-A70C-0BA83E529A79@conncoll.edu> Sorry, I know this is elementary. I haven't used py2app in a couple of years and I think things have changed. I'm using Python 2.6.2, wxPython (current), py2app 0.3.6, and a fresh download of setuptools. My setup.py for my app contains the newer style "from setuptools import setup" rather than the old "from distutils.core import setup". Things seem to work until near the end, when I get a message about a missing Info.plist file. Traceback pasted below. Am I just missing something stupid, or has something changed I don't know about, or have I failed to update something I needed to update? Thanks for any guidance. Charles Hartman copying /Library/Frameworks/Python.framework/Versions/2.6/Resources/ Info.plist -> /Users/chartman/Documents/Python/Concord/dist/ Concord.app/Contents/Frameworks/Python.framework/Versions/2.6/Resources Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/2.6/lib/ python2.6/site-packages/py2app-0.3.6-py2.6.egg/py2app/build_app.py", line 548, in _run self.run_normal() File "/Library/Frameworks/Python.framework/Versions/2.6/lib/ python2.6/site-packages/py2app-0.3.6-py2.6.egg/py2app/build_app.py", line 619, in run_normal self.create_binaries(py_files, pkgdirs, extensions, loader_files) File "/Library/Frameworks/Python.framework/Versions/2.6/lib/ python2.6/site-packages/py2app-0.3.6-py2.6.egg/py2app/build_app.py", line 723, in create_binaries mm.mm.run_file(runtime) File "build/bdist.macosx-10.3-fat/egg/macholib/MachOGraph.py", line 62, in run_file m = self.findNode(pathname) File "build/bdist.macosx-10.3-fat/egg/macholib/MachOGraph.py", line 55, in findNode newname = self.locate(name) File "build/bdist.macosx-10.3-fat/egg/macholib/MachOStandalone.py", line 30, in locate return self.delegate.locate(newname) File "build/bdist.macosx-10.3-fat/egg/macholib/MachOStandalone.py", line 69, in locate res = self.copy_framework(info) File "/Library/Frameworks/Python.framework/Versions/2.6/lib/ python2.6/site-packages/py2app-0.3.6-py2.6.egg/py2app/build_app.py", line 56, in copy_framework destfn = self.appbuilder.copy_framework(info, self.dest) File "/Library/Frameworks/Python.framework/Versions/2.6/lib/ python2.6/site-packages/py2app-0.3.6-py2.6.egg/py2app/build_app.py", line 789, in copy_framework self.copy_python_framework(info, dst) File "/Library/Frameworks/Python.framework/Versions/2.6/lib/ python2.6/site-packages/py2app-0.3.6-py2.6.egg/py2app/build_app.py", line 817, in copy_python_framework os.path.join(outdir, fn)) File "/Library/Frameworks/Python.framework/Versions/2.6/lib/ python2.6/distutils/cmd.py", line 376, in copy_file dry_run=self.dry_run) File "/Library/Frameworks/Python.framework/Versions/2.6/lib/ python2.6/distutils/file_util.py", line 119, in copy_file "can't copy '%s': doesn't exist or not a regular file" % src DistutilsFileError: can't copy '/Library/Frameworks/Python.framework/ Versions/2.6/Resources/version.plist': doesn't exist or not a regular file > /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/ distutils/file_util.py(119)copy_file() -> "can't copy '%s': doesn't exist or not a regular file" % src From nad at acm.org Tue Jul 21 09:06:55 2009 From: nad at acm.org (Ned Deily) Date: Tue, 21 Jul 2009 00:06:55 -0700 Subject: [Pythonmac-SIG] py2app refresher? References: <338812E1-826D-42D3-A70C-0BA83E529A79@conncoll.edu> Message-ID: In article <338812E1-826D-42D3-A70C-0BA83E529A79 at conncoll.edu>, Charles Hartman wrote: > Sorry, I know this is elementary. I haven't used py2app in a couple > of years and I think things have changed. I'm using Python 2.6.2, > wxPython (current), py2app 0.3.6, and a fresh download of setuptools. > My setup.py for my app contains the newer style "from setuptools > import setup" rather than the old "from distutils.core import setup". > Things seem to work until near the end, when I get a message about a > missing Info.plist file. Traceback pasted below. Try upgrading to py2app (0.4.2) from svn trunk. One of the items in the news file there: "Remove dependency on a 'version.plist' file in the python framework" Something like this (untested) should work (and avoid potential problem due to a setuptools incompatibility with the lastest version of svn): mkdir /tmp/p2a cd /tmp/p2a svn co http://svn.pythonmac.org/py2app/py2app/trunk/ easy_install trunk/ -- Ned Deily, nad at acm.org From charles.hartman at conncoll.edu Tue Jul 21 19:43:03 2009 From: charles.hartman at conncoll.edu (Charles Hartman) Date: Tue, 21 Jul 2009 13:43:03 -0400 Subject: [Pythonmac-SIG] Pythonmac-SIG Digest, Vol 75, Issue 14 In-Reply-To: References: Message-ID: <537A9633-8103-44E5-B80B-D50094F11B50@conncoll.edu> On Jul 21, 2009, at 6:00 AM, pythonmac-sig-request at python.org wrote: > Try upgrading to py2app (0.4.2) from svn trunk. One of the items in > the > news file there: > "Remove dependency on a 'version.plist' file in the python framework" > > Something like this (untested) should work (and avoid potential > problem > due to a setuptools incompatibility with the lastest version of svn): > > mkdir /tmp/p2a > cd /tmp/p2a > svn co http://svn.pythonmac.org/py2app/py2app/trunk/ > easy_install trunk/ Many thanks! Most of this works, but then: Installed /Library/Frameworks/Python.framework/Versions/2.6/lib/ python2.6/site-packages/py2app-0.4.2-py2.6.egg Processing dependencies for py2app==0.4.2 Searching for modulegraph>=0.7.2dev Reading http://pypi.python.org/simple/modulegraph/ Reading http://undefined.org/python/#modulegraph No local packages or download links found for modulegraph>=0.7.2dev error: Could not find suitable distribution for Requirement.parse('modulegraph>=0.7.2dev') I'm afraid I'm too ignorant to know what to do next. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dpeterson at enthought.com Tue Jul 21 20:26:30 2009 From: dpeterson at enthought.com (Dave Peterson) Date: Tue, 21 Jul 2009 13:26:30 -0500 Subject: [Pythonmac-SIG] What py2app options keyword will add everything within a package? Message-ID: <4A660856.4010100@enthought.com> I'm trying to use py2app to build an app bundle for an application that, at runtime, imports different backend packages based on the environment it finds itself running in. It then uses a redirect mechanism to import symbols from within this backend package. Since I know what I'm bundling, I know what packages to include but I can't seem to figure out how to tell py2app to include *ALL* modules within that package, i.e. all modules in all sub-packages. My situation is also complicated by the fact that the package in question is inside of a namespace package. I've tried various combinations of things such as: 1) setting 'includes' to 'python.path.to.package.*' but that only includes the modules in the top-level of the package 2) setting 'packages' to 'python.path.to.package' but I get an error saying that "No module to 'path' (because 'python' is a namespace package?) and a bunch of other attempts. BTW: Are there some docs that clearly describe the difference between the options 'includes', 'packages', 'modules'? I can't seem to find any after numerous searches for py2app or py2exe docs. -- Dave From sanroque.tech at gmail.com Tue Jul 21 21:55:27 2009 From: sanroque.tech at gmail.com (Preston Holmes) Date: Tue, 21 Jul 2009 12:55:27 -0700 Subject: [Pythonmac-SIG] pyobjc and multiprocessing Message-ID: <226F75DF-C389-4507-AA62-4C20DD0F78BF@gmail.com> I'm wondering if there is a way to "repair" the broken interaction between pyobjc and the multiprocessing module I'm trying out. Trying to fire up a runloop inside a forked process (a multiprocessing.Process object) gives the following: The process has forked and you cannot use this CoreFoundation functionality safely. You MUST exec(). Break on __THE_PROCESS_HAS_FORKED_AND_YOU_CANNOT_USE_THIS_COREFOUNDATION_FUNCTIONALITY___YOU_MUST_EXEC__ () to debug. This page explains it well enough: http://lists.apple.com/archives/cocoa-dev//2005/Jan/msg00676.html The question is, from the child python process can I do the equiv of exec() to fix the state of the CoreFoundation libraries? I've tried reloading() the Cocoa module - but that did not suffice. -Preston From nad at acm.org Wed Jul 22 04:52:31 2009 From: nad at acm.org (Ned Deily) Date: Tue, 21 Jul 2009 19:52:31 -0700 Subject: [Pythonmac-SIG] py2app refresher? References: <537A9633-8103-44E5-B80B-D50094F11B50@conncoll.edu> Message-ID: In article <537A9633-8103-44E5-B80B-D50094F11B50 at conncoll.edu>, Charles Hartman wrote: > On Jul 21, 2009, at 6:00 AM, pythonmac-sig-request at python.org wrote: > > Try upgrading to py2app (0.4.2) from svn trunk. One of the items in > > the > > news file there: > > "Remove dependency on a 'version.plist' file in the python framework" > > > > Something like this (untested) should work (and avoid potential > > problem > > due to a setuptools incompatibility with the lastest version of svn): > > > > mkdir /tmp/p2a > > cd /tmp/p2a > > svn co http://svn.pythonmac.org/py2app/py2app/trunk/ > > easy_install trunk/ > Many thanks! Most of this works, but then: > > Installed /Library/Frameworks/Python.framework/Versions/2.6/lib/ > python2.6/site-packages/py2app-0.4.2-py2.6.egg > Processing dependencies for py2app==0.4.2 > Searching for modulegraph>=0.7.2dev > Reading http://pypi.python.org/simple/modulegraph/ > Reading http://undefined.org/python/#modulegraph > No local packages or download links found for modulegraph>=0.7.2dev > error: Could not find suitable distribution for > Requirement.parse('modulegraph>=0.7.2dev') > > I'm afraid I'm too ignorant to know what to do next. Ah, py2app depends on several other packages (modulegraph, macholib, altgraph, maybe others) that may also have updates that have not yet been officially released, so you may need to repeat the above recipe substituting for py2app and a different temporary directory name. -- Ned Deily, nad at acm.org From charles.hartman at conncoll.edu Wed Jul 22 20:12:39 2009 From: charles.hartman at conncoll.edu (Charles Hartman) Date: Wed, 22 Jul 2009 14:12:39 -0400 Subject: [Pythonmac-SIG] py2app refresher Message-ID: <8129C203-842D-447F-8A3B-ED3CFDA0B96D@conncoll.edu> > Date: Tue, 21 Jul 2009 19:52:31 -0700 > From: Ned Deily > To: pythonmac-sig at python.org > Subject: Re: [Pythonmac-SIG] py2app refresher? > Message-ID: > Content-Type: text/plain; charset=US-ASCII > >>> >>> mkdir /tmp/p2a >>> cd /tmp/p2a >>> svn co http://svn.pythonmac.org/py2app/py2app/trunk/ >>> easy_install trunk/ >> Many thanks! Most of this works, but then: >> > > Ah, py2app depends on several other packages (modulegraph, macholib, > altgraph, maybe others) that may also have updates that have not yet > been officially released, so you may need to repeat the above recipe > substituting for py2app and a different temporary directory name. > Thank you. Excellent. I made /tmp/modulegraph and then svn co http://svn.pythonmac.org/modulegraph/modulegraph/trunk/ easy_install trunk/ worked. Then back in /tmp/p2a easy_install trunk/ worked too -- and now py2app makes an app of my app. Cool! I do wish all this were clearer. For people at home with various things off in Terminal land it's simple enough. But there are a fair number of people working with Python who want to do it on Mac but are at home in Python but not in Terminal. -------------- next part -------------- An HTML attachment was scrubbed... URL: From nad at acm.org Thu Jul 23 02:44:18 2009 From: nad at acm.org (Ned Deily) Date: Wed, 22 Jul 2009 17:44:18 -0700 Subject: [Pythonmac-SIG] py2app refresher References: <8129C203-842D-447F-8A3B-ED3CFDA0B96D@conncoll.edu> Message-ID: In article <8129C203-842D-447F-8A3B-ED3CFDA0B96D at conncoll.edu>, Charles Hartman wrote: > I do wish all this were clearer. For people at home with various > things off in Terminal land it's simple enough. But there are a fair > number of people working with Python who want to do it on Mac but are > at home in Python but not in Terminal. Glad it worked. It normally is easier and clearer; py2app and friends could use a new release. -- Ned Deily, nad at acm.org From kw at codebykevin.com Thu Jul 23 05:24:20 2009 From: kw at codebykevin.com (Kevin Walzer) Date: Wed, 22 Jul 2009 23:24:20 -0400 Subject: [Pythonmac-SIG] IDLE edit, format menus hang Message-ID: <4A67D7E4.6030405@codebykevin.com> I'm trying to diagnose a problem with IDLE when it runs on top of Tk-Cocoa, as documented in this bug I filed: http://bugs.python.org/issue6463 Basically, the editor window hangs/freezes when I try to paste, cut, or format text. This requires me to force-quite IDLE. The behavior I'm observing is that the "Edit" menu, for instance, flashes, and then won't release focus. At that point the editor window won't take input and doesn't respond. The problem is that this is very hard to debug. I can't reproduce the issue outside of IDLE's code, which suggests to me that the issue isn't with Tk-Cocoa itself. When I create a simple text display using Tkinter and its standard cut/copy/paste events, things work as expected with no freezes. When I add some "print" statements to EditorWindow.py to try to trace how events are firing, they appear to fire as expected (i.e. "paste" starts out working as normal before hanging). No Python or Tk error messages are printed to output/console, so I can't trace the issue that way either. Any suggestions on other avenues I can look at? I'm a bit stumped here. --Kevin -- Kevin Walzer Code by Kevin http://www.codebykevin.com From aahz at pythoncraft.com Tue Jul 28 19:19:45 2009 From: aahz at pythoncraft.com (Aahz) Date: Tue, 28 Jul 2009 10:19:45 -0700 Subject: [Pythonmac-SIG] What happened to XcodeSupport? Message-ID: <20090728171945.GA18317@panix.com> I have an app built on PyObjC 1.4 that uses XcodeSupport in its setup.py; now I'm trying to build on 2.2b2 and there is no XcodeSupport AFAICT. There's nothing in pyobjc-core/NEWS.txt. Am I missing something? -- Aahz (aahz at pythoncraft.com) <*> http://www.pythoncraft.com/ "Many customs in this life persist because they ease friction and promote productivity as a result of universal agreement, and whether they are precisely the optimal choices is much less important." --Henry Spencer From sanroque.tech at gmail.com Tue Jul 28 19:43:06 2009 From: sanroque.tech at gmail.com (Preston Holmes) Date: Tue, 28 Jul 2009 10:43:06 -0700 Subject: [Pythonmac-SIG] Compiling pylibacl on 10.5 Message-ID: has anyone found the fix to compile this egg: http://pylibacl.sourceforge.net/ Or does anyone else know an alternate method for accessing HFS ACL data? -Preston From magnus.herold at googlemail.com Sun Jul 26 22:50:34 2009 From: magnus.herold at googlemail.com (Magnus Herold) Date: Sun, 26 Jul 2009 22:50:34 +0200 Subject: [Pythonmac-SIG] create appscript reference from aedesc Message-ID: <7cef4a3c0907261350h3d137090u3a3423ac03101602@mail.gmail.com> Hi All, I'm trying to write an Automator action using Python, and I'm not yet that familiar with the lower levels of Mac programming. The input should be a list of iTunes track objects, and I get an NSAppleEventDescriptor object. I know how to extract the AEDescs from that, but I can't find a way turn these into appscript references that I can use normally to say e.g. track.name.set('blabla'). Can someone point me in the right direction? Thanks, Magnus From bernie.hogan at gmail.com Wed Jul 29 20:58:21 2009 From: bernie.hogan at gmail.com (Bernie Hogan) Date: Wed, 29 Jul 2009 14:58:21 -0400 Subject: [Pythonmac-SIG] py2app, iGraph and icns Message-ID: Hi everyone, First post to the list. I have a problem that I'm not sure if anyone else has encountered. I'm trying to make an application that is in many respects a 'skin' over a specific data object (an igraph network object). The iGraph package in python is great for analysis, but it is really a set of c++ objects that have python bindings. So, it completely fails in py2app. Does anyone know a way for me to get the py2app code to naively just include the iGraph package and talk to it such that I don't need to know how it is implemented? To re-implement the features of this package in native python is both a herculean task and one that is bound to be poorly optimized. In addition to ease-of-distribution from py2app, I also want to use a custom icon. wxPython doesn't seem to support .icns the way that py2app does. Any thoughts and any help is greatly appreciated. Take care, BERNiE Bernie Hogan Research Fellow, Oxford Internet Institute University of Oxford From Chris.Barker at noaa.gov Wed Jul 29 21:39:20 2009 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Wed, 29 Jul 2009 12:39:20 -0700 Subject: [Pythonmac-SIG] py2app, iGraph and icns In-Reply-To: References: Message-ID: <4A70A568.7020702@noaa.gov> Bernie Hogan wrote: > I have a problem that I'm not sure if anyone else has encountered. I'm > trying to make an application that is in many respects a 'skin' over a > specific data object (an igraph network object). The iGraph package in > python is great for analysis, but it is really a set of c++ objects > that have python bindings. So, it completely fails in py2app. that shouldn't be the case -- lots of python modules are C++ module with python bindings (that's what wxPython is, for instance) -- what exactly are you doing, and how is it failing? > Does anyone know a way for me to get the py2app code to naively just > include the iGraph package and talk to it such that I don't need to > know how it is implemented? I'm not sure what you mean, but if py2app fails to include something your app needs, you can always just coy it into the bundle in your setup.py script. > In addition to ease-of-distribution from py2app, I also want to use a > custom icon. wxPython doesn't seem to support .icns the way that > py2app does. not quite -- if you give your .icns to py2app it will mostly work, but you may need to make the wxPython call to add the icon to your app, and it may need to be in another format. But it can be done. -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chris.Barker at noaa.gov From janssen at parc.com Thu Jul 30 01:13:15 2009 From: janssen at parc.com (Bill Janssen) Date: Wed, 29 Jul 2009 16:13:15 PDT Subject: [Pythonmac-SIG] how to recover from a framework build? Message-ID: <6054.1248909195@parc.com> I made the mistake of trying to build a version of Python with debugging symbols on my Mac. I downloaded the sources to 2.5.4, and did a "make frameworkinstall DESTDIR=/tmp". Now my Python-Cocoa apps won't compile in Xcode. They compiled just fine before I did this... Line Location Tool:0: symbol(s) not found Line Location Tool:0: _main in main.o Line Location Tool:0: "_PyRun_SimpleFileExFlags", referenced from: Line Location Tool:0: _main in main.o Line Location Tool:0: "_PySys_SetArgv", referenced from: Line Location Tool:0: _main in main.o Line Location Tool:0: "_Py_Initialize", referenced from: Line Location Tool:0: _main in main.o Line Location Tool:0: "_Py_SetProgramName", referenced from: Any ideas? Bill From nad at acm.org Thu Jul 30 02:19:05 2009 From: nad at acm.org (Ned Deily) Date: Wed, 29 Jul 2009 17:19:05 -0700 Subject: [Pythonmac-SIG] how to recover from a framework build? References: <6054.1248909195@parc.com> Message-ID: In article <6054.1248909195 at parc.com>, Bill Janssen wrote: > I made the mistake of trying to build a version of Python with debugging > symbols on my Mac. I downloaded the sources to 2.5.4, and did a "make > frameworkinstall DESTDIR=/tmp". > > Now my Python-Cocoa apps won't compile in Xcode. They compiled just > fine before I did this... > > Line Location Tool:0: symbol(s) not found > Line Location Tool:0: _main in main.o > Line Location Tool:0: "_PyRun_SimpleFileExFlags", referenced from: > Line Location Tool:0: _main in main.o > Line Location Tool:0: "_PySys_SetArgv", referenced from: > Line Location Tool:0: _main in main.o > Line Location Tool:0: "_Py_Initialize", referenced from: > Line Location Tool:0: _main in main.o > Line Location Tool:0: "_Py_SetProgramName", referenced from: > > Any ideas? Long shot (Xcode 3.1.3): in the project's Groups & Files list, select the Python.framework and do a Get Info on it to ensure that the path is set to /System/Library/... . -- Ned Deily, nad at acm.org From janssen at parc.com Thu Jul 30 03:05:37 2009 From: janssen at parc.com (Bill Janssen) Date: Wed, 29 Jul 2009 18:05:37 PDT Subject: [Pythonmac-SIG] how to recover from a framework build? In-Reply-To: References: <6054.1248909195@parc.com> Message-ID: <10580.1248915937@parc.com> Think I fixed things. I found two problems. First of all, my build wasn't universal, but it appparently overwrote the Python framework SDK in /Developer/. So when Xcode tried to build for both ppc and i386, it only found i386. That was the link error I originally posted. I'll re-install Xcode to see if I can fix that. Secondly, when I then ran my Python-Cocoa app, it picked up the framework in /Library/Frameworks/Python..., which didn't have objc, so it bombed on that. I just deleted /Library/Frameworks/Python.... That seemed to fix that. Bill Ned Deily wrote: > In article <6054.1248909195 at parc.com>, Bill Janssen > wrote: > > I made the mistake of trying to build a version of Python with debugging > > symbols on my Mac. I downloaded the sources to 2.5.4, and did a "make > > frameworkinstall DESTDIR=/tmp". > > > > Now my Python-Cocoa apps won't compile in Xcode. They compiled just > > fine before I did this... > > > > Line Location Tool:0: symbol(s) not found > > Line Location Tool:0: _main in main.o > > Line Location Tool:0: "_PyRun_SimpleFileExFlags", referenced from: > > Line Location Tool:0: _main in main.o > > Line Location Tool:0: "_PySys_SetArgv", referenced from: > > Line Location Tool:0: _main in main.o > > Line Location Tool:0: "_Py_Initialize", referenced from: > > Line Location Tool:0: _main in main.o > > Line Location Tool:0: "_Py_SetProgramName", referenced from: > > > > Any ideas? > > Long shot (Xcode 3.1.3): in the project's Groups & Files list, select > the Python.framework and do a Get Info on it to ensure that the path is > set to /System/Library/... . > > -- > Ned Deily, > nad at acm.org > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig From janssen at parc.com Thu Jul 30 22:49:22 2009 From: janssen at parc.com (Bill Janssen) Date: Thu, 30 Jul 2009 13:49:22 PDT Subject: [Pythonmac-SIG] how to recover from a framework build? In-Reply-To: <10580.1248915937@parc.com> References: <6054.1248909195@parc.com> <10580.1248915937@parc.com> Message-ID: <14832.1248986962@parc.com> Bill Janssen wrote: > Think I fixed things. > > I found two problems. First of all, my build wasn't universal, but it > appparently overwrote the Python framework SDK in /Developer/. So when > Xcode tried to build for both ppc and i386, it only found i386. That > was the link error I originally posted. I'll re-install Xcode to see if > I can fix that. By the way, this seems to me to be a bug. There are lots more people working on Python-Cocoa applications than people working on MacPython. I can see where this would be convenient for MacPython developers, but it shouldn't happen automagically. > Secondly, when I then ran my Python-Cocoa app, it picked up the framework > in /Library/Frameworks/Python..., which didn't have objc, so it bombed > on that. I just deleted /Library/Frameworks/Python.... That seemed to > fix that. Can anyone explain to me why this happened? Is this a side-effect of overwriting the /Developer version of the library? Bill From mathew.oakes at aad.gov.au Fri Jul 31 02:10:01 2009 From: mathew.oakes at aad.gov.au (mathew oakes) Date: Fri, 31 Jul 2009 10:10:01 +1000 Subject: [Pythonmac-SIG] Problem in EasyDialogs???[Sec=Unclassified] Message-ID: <1248999001.3965.0.camel@mjoakes-desktop> on Leopard 10.5.6 using python2.6.2 from macports When asking for multiple select in file dialog, get an error: raise Nav.error, arg TypeError: exceptions must be classes or instances, not str I can find the exception declared in this file: /opt/local/Library/Framewords/Python.Framework/Versions/2.6/lib/python2.6/lib-dynload/Nav.so So this is preventing me from finding out what my actual error is, but I notice that the same exception is used elsewhere. files = EasyDialogs.AskFileForOpen( message='Select files to recover:', multiple=True ) cheers, Mat ___________________________________________________________________________ Australian Antarctic Division - Commonwealth of Australia IMPORTANT: This transmission is intended for the addressee only. If you are not the intended recipient, you are notified that use or dissemination of this communication is strictly prohibited by Commonwealth law. If you have received this transmission in error, please notify the sender immediately by e-mail or by telephoning +61 3 6232 3209 and DELETE the message. Visit our web site at http://www.antarctica.gov.au/ ___________________________________________________________________________ From nad at acm.org Fri Jul 31 03:01:45 2009 From: nad at acm.org (Ned Deily) Date: Thu, 30 Jul 2009 18:01:45 -0700 Subject: [Pythonmac-SIG] Problem in EasyDialogs???[Sec=Unclassified] References: <1248999001.3965.0.camel@mjoakes-desktop> Message-ID: In article <1248999001.3965.0.camel at mjoakes-desktop>, mathew oakes wrote: > on Leopard 10.5.6 using python2.6.2 from macports > > When asking for multiple select in file dialog, get an error: > > raise Nav.error, arg > TypeError: exceptions must be classes or instances, not str > > I can find the exception declared in this file: > /opt/local/Library/Framewords/Python.Framework/Versions/2.6/lib/python2.6/lib- > dynload/Nav.so > > So this is preventing me from finding out what my actual error is, but I > notice that the same exception is used elsewhere. > > files = EasyDialogs.AskFileForOpen( message='Select files to recover:', > multiple=True ) It appears that EasyDialogs is still using string exceptions which have been deprecated for some time and finally removed in Python 2.6. Unfortunately, EasyDialogs itself, along with a number of other obsolete Mac modules from the Classic Mac OS ( <= 9) era, have been marked as deprecated in 2.6 and removed in Python 3 so there will be little incentive to fix it, though you're welcome to open an issue on the python bug tracker. If you can, it would be best to migrate away from use of EasyDialogs now. Short of that, you may have better luck with using it from Python 2.5. -- Ned Deily, nad at acm.org From nad at acm.org Fri Jul 31 03:22:06 2009 From: nad at acm.org (Ned Deily) Date: Thu, 30 Jul 2009 18:22:06 -0700 Subject: [Pythonmac-SIG] how to recover from a framework build? References: <6054.1248909195@parc.com> <10580.1248915937@parc.com> Message-ID: [reposting] On Jul 30, 2009, at 13:49 , Bill Janssen wrote: > Bill Janssen wrote: > Think I fixed things. >> I found two problems. First of all, my build wasn't universal, but >> it >> appparently overwrote the Python framework SDK in /Developer/. So >> when >> Xcode tried to build for both ppc and i386, it only found i386. That >> was the link error I originally posted. I'll re-install Xcode to >> see if >> I can fix that. > By the way, this seems to me to be a bug. There are lots more people > working on Python-Cocoa applications than people working on MacPython. > I can see where this would be convenient for MacPython developers, but > it shouldn't happen automagically. Sorry, I don't use Xcode for Python development but I'm having a hard time imagining what sequence of events would have caused the SDK to be overwritten. I'm assuming you mean: /Developer/SDKs/MacOSX10.5.sdk/System/Library/Frameworks/Python.framework Did you try to build Python within Xcode or something? >> Secondly, when I then ran my Python-Cocoa app, it picked up the >> framework >> in /Library/Frameworks/Python..., which didn't have objc, so it >> bombed >> on that. I just deleted /Library/Frameworks/Python.... That >> seemed to >> fix that. > Can anyone explain to me why this happened? Is this a side-effect of > overwriting the /Developer version of the library? The normal install path for a frameworks build is /Library/Frameworks/ Python.frameworks/Version/... . And it appears that /Developer/SDKs/MacOSX10.5.sdk/Library/Frameworks is a symlink to /Library/Frameworks. -- Ned Deily, nad at acm.org From janssen at parc.com Fri Jul 31 04:08:20 2009 From: janssen at parc.com (Bill Janssen) Date: Thu, 30 Jul 2009 19:08:20 PDT Subject: [Pythonmac-SIG] how to recover from a framework build? In-Reply-To: References: <6054.1248909195@parc.com> <10580.1248915937@parc.com> Message-ID: <1518.1249006100@parc.com> Ned Deily wrote: > Sorry, I don't use Xcode for Python development but I'm having a hard > time imagining what sequence of events would have caused the SDK to be > overwritten. I'm assuming you mean: > > /Developer/SDKs/MacOSX10.5.sdk/System/Library/Frameworks/Python.framework > > Did you try to build Python within Xcode or something? Nope. I unpacked the sources to /tmp, then did a "make frameworkinstall", I believe it was. I expected things to wind up in /Library/Frameworks/Python.Framework, which they did. I was surprised to see that the library under /Developer had the same timestamps. > >> Secondly, when I then ran my Python-Cocoa app, it picked up the > >> framework > >> in /Library/Frameworks/Python..., which didn't have objc, so it > >> bombed > >> on that. I just deleted /Library/Frameworks/Python.... That > >> seemed to > >> fix that. > > Can anyone explain to me why this happened? Is this a side-effect of > > overwriting the /Developer version of the library? > > The normal install path for a frameworks build is /Library/Frameworks/ > Python.frameworks/Version/... . And it appears that > /Developer/SDKs/MacOSX10.5.sdk/Library/Frameworks is a symlink to > /Library/Frameworks. Hmmm. OK, that makes it clearer what happened. Here's the link line that Xcode uses (I presume this comes from the Python-Cocoa project template): Ld /p/goodstuff/build/cocoa-gadget.build/Release/goodStuff.build/Objects-normal/ppc/goodStuff normal ppc cd /p/goodstuff setenv MACOSX_DEPLOYMENT_TARGET 10.5 /Developer/usr/bin/gcc-4.0 -arch ppc -isysroot /Developer/SDKs/MacOSX10.5.sdk -L/p/goodstuff/build/Release -F/p/goodstuff/build/Release -filelist /p/goodstuff/build/cocoa-gadget.build/Release/goodStuff.build/Objects-normal/ppc/goodStuff.LinkFileList -mmacosx-version-min=10.5 -framework Cocoa -framework Python -framework WebKit -o /p/goodstuff/build/cocoa-gadget.build/Release/goodStuff.build/Objects-normal/ppc/goodStuff ld warning: in /Developer/SDKs/MacOSX10.5.sdk/Library/Frameworks//Python.framework/Python, file is not of required architecture Undefined symbols: "_Py_SetProgramName", referenced from: _main in main.o "_Py_Initialize", referenced from: _main in main.o "_PySys_SetArgv", referenced from: _main in main.o "_PyRun_SimpleFileExFlags", referenced from: _main in main.o ld: symbol(s) not found collect2: ld returned 1 exit status Apparently gcc resolved "-framework Python" to "/Developer/SDKs/MacOSX10.5.sdk/Library/Frameworks/Python.framework", my new build. But why did it use that in preference to "/Developer/SDKs/MacOSX10.5.sdk/System/Library/Frameworks/Python.framework", which also exists? Ah, the "ld" page says that "The default framework search path is /Library/Frameworks then /System/Library/Frameworks." I probably want to add "-Z -F/System/Library/Frameworks" to the default template. Bill From nad at acm.org Thu Jul 30 23:11:54 2009 From: nad at acm.org (Ned Deily) Date: Thu, 30 Jul 2009 14:11:54 -0700 Subject: [Pythonmac-SIG] how to recover from a framework build? In-Reply-To: <14832.1248986962@parc.com> References: <6054.1248909195@parc.com> <10580.1248915937@parc.com> <14832.1248986962@parc.com> Message-ID: <5870DD97-A302-4F1C-9642-4A117A77881E@acm.org> On Jul 30, 2009, at 13:49 , Bill Janssen wrote: > Bill Janssen wrote: > Think I fixed things. >> I found two problems. First of all, my build wasn't universal, but >> it >> appparently overwrote the Python framework SDK in /Developer/. So >> when >> Xcode tried to build for both ppc and i386, it only found i386. That >> was the link error I originally posted. I'll re-install Xcode to >> see if >> I can fix that. > By the way, this seems to me to be a bug. There are lots more people > working on Python-Cocoa applications than people working on MacPython. > I can see where this would be convenient for MacPython developers, but > it shouldn't happen automagically. Sorry, I don't use Xcode for Python development but I'm having a hard time imagining what sequence of events would have caused the SDK to be overwritten. I'm assuming you mean: /Developer/SDKs/MacOSX10.5.sdk/System/Library/Frameworks/ Python.framework Did you try to build Python within Xcode or something? >> Secondly, when I then ran my Python-Cocoa app, it picked up the >> framework >> in /Library/Frameworks/Python..., which didn't have objc, so it >> bombed >> on that. I just deleted /Library/Frameworks/Python.... That >> seemed to >> fix that. > Can anyone explain to me why this happened? Is this a side-effect of > overwriting the /Developer version of the library? The normal install path for a frameworks build is /Library/Frameworks/ Python.frameworks/Version/... . And it appears that /Developer/SDKs/MacOSX10.5.sdk/Library/Frameworks is a symlink to / Library/Frameworks. -- Ned Deily nad at acm.org -- []