From kw at codebykevin.com Sun Jun 3 03:14:21 2012 From: kw at codebykevin.com (Kevin Walzer) Date: Sat, 2 Jun 2012 21:14:21 -0400 Subject: [Pythonmac-SIG] py2app bug with argv_emulation=True In-Reply-To: References: <9CA8421B-FED4-40F2-A694-6CE55E8FBF1C@mac.com> <4FC5F68B.1060606@codebykevin.com> Message-ID: <8A72C3F7-D3FE-4A4A-9DD9-F9BC5E41C66B@codebykevin.com> You may need to initialize the create command bits later in the app to avoid the open doc event getting swallowed up during startup... Sent from my iPhone On May 31, 2012, at 7:47 AM, "Michael O'Donnell" wrote: > Hi Kevin, Ronald, > > I must be missing something. I have inserted the discussed > code into a test file (test.py) as follows: > > ---------------------- > import sys > from Tkinter import * > import tkMessageBox > > def doOpenFile(*args): > for arg in args: > tkMessageBox._show(message=str(arg), type="ok", icon=tkMessageBox.WARNING) > > tk = Tk() > tk.createcommand("::tk::mac::OpenDocument", doOpenFile) > fr=Frame(tk, height=400, width=400, bg="red") > fr.pack() > tk.mainloop() > ----------------------- > > Then I package this using py2app, specifying that it should launch > whenever a .ctpx file is double clicked: > > ------- > from setuptools import setup > import sys > OPTIONS={'py2app': {'argv_emulation': True, 'resources': [], > 'plist': dict(CFBundleDocumentTypes = [dict( > CFBundleTypeExtensions = ["ctpx"], > CFBundleTypeName = "Test File", > CFBundleTypeRole = "Editor")])}} > sys.argv=[sys.argv[0]] > sys.argv.append("py2app") > setup( > app=['test.py'], > data_files=[], > options=OPTIONS, > setup_requires=['py2app']) > ------ > > Running this creates an app: Test.app. > > If I then click on a file with a .ctpx extension, the application > opens, but doOpenFile is not called (not message pops up). > If I click on the .ctpx file again (while the app is open) the > message DOES appear. > > Now, this is all as I would expect, because my call of > tk.createcommand happens only AFTER my application > launches, and any openDocument event was probably > handled BEFORE the first line of my python code is > executed. > > So none of this is any help to me. My users expect to > double click on a .ctpx document to launch the application > AND open that document for editing. > > Have I missed something? > > Mick > > > > On Wed, May 30, 2012 at 8:29 PM, Kevin Walzer wrote: > > > IDLE can be opened by double clicking on python files, the code I linked > to should be responsible for implementing this. Also, the argv_emulation > code uses the openDocument event to do its work (argv_emulation basicly > runs a Carbon event loop until it has received some openDocument events > or until a timeout occurs). > > Also: > > *smacks head* > > Mick, I didn't realize that you were trying to have your app respond to a file being dropped on the app icon. Ronald is right, argv_emulation is not necessary for this. > > If the code sample Ronald pointed to isn't quite clear, let me explain it a bit more: > > Tk on the Mac supports all of the basic Apple events (app launch, file open, etc.) out of the box -- stub commands are included in the code that you can fill out to trigger an action in response to one of the supported events. > > In the case of opening a file by dropping it on the app icon, or double-clicking it, the relevant Tk command is "tk::mac::OpenDocument" . When this command is defined in Tk, the code contained in the command will be executed when an "odoc" ("open document") event is received. > > To access this functionality from Tkinter, you should use Tkinter's createcommand() function. The "createcommand" functionality allows a Python function/method to be mapped to a Tk command. Hence, in the IDLE example, you have: > > root.createcommand("::tk::mac::OpenDocument", doOpenFile) > > which maps the following code to the "tk::mac::OpenDocument" command: > > def doOpenFile(*args): > for fn in args: > flist.open(fn) > > > Tk's support for this stuff on the Mac, out of the box, is actually quite rich, but it's been poorly documented until quite recently. I contributed documentation on all these commands to the Tk man pages: > > http://www.tcl.tk/man/tcl8.6/TkCmd/tk_mac.htm > > The commands are documented for Tk 8.6, but they are all present in the Cocoa-based version of Tk 8.5 from ActiveState as well, so you may find some useful things to look at here. > > Hope this helps, > Kevin > > -- > Kevin Walzer > Code by Kevin > http://www.codebykevin.com > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG > > > _______________________________________________________ > Unlimited Disk, Data Transfer, PHP/MySQL Domain Hosting > http://www.doteasy.com > -------------- next part -------------- An HTML attachment was scrubbed... URL: From kw at codebykevin.com Sun Jun 3 04:30:45 2012 From: kw at codebykevin.com (Kevin Walzer) Date: Sat, 02 Jun 2012 22:30:45 -0400 Subject: [Pythonmac-SIG] py2app bug with argv_emulation=True In-Reply-To: References: <9CA8421B-FED4-40F2-A694-6CE55E8FBF1C@mac.com> <4FC5F68B.1060606@codebykevin.com> <8A72C3F7-D3FE-4A4A-9DD9-F9BC5E41C66B@codebykevin.com> Message-ID: <4FCACC55.1000009@codebykevin.com> On 6/2/12 9:24 PM, Michael O'Donnell wrote: > Kevin, > > Seems we are not understanding each other. When a user > double clicks on a document associated to the app, the app > is launched. With argv emulation, I could read sys.argv to find > which document was clicked on. > > With openDocument events, the double clicking on a document > opens the application. The openDocument event is consumed > (but at this point, there is only dummy code for this). Then my > code is executed, overwriting the openDocument event handler. > > So, with this approach, there is no way to retrieve WHICH document > was clicked on to open the application. > > Mick > Mick, (ccing back to the list as well) This brute-force method works for me--I double-click a "ctpx" file and the test app launches and then displays a messagebox with the name of the launched file: ---- import sys import time from Tkinter import * import tkMessageBox def doOpenFile(*args): for arg in args: tkMessageBox._show(message=str(arg), type="ok", icon=tkMessageBox.WARNING) tk = Tk() fr=Frame(tk, height=400, width=400, bg="red") fr.pack() time.sleep(2) tk.createcommand("::tk::mac::OpenDocument", doOpenFile) for idx, value in enumerate(sys.argv): print idx, value doOpenFile(sys.argv[1]) tk.mainloop() ---- I'm not sure if this works because you set argv_emulation in py2app's options, since I don't structure my apps this way, and obviously the hard command of "doOpenFile(sys.argv[1])" needs to be wrapped in some sort of try statement to guard against the app being launched without a file argument, but clearly what you want to do can be done. The opendoc event is still useful for dragging the file to the app icon in the Dock, regardless. --Kevin -- Kevin Walzer Code by Kevin http://www.codebykevin.com From micko at wagsoft.com Sun Jun 3 13:03:00 2012 From: micko at wagsoft.com (Michael O'Donnell) Date: Sun, 3 Jun 2012 21:03:00 +1000 Subject: [Pythonmac-SIG] py2app bug with argv_emulation=True In-Reply-To: <4FCACC55.1000009@codebykevin.com> References: <9CA8421B-FED4-40F2-A694-6CE55E8FBF1C@mac.com> <4FC5F68B.1060606@codebykevin.com> <8A72C3F7-D3FE-4A4A-9DD9-F9BC5E41C66B@codebykevin.com> <4FCACC55.1000009@codebykevin.com> Message-ID: Dear Kevin, I don't know why, but your code works for me today, even stripped of the time.sleep(). The initial openDoc event is caught by doOpenFile. I must have slipped up somewhere. Note that the doOpenFile(sys.argv[1]) line was not needed, because without argv_emulation, the clicked file is NOT passed to my app in the arguments (which was the starting point of this thread) Thanks for your help, this was worrying me Mick On Sun, Jun 3, 2012 at 12:30 PM, Kevin Walzer wrote: > On 6/2/12 9:24 PM, Michael O'Donnell wrote: > >> Kevin, >> >> Seems we are not understanding each other. When a user >> double clicks on a document associated to the app, the app >> is launched. With argv emulation, I could read sys.argv to find >> which document was clicked on. >> >> With openDocument events, the double clicking on a document >> opens the application. The openDocument event is consumed >> (but at this point, there is only dummy code for this). Then my >> code is executed, overwriting the openDocument event handler. >> >> So, with this approach, there is no way to retrieve WHICH document >> was clicked on to open the application. >> >> Mick >> >> > Mick, > > (ccing back to the list as well) > > This brute-force method works for me--I double-click a "ctpx" file and the > test app launches and then displays a messagebox with the name of the > launched file: > > ---- > import sys > import time > from Tkinter import * > import tkMessageBox > > def doOpenFile(*args): > for arg in args: > tkMessageBox._show(message=**str(arg), type="ok", > icon=tkMessageBox.WARNING) > > tk = Tk() > fr=Frame(tk, height=400, width=400, bg="red") > fr.pack() > time.sleep(2) > > tk.createcommand("::tk::mac::**OpenDocument", doOpenFile) > for idx, value in enumerate(sys.argv): > print idx, value > doOpenFile(sys.argv[1]) > tk.mainloop() > ---- > > I'm not sure if this works because you set argv_emulation in py2app's > options, since I don't structure my apps this way, and obviously the hard > command of "doOpenFile(sys.argv[1])" needs to be wrapped in some sort of > try statement to guard against the app being launched without a file > argument, but clearly what you want to do can be done. The opendoc event is > still useful for dragging the file to the app icon in the Dock, regardless. > > --Kevin > > -- > Kevin Walzer > Code by Kevin > http://www.codebykevin.com > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From wrw at mac.com Wed Jun 6 02:43:59 2012 From: wrw at mac.com (William R. Wing (Bill Wing)) Date: Tue, 05 Jun 2012 20:43:59 -0400 Subject: [Pythonmac-SIG] Problems with /Library/ScriptingAdditions/Adobe Unit Types.osax Message-ID: <6B0124E6-6B17-4B0A-9B70-46B77FD5C803@mac.com> Hope someone here can help with a work-around. Context: OS-X 10.7.4 (Lion), Python 2.7.3 (downloaded from Python.org and installed in /Library/Frameworks... (not /System/Library), and seems to work just file. However, when I attempt to run any sort of GUI code (either a Tk demo from the Python docs page or a wxPython demo), I get the following error msg: StraylightPro:Python wrw$ python tk_test.py 2012-06-05 20:28:35.442 Python[51697:f07] Error loading /Library/ScriptingAdditions/Adobe Unit Types.osax/Contents/MacOS/Adobe Unit Types: dlopen(/Library/ScriptingAdditions/Adobe Unit Types.osax/Contents/MacOS/Adobe Unit Types, 262): no suitable image found. Did find: /Library/ScriptingAdditions/Adobe Unit Types.osax/Contents/MacOS/Adobe Unit Types: no matching architecture in universal wrapper Python: OpenScripting.framework - scripting addition "/Library/ScriptingAdditions/Adobe Unit Types.osax" declares no loadable handlers. When I first hit this, I was running wxPython2.8 which is based on the Carbon widgets and thus has to run in 32-bit mode. I assumed I was seeing an architecture collision, so downloaded wxPython2.9 Cocoa, which should be 64-bit compatible. Same error. After scratching my head and checking with Google (which knows about this error in conjunction with Adobe CS products but knows nothing about Python), I decided to try a Tk demo, assuming that since the Tk library is bundled with Python, it would be good to go. I got the same identical error again, and in fact (as you can see) the fragment of the terminal session pasted in above was from the Tk test. Color me frustrated. Any help appreciated. Thanks, -Bill -------------- next part -------------- An HTML attachment was scrubbed... URL: From kw at codebykevin.com Wed Jun 6 03:57:57 2012 From: kw at codebykevin.com (Kevin Walzer) Date: Tue, 05 Jun 2012 21:57:57 -0400 Subject: [Pythonmac-SIG] Problems with /Library/ScriptingAdditions/Adobe Unit Types.osax In-Reply-To: <6B0124E6-6B17-4B0A-9B70-46B77FD5C803@mac.com> References: <6B0124E6-6B17-4B0A-9B70-46B77FD5C803@mac.com> Message-ID: <4FCEB925.70101@codebykevin.com> On 6/5/12 8:43 PM, William R. Wing (Bill Wing) wrote: > /Library/ScriptingAdditions/Adobe Unit Types.osax This osax is conflicting not with Python or Tk, but with the Apple Events framework. It's probably PPC or 32-bit only. An updater is available from Adobe. (I've run into this issue with my own apps, which crash when someone has an outdated osax installed--there's no workaround other than to ask the end user to remove or update the library.) -- Kevin Walzer Code by Kevin http://www.codebykevin.com From wrw at mac.com Wed Jun 6 04:36:34 2012 From: wrw at mac.com (William R. Wing (Bill Wing)) Date: Tue, 05 Jun 2012 22:36:34 -0400 Subject: [Pythonmac-SIG] Problems with /Library/ScriptingAdditions/Adobe Unit Types.osax In-Reply-To: <4FCEB925.70101@codebykevin.com> References: <6B0124E6-6B17-4B0A-9B70-46B77FD5C803@mac.com> <4FCEB925.70101@codebykevin.com> Message-ID: <710C5AC0-D101-4169-B8CA-F04DE384EDE5@mac.com> On Jun 5, 2012, at 9:57 PM, Kevin Walzer wrote: > On 6/5/12 8:43 PM, William R. Wing (Bill Wing) wrote: >> /Library/ScriptingAdditions/Adobe Unit Types.osax > > This osax is conflicting not with Python or Tk, but with the Apple Events framework. It's probably PPC or 32-bit only. An updater is available from Adobe. (I've run into this issue with my own apps, which crash when someone has an outdated osax installed--there's no workaround other than to ask the end user to remove or update the library.) > -- > Kevin Walzer > Code by Kevin > http://www.codebykevin.com Thanks, when your note showed up, I had just finished hiding the Adobe .osax file (I finally did find a clue on Google) and discovered that the error msg had gone away. But, to be sure I understand? Is the reason I hadn't run into this problem earlier simply because Tk and wx need to check in with Apple Events so they can get things like mouse clicks, whereas more basic Python scripts don't? That's terrible syntax, but maybe you can see what I'm asking. I've been writing Python scripts for a year or so, and this is the first I've seen of this problem. Thanks, Bill From kw at codebykevin.com Wed Jun 6 15:56:18 2012 From: kw at codebykevin.com (Kevin Walzer) Date: Wed, 06 Jun 2012 09:56:18 -0400 Subject: [Pythonmac-SIG] Problems with /Library/ScriptingAdditions/Adobe Unit Types.osax In-Reply-To: <710C5AC0-D101-4169-B8CA-F04DE384EDE5@mac.com> References: <6B0124E6-6B17-4B0A-9B70-46B77FD5C803@mac.com> <4FCEB925.70101@codebykevin.com> <710C5AC0-D101-4169-B8CA-F04DE384EDE5@mac.com> Message-ID: <4FCF6182.3040601@codebykevin.com> On 6/5/12 10:36 PM, William R. Wing (Bill Wing) wrote: > But, to be sure I understand? Is the reason I hadn't run into this problem earlier simply because Tk and wx need to check in with Apple Events so they can get things like mouse clicks, whereas more basic Python scripts don't? If you post a copy of your code, it would be easier to figure out what's going on. -- Kevin Walzer Code by Kevin http://www.codebykevin.com From wrw at mac.com Wed Jun 6 16:12:52 2012 From: wrw at mac.com (William R. Wing (Bill Wing)) Date: Wed, 06 Jun 2012 10:12:52 -0400 Subject: [Pythonmac-SIG] Problems with /Library/ScriptingAdditions/Adobe Unit Types.osax In-Reply-To: <4FCF6182.3040601@codebykevin.com> References: <6B0124E6-6B17-4B0A-9B70-46B77FD5C803@mac.com> <4FCEB925.70101@codebykevin.com> <710C5AC0-D101-4169-B8CA-F04DE384EDE5@mac.com> <4FCF6182.3040601@codebykevin.com> Message-ID: On Jun 6, 2012, at 9:56 AM, Kevin Walzer wrote: > On 6/5/12 10:36 PM, William R. Wing (Bill Wing) wrote: >> But, to be sure I understand? Is the reason I hadn't run into this problem earlier simply because Tk and wx need to check in with Apple Events so they can get things like mouse clicks, whereas more basic Python scripts don't? > > If you post a copy of your code, it would be easier to figure out what's going on. > > -- > Kevin Walzer > Code by Kevin > http://www.codebykevin.com Probably not worth the bandwidth at this point, but here it is: #!/usr/bin/env python from Tkinter import * class Application(Frame): def say_hi(self): print "hi there, everyone!" def createWidgets(self): self.QUIT = Button(self) self.QUIT["text"] = "QUIT" self.QUIT["fg"] = "red" self.QUIT["command"] = self.quit self.QUIT.pack({"side": "left"}) self.hi_there = Button(self) self.hi_there["text"] = "Hello", self.hi_there["command"] = self.say_hi self.hi_there.pack({"side": "left"}) def __init__(self, master=None): Frame.__init__(self, master) self.pack() self.createWidgets() root = Tk() app = Application(master=root) app.mainloop() root.destroy() That code was copied straight out of the Tk documentation at: http://docs.python.org/library/tk.html and it triggered the error caused by the 32-bit Adobe file in /ScriptingAdditions/ that I'd never seen before. It turns out that Adobe has posted a 64-bit version of the file, although it takes a fair amount of work in a terminal session to get it, set its permissions, ownership, and ACL all properly. But, it still leaves me wondering - why do wxPython and Tkinter need to look at stuff in the ScriptingAdditions area of the OS at all? Thanks for your patience, Bill From kw at codebykevin.com Thu Jun 7 17:20:23 2012 From: kw at codebykevin.com (Kevin Walzer) Date: Thu, 07 Jun 2012 11:20:23 -0400 Subject: [Pythonmac-SIG] Problems with /Library/ScriptingAdditions/Adobe Unit Types.osax In-Reply-To: References: <6B0124E6-6B17-4B0A-9B70-46B77FD5C803@mac.com> <4FCEB925.70101@codebykevin.com> <710C5AC0-D101-4169-B8CA-F04DE384EDE5@mac.com> <4FCF6182.3040601@codebykevin.com> Message-ID: <4FD0C6B7.5010003@codebykevin.com> On 6/6/12 10:12 AM, William R. Wing (Bill Wing) wrote: > But, it still leaves me wondering - why do wxPython and Tkinter need to look at stuff in the ScriptingAdditions area of the OS at all? That one leaves me stumped. There is nothing in your code that appears to be calling Scripting Additions, so I'm not sure. -- Kevin Walzer Code by Kevin http://www.codebykevin.com From mwirth at gmail.com Fri Jun 8 02:16:00 2012 From: mwirth at gmail.com (Mike Wirth) Date: Thu, 7 Jun 2012 17:16:00 -0700 Subject: [Pythonmac-SIG] Serial port IO on Python 2.7.3 on OS X Message-ID: Hi, folks, Newbie (to Python) here. I'm porting a Python app from Windows that talks to a Bluetooth 2.1 device using the serial profile (on WinXP it shows up as two numbered COM ports, one inbound and the other outbound) On the Mac, the device shows up in /dev as: crw-rw-rw- 1 root wheel 18, 7 May 30 23:12 cu.BlueRadios-COM0 On Windows, the app requires me to install pyserial (and pygame for the visual output). On the Mac, where I've installed and am using python 2.7.3 (rather than the pre-installed 2.6.7), my app starts up and acts like it doesn't need to have pyserial installed, but of course, it can't connect to the expected numbered COM port. 1. Do I need the Mac equivalent of pyserial? 2. Or can I just stuff something like '/dev/cu.BlueRadios-COM0' in the app's source code where it expects to open the serial port. 3. Anything special about the Bluetooth serial profile (e.g., setting port properties)? Mike PS: Pointers to the appropriate docs appreciated and I promise to RTFM :-) -------------- next part -------------- An HTML attachment was scrubbed... URL: From p.oberndoerfer at urheberrecht.org Fri Jun 8 09:34:57 2012 From: p.oberndoerfer at urheberrecht.org (=?ISO-8859-1?Q?Pascal_Obernd=F6rfer?=) Date: Fri, 08 Jun 2012 09:34:57 +0200 Subject: [Pythonmac-SIG] Serial port IO on Python 2.7.3 on OS X In-Reply-To: References: Message-ID: <4FD1AB21.7070208@urheberrecht.org> Am 08.06.12 02:16, schrieb Mike Wirth: > Hi, folks, > > Newbie (to Python) here. I'm porting a Python app from Windows that > talks to a Bluetooth 2.1 device using the serial profile (on WinXP it > shows up as two numbered COM ports, one inbound and the other outbound) > On the Mac, the device shows up in /dev as: > > crw-rw-rw- 1 root wheel 18, 7 May 30 23:12 cu.BlueRadios-COM0 > > On Windows, the app requires me to install pyserial (and pygame for the > visual output). > > On the Mac, where I've installed and am using python 2.7.3 (rather than > the pre-installed 2.6.7), my app starts up and acts like it doesn't need > to have pyserial installed, but of course, it can't connect to the > expected numbered COM port. > > 1. Do I need the Mac equivalent of pyserial? > 2. Or can I just stuff something like '/dev/cu.BlueRadios-COM0' in the > app's source code where it expects to open the serial port. > 3. Anything special about the Bluetooth serial profile (e.g., setting > port properties)? > > Mike > > PS: Pointers to the appropriate docs appreciated and I promise to RTFM :-) Hi Mike, More than nine years ago there was a mini-wrapper to detect the serial ports from within Python: http://mail.python.org/pipermail/pythonmac-sig/2003-February/007189.html Unfortunately the link is now obsolet. But there are other prokects still using (extended derivations of) it: http://trac.warp.es/wader/browser/trunk/contrib/osxserialports/osxserialportsmodule.c?rev=371 https://forge.betavine.net/svn/bcm/branches/sms-confirmation/src/core/contrib/osxserialports/ http://intrepid.danplanet.com/pipermail/chirp_devel/2011-May/000027.html If this doesn't work for you, drop me a note offline and I will see if I can find it at home. The rest is actually using pyserial, which has at least worked for me in order to connect to serial2USB devices as well as to a GPS via Bluetooth. Pascal From ronaldoussoren at mac.com Fri Jun 8 12:53:09 2012 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Fri, 08 Jun 2012 12:53:09 +0200 Subject: [Pythonmac-SIG] Serial port IO on Python 2.7.3 on OS X In-Reply-To: References: Message-ID: On 8 Jun, 2012, at 2:16, Mike Wirth wrote: > Hi, folks, > > Newbie (to Python) here. I'm porting a Python app from Windows that talks to a Bluetooth 2.1 device using the serial profile (on WinXP it shows up as two numbered COM ports, one inbound and the other outbound) On the Mac, the device shows up in /dev as: > > crw-rw-rw- 1 root wheel 18, 7 May 30 23:12 cu.BlueRadios-COM0 > > On Windows, the app requires me to install pyserial (and pygame for the visual output). > > On the Mac, where I've installed and am using python 2.7.3 (rather than the pre-installed 2.6.7), my app starts up and acts like it doesn't need to have pyserial installed, but of course, it can't connect to the expected numbered COM port. > > 1. Do I need the Mac equivalent of pyserial? pyserial works fine on OSX. > 2. Or can I just stuff something like '/dev/cu.BlueRadios-COM0' in the app's source code where it expects to open the serial port. Probably. The last time I used pyserial on OSX I just used numeric indexes to probe for the device: for pn in range(10): try: port = serial.Serial(pn, timeout=0.5) break except serial.SerialException: pass else: raise RuntimeError("Cannot find port") The main advantage for me was that the same code works on Windows as well. > 3. Anything special about the Bluetooth serial profile (e.g., setting port properties)? I haven't used Bluetooth, with some luck the exposed serial device can be configured just like any other serial device using pyserial. There is a low-level Bluetooth framework as well, but I don't know if someone has writting python bindings for that. Ronald -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 4788 bytes Desc: not available URL: From mwirth at gmail.com Fri Jun 8 19:56:34 2012 From: mwirth at gmail.com (Mike Wirth) Date: Fri, 8 Jun 2012 10:56:34 -0700 Subject: [Pythonmac-SIG] Fwd: Serial port IO on Python 2.7.3 on OS X In-Reply-To: References: Message-ID: Whoops, meant to send this to the group address. ---------- Forwarded message ---------- From: Mike Wirth Date: Fri, Jun 8, 2012 at 10:55 AM Subject: Re: [Pythonmac-SIG] Serial port IO on Python 2.7.3 on OS X To: Ronald Oussoren Pascal and Ronald, Thanks. I'll let you know what works for me. Mike -------------- next part -------------- An HTML attachment was scrubbed... URL: From micko at wagsoft.com Sat Jun 9 06:19:39 2012 From: micko at wagsoft.com (Michael O'Donnell) Date: Sat, 9 Jun 2012 14:19:39 +1000 Subject: [Pythonmac-SIG] py2app under python 3.2 In-Reply-To: References: Message-ID: Dear all, Does anyone have py2app working under python 3.2? (ActivePython or the standard)? Packaging a simple tkinter app I get: Traceback (most recent call last): File "/Users/micko/Desktop/py2AppPy3test/MakeMacBuild.py", line 15, in setup_requires=['py2app']) File "/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/distutils/core.py", line 109, in setup _setup_distribution = dist = klass(attrs) File "/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/setuptools/dist.py", line 221, in __init__ self.fetch_build_eggs(attrs.pop('setup_requires')) File "/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/setuptools/dist.py", line 245, in fetch_build_eggs parse_requirements(requires), installer=self.fetch_build_egg File "/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/pkg_resources.py", line 576, in resolve dist = best[req.key] = env.best_match(req, self, installer) File "/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/pkg_resources.py", line 822, in best_match return self.obtain(req, installer) # try and download/install File "/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/pkg_resources.py", line 834, in obtain return installer(requirement) File "/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/setuptools/dist.py", line 294, in fetch_build_egg return cmd.easy_install(req) File "/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/setuptools/command/easy_install.py", line 585, in easy_install return self.install_item(spec, dist.location, tmpdir, deps) File "/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/setuptools/command/easy_install.py", line 615, in install_item dists = self.install_eggs(spec, download, tmpdir) File "/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/setuptools/command/easy_install.py", line 805, in install_eggs return self.build_and_install(setup_script, setup_base) File "/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/setuptools/command/easy_install.py", line 1082, in build_and_install self.run_setup(setup_script, setup_base, args) File "/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/setuptools/command/easy_install.py", line 1071, in run_setup run_setup(setup_script, args) File "/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/setuptools/sandbox.py", line 31, in run_setup lambda: exec(compile(open( File "/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/setuptools/sandbox.py", line 73, in run return func() File "/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/setuptools/sandbox.py", line 34, in {'__file__':setup_script, '__name__':'__main__'}) File "setup.py", line 309, in File "/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/distutils/core.py", line 148, in setup dist.run_commands() File "/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/distutils/dist.py", line 917, in run_commands self.run_command(cmd) File "/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/distutils/dist.py", line 936, in run_command cmd_obj.run() File "/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/setuptools/command/bdist_egg.py", line 172, in run self.run_command("egg_info") File "/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/distutils/cmd.py", line 313, in run_command self.distribution.run_command(command) File "/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/distutils/dist.py", line 936, in run_command cmd_obj.run() File "/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/setuptools/command/egg_info.py", line 179, in run self.find_sources() File "/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/setuptools/command/egg_info.py", line 254, in find_sources mm.run() File "/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/setuptools/command/egg_info.py", line 310, in run self.read_template() File "/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/setuptools/command/sdist.py", line 209, in read_template sys.exc_info()[2].tb_next.tb_frame.f_locals['template'].close() File "/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/distutils/text_file.py", line 121, in close self.file.close() AttributeError: 'NoneType' object has no attribute 'close' Using: ActivePython 3.2.2.3 (ActiveState Software Inc.) based on Python 3.2.2 (default, Sep 8 2011, 12:20:30) [GCC 4.2.1 (Apple Inc. build 5664)] on darwin Run on Macosx 10.7.4 (Lion) -------------- next part -------------- An HTML attachment was scrubbed... URL: From ronaldoussoren at mac.com Sat Jun 9 07:41:33 2012 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Sat, 09 Jun 2012 07:41:33 +0200 Subject: [Pythonmac-SIG] py2app under python 3.2 In-Reply-To: References: Message-ID: On 9 Jun, 2012, at 6:19, Michael O'Donnell wrote: > Dear all, > > Does anyone have py2app working under python 3.2? I had it working, but along the way it seems to have suffered from bitrot :-(. I didn't know about this issue though. Could you file a bugreport on http://bitbucket.org/ronaldoussoren/py2app? That way I won't forget to fix this issue. FWIW, I'm currently working on removing the depedency on lib2to3, mostly to make it easier to develop py2app using python 3. I want to move all my own code to python 3 before the end of the year, which should make it a lot less likely that I accidently break python 3 support without noticing. On my short-term todo-list: * Finish the 2to3 removal from py2app and related projects * Fix crasher in the bundle executable: on python3 the application will crash hard when the user passes command-line arguments (open --args) * Work my way through bugreports on my bitbucket repository Ronald -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 4788 bytes Desc: not available URL: From ronaldoussoren at mac.com Tue Jun 12 17:13:25 2012 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Tue, 12 Jun 2012 08:13:25 -0700 Subject: [Pythonmac-SIG] Objective-C experts? Message-ID: <2171D1B9-4310-466D-971B-F62A83E2BA34@mac.com> Hi, I'm running into an odd failure in the PyObjC test suite that is probably caused by a bug in OC_PythonUnicode in the pyobjc-core project. The relevant code looks fine though, and I have no idea what's going on here and would really appriciate if someone that knows Objective-C (and the Python C API) could have a look at the code. In particular, with the following script: import Cocoa # Create Cocoa string: s = Cocoa.CFStringCreateMutableCopy(None, 0, b"****foobar****".decode('ascii')) # Use this as a Cocoa object, instead of using the unicode subclass that's by default used for wrapping s = s.nsstring() trim_chars = u"*" #trim_chars = Cocoa.CFStringCreateWithCString(None, trim_chars, Cocoa.kCFStringEncodingASCII) Cocoa.CFStringTrim(s, trim_chars) print (s) This script prints an unexpected value (the "*" characters are not stripped on both sides), but works fine when the line that translates trim_chars in a Cocoa string is activated. For me te problem only occurs when I run this code with a 64-bit build of python ("arch -x86_64 python2.7 ...") and works fine in a 32-bit build ("arch -i386 python2.7 ..."). I have only tested on OSX 10.7, I'm currently traveling and cannot easily test on other releases. To make life even more interesting, the problem only occurs when "PyObjC_UNICODE_FAST_PATH" is active. It is best to use the version of PyObjC that is in my bitbucket repository to reproduce the problem (http://bitbucket.org/ronaldoussoren/pyobjc). You will have to change Modules/objc/pyobjc.h, I have for now disabled PyObjC_UNICODE_FAST_PATH unconditionally to avoid this problem. The relevant, failing, code is in Modules/objc/OC_PythonUnicode.m. This is a subclass of NSString that is used to proxy Python unicode strings into the Objective-C world. I've already tried disabling the implementation of "-getCharacters:range" and that didn't help. Ronald -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 4788 bytes Desc: not available URL: From ronaldoussoren at mac.com Wed Jun 13 19:16:11 2012 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Wed, 13 Jun 2012 10:16:11 -0700 Subject: [Pythonmac-SIG] Objective-C experts? In-Reply-To: References: <2171D1B9-4310-466D-971B-F62A83E2BA34@mac.com> Message-ID: <31ED61D5-320C-48A2-90D2-4ABE48BC17A2@mac.com> On 13 Jun, 2012, at 2:58, ecir hana wrote: > Hi, > > I'm sorry I don't know what causes that in PyObjC but one option would be to try to do the same in cocoapy: > http://code.google.com/p/cocoa-python/ They don't seem to implement the part of PyObjC that the bug is in. Anyway, I've switched the implementation for the "FAST_PATH" to one that's almost the same as that of the non-fast path, both now delegate to a (hidden) NSString instance. The only difference is that the FAST_PATH uses an NSString that uses the data storage of the PyUnicodeObject as the data storage for the string. That way there is no data duplication. I'm using a simular trick for Python 3.3: the implementation for __realObject__ won't copy data unless it really has to. Ronald -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 4788 bytes Desc: not available URL: From ronaldoussoren at mac.com Wed Jun 13 20:08:07 2012 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Wed, 13 Jun 2012 11:08:07 -0700 Subject: [Pythonmac-SIG] Objective-C experts? In-Reply-To: References: <2171D1B9-4310-466D-971B-F62A83E2BA34@mac.com> Message-ID: <71D96E64-257B-4B73-A8E3-A940EE34ED6B@mac.com> On 13 Jun, 2012, at 2:58, ecir hana wrote: > Hi, > > I'm sorry I don't know what causes that in PyObjC but one option would be to try to do the same in cocoapy: > http://code.google.com/p/cocoa-python/ They don't seem to implement the part of PyObjC that the bug is in. Anyway, I've switched the implementation for the "FAST_PATH" to one that's almost the same as that of the non-fast path, both now delegate to a (hidden) NSString instance. The only difference is that the FAST_PATH uses an NSString that uses the data storage of the PyUnicodeObject as the data storage for the string. That way there is no data duplication. I'm using a simular trick for Python 3.3: the implementation for __realObject__ won't copy data unless it really has to. Ronald -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 4788 bytes Desc: not available URL: From geert at nznl.com Thu Jun 14 12:37:27 2012 From: geert at nznl.com (Geert Dekkers) Date: Thu, 14 Jun 2012 12:37:27 +0200 Subject: [Pythonmac-SIG] status pyobjc on osx Message-ID: hi Ik have a project i originally did in 2008 which uses pyobjc for coregraphics functionality. Obviously python on osx has moved forward since then, and i see that the included python libs no longer include pyobjc. I've been working around that, but what do the list members recommend to keep pyobjc working in the long run? Geert From ronaldoussoren at mac.com Thu Jun 14 16:03:33 2012 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Thu, 14 Jun 2012 07:03:33 -0700 Subject: [Pythonmac-SIG] status pyobjc on osx In-Reply-To: References: Message-ID: <7C36F42B-2B51-4E29-93E3-DA7E72527C62@mac.com> I don't understand what you mean when you say that the included python libs no longer include pyobjc. Pyobjc has never been part of the stdlib. I'm working on a new release of pyobjc, either later this month or just after the release of osx 10.8. One last question: how do you import the CoreGraphics functionality, "import CoreGraphics" or "import Quartz"? Ronald Sent from my iPad On 14 jun. 2012, at 03:37, Geert Dekkers wrote: > hi > > Ik have a project i originally did in 2008 which uses pyobjc for coregraphics functionality. Obviously python on osx has moved forward since then, and i see that the included python libs no longer include pyobjc. I've been working around that, but what do the list members recommend to keep pyobjc working in the long run? > > Geert > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG -------------- next part -------------- An HTML attachment was scrubbed... URL: From njriley at illinois.edu Thu Jun 14 18:22:59 2012 From: njriley at illinois.edu (Nicholas Riley) Date: Thu, 14 Jun 2012 12:22:59 -0400 Subject: [Pythonmac-SIG] status pyobjc on osx In-Reply-To: <7C36F42B-2B51-4E29-93E3-DA7E72527C62@mac.com> References: <7C36F42B-2B51-4E29-93E3-DA7E72527C62@mac.com> Message-ID: <20120614162259.GA30326@illinois.edu> On Thu, Jun 14, 2012 at 07:03:33AM -0700, Ronald Oussoren wrote: > I don't understand what you mean when you say that the included python libs no longer include pyobjc. Pyobjc has never been part of the stdlib. My original assumption was that he might have been talking about /System/Library/Frameworks/Python.framework/Versions/*/Extras/lib/python/PyObjC/, but that's still present in the latest OS X versions. So, no idea... -- Nicholas Riley From ronaldoussoren at mac.com Fri Jun 15 04:51:16 2012 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Thu, 14 Jun 2012 19:51:16 -0700 Subject: [Pythonmac-SIG] [Pyobjc-dev] Objective-C experts? In-Reply-To: <10A390C3-285A-41EC-A3D3-F98E9A77F955@codeweavers.com> References: <2171D1B9-4310-466D-971B-F62A83E2BA34@mac.com> <10A390C3-285A-41EC-A3D3-F98E9A77F955@codeweavers.com> Message-ID: <01019438-A028-437E-9B40-B765543EDE18@mac.com> On 13 Jun, 2012, at 2:22, Ken Thomases wrote: > I can't claim to follow all of the details of how PyObjC works, but here are my impressions: > > On Jun 12, 2012, at 10:13 AM, Ronald Oussoren wrote: > >> trim_chars = u"*" >> #trim_chars = Cocoa.CFStringCreateWithCString(None, trim_chars, Cocoa.kCFStringEncodingASCII) >> >> Cocoa.CFStringTrim(s, trim_chars) > > Here, there are two paths, depending on whether that line above is commented out. Either a unicode object is implicitly converted to a CFString/NSString or a it's an objc.pyobjc_unicode object wrapping what's already a CFString/NSString. What are the code paths used by the two cases? A lot of it is implicit and I'm not able to follow it. Case 1: trim_chars = u"" -> CFStringTrim's second argument is a Python unicode which is proxied as a OC_PythonUnicode object and that proxy is passed to the C function Case 2: trim_chars = Cocoa.CFString... -> CFStringTrim's second argument is an instance of pyobjc_unicode, and the embedded NSString* value is passed to the C function pyobjc_unicode is used to proxy an Objective-C string to Python. I'd prefer to not use a custom class for that, but that would increase friction: you'd have to explicitly convert NSString instances to a python unicode object when using numerous Python APIs implemented in C. Pyobjc_unicode shouldn't really be an issue for this problem though, the only instance of that class in the script is the instance of "s", and that's released as soon as "s.nsstring()" is called. > >> For me te problem only occurs when I run this code with a 64-bit build of python ("arch -x86_64 python2.7 ...") and works fine in a 32-bit build ("arch -i386 python2.7 ..."). I have only tested on OSX 10.7, I'm currently traveling and cannot easily test on other releases. To make life even more interesting, the problem only occurs when "PyObjC_UNICODE_FAST_PATH" is active. > > I note that PyObjC_UNICODE_FAST_PATH affects PyObjCUnicode_New() as well as the implementation of OC_PythonUnicode. I recommend that, instead of disabling it globally by tweaking the header, you disable it in each translation unit independently to isolate which is the problem. I'm sort of suspecting it's PyObjCUnicode_New() rather than OC_PythonUnicode, especially given that you tried disabling the implementation of -getCharacters:range:. I've in effect disabled PyObjC_UNICODE_FAST_PATH for OC_PythonUnicode at least for now, and that fixes the issue as well. PyObjCUnicode_New should be in the clear. My new implementation for OC_PythonUnicode always uses the __realObject__ trick, and only optimzes the implementation of __realObject__: when sizeof(unichar) == sizeof(Py_UNICODE) I create the NSString with the "NoCopy" variant of the NSString initializer. This avoids duplicating the string contents, although there's still the unnecessary object that eats more memory. I'll probably revisit this in the future, I'd prefer to get rid of the additional object where possible. For now my current implementation works, and there are more important things to work on right now (not in the least getting an actual release out). > > I also note that PyObjCUnicode_New() uses the deprecated method -getCharacters: (no range) when the Unicode fast path is enabled. Other than that, I see no obvious problems with either code. Good catch. This should be harmless, but -getCharacters:range: is saver. I'll update the code. > > Given the 32-/64-bit difference, I was for a while suspecting that Py_UNICODE might be 4-byte UCS32 under 64-bit, but I see that PyObjC_UNICODE_FAST_PATH would not be enabled in that case. *shrug* Luckily the size of Py_UNICODE is a configure-time constant, and 16 bits in the default builds of Python. In Python 3.3 and later Py_UNICODE is UCS4 unconditionally, and Python's unicode object then uses UCS1, UCS2 or UCS4 as the backing store as appropriate. And after some optimization Python 3.3 unicode string is now as memory efficient and fast as Python 2.7's byte string for most code (according to discussions on python-dev, I haven't done benchmarking myself). Anyway, thanks for your help. I've also talked to an Apple engineer at WWDC, and the custom NSString subclass should just work, I was at one point worrying that CFString's APIs weren't guaranteed to work with custom NSString subclasses. Ronald -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 4788 bytes Desc: not available URL: From ptmkenny at gmail.com Sat Jun 16 18:31:43 2012 From: ptmkenny at gmail.com (Patrick Kenny) Date: Sun, 17 Jun 2012 01:31:43 +0900 Subject: [Pythonmac-SIG] ImportError: No module named pyqt_ui.qt_translator Message-ID: Hello. I'm attempting to package a python application (Mnemosyne, http://mnemosyne-proj.org) using py2app. I have built the application with py2app: sudo python setup.py py2app and copied the qt_menu.nib directory into the Resources directory. When I then attempt to launch the application: ./dist/Mnemosyne.app/Contents/MacOS/Mnemosyne I get this error: ImportError: No module named pyqt_ui.qt_translator I haven't been able to figure out what to add to the "includes" to ensure qt_translator is included. I looked at the PyQt module list: http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/modules.html and learned that there is a "QTranslator" class in the QtCore module, but including "PyQt4.QtCore" doesn't help, nor does "PyQt4.*" Any help would be much appreciated. Patrick -------------- next part -------------- An HTML attachment was scrubbed... URL: From ptmkenny at gmail.com Thu Jun 28 18:16:49 2012 From: ptmkenny at gmail.com (Patrick Kenny) Date: Fri, 29 Jun 2012 01:16:49 +0900 Subject: [Pythonmac-SIG] Sqlite database drivers with py2app? Message-ID: I have a python application that uses a sqlite database. On my machine, which has all the dependencies installed, there are no issues. However, when I bundle the application with py2app, clicking a menu that causes the database to be accessed results in this error: > Database error: Driver not loaded Driver not loaded For the Windows installer, the files in \Qt\version\plugins\sqldrivers\*.* can be copied to \myApp\sqldrivers\* The same files on the Mac can be found in?/opt/local/share/qt4/plugins/sqldrivers (installed via Macports). However, copying the sqldrivers directory to my application's Resources or Frameworks directories still results in the same error. How can I add sqlite support into my application that is built using py2app? Any help would be much appreciated. Regards, Patrick -------------- next part -------------- An HTML attachment was scrubbed... URL: From michael.mccracken at gmail.com Thu Jun 28 18:57:00 2012 From: michael.mccracken at gmail.com (Michael McCracken) Date: Thu, 28 Jun 2012 11:57:00 -0500 Subject: [Pythonmac-SIG] Sqlite database drivers with py2app? In-Reply-To: References: Message-ID: Patrick, I've run into a similar problem - qt needs a qt.conf file to be created in the Contents/Resources folder of the app bundle, with a directive telling it where to find plugins. otherwise it looks in the default system path. The environment variable QT_DEBUG_PLUGINS=1 can be very useful here. -mike On Thu, Jun 28, 2012 at 11:16 AM, Patrick Kenny wrote: > I have a python application that uses a sqlite database. On my machine, > which has all the dependencies installed, there are no issues. However, when > I bundle the application with py2app, clicking a menu that causes the > database to be accessed results in this error: > > Database error: Driver not loaded Driver not loaded > > For the Windows installer, the files in \Qt\version\plugins\sqldrivers\*.* > can be copied to \myApp\sqldrivers\* > > The same files on the Mac can be found > in?/opt/local/share/qt4/plugins/sqldrivers (installed via Macports). > > However, copying the sqldrivers directory to my application's Resources or > Frameworks directories still results in the same error. > > How can I add sqlite support into my application that is built using py2app? > > Any help would be much appreciated. > > > Regards, > Patrick > > _______________________________________________ > Pythonmac-SIG maillist ?- ?Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG > From michael.mccracken at gmail.com Fri Jun 29 05:16:18 2012 From: michael.mccracken at gmail.com (Michael McCracken) Date: Thu, 28 Jun 2012 22:16:18 -0500 Subject: [Pythonmac-SIG] Sqlite database drivers with py2app? In-Reply-To: <8880AF1F80304046A69DFA29355198A4@gmail.com> References: <8880AF1F80304046A69DFA29355198A4@gmail.com> Message-ID: Hey, I'm glad that was useful! Another thing that probably won't affect you, but in case it does - make sure you keep a reference in your python script to the QtApplication that you create. ie, do 'app = QApplication(sys.argv)' instead of just 'QApplication(sys.argv)'. Otherwise the QApplication will get garbage collected and weird things happen, including forgetting where to look for plugins! Feel free to ask about PyQt4 here, as I'm working on porting a PyQt application to OS X now, and may have run into other problems already. Cheers, -mike On Thu, Jun 28, 2012 at 7:37 PM, Patrick Kenny wrote: > Thanks, that solved my problem! > > I really appreciate your help! > > > Cheers, > Patrick > > On 2012?6?29?Friday at 1:57, Michael McCracken wrote: > > Patrick, I've run into a similar problem - qt needs a qt.conf file to > be created in the Contents/Resources folder of the app bundle, with a > directive telling it where to find plugins. otherwise it looks in the > default system path. > > The environment variable QT_DEBUG_PLUGINS=1 can be very useful here. > > -mike > > On Thu, Jun 28, 2012 at 11:16 AM, Patrick Kenny wrote: > > I have a python application that uses a sqlite database. On my machine, > which has all the dependencies installed, there are no issues. However, when > I bundle the application with py2app, clicking a menu that causes the > database to be accessed results in this error: > > Database error: Driver not loaded Driver not loaded > > For the Windows installer, the files in \Qt\version\plugins\sqldrivers\*.* > can be copied to \myApp\sqldrivers\* > > The same files on the Mac can be found > in?/opt/local/share/qt4/plugins/sqldrivers (installed via Macports). > > However, copying the sqldrivers directory to my application's Resources or > Frameworks directories still results in the same error. > > How can I add sqlite support into my application that is built using py2app? > > Any help would be much appreciated. > > > Regards, > Patrick > > _______________________________________________ > Pythonmac-SIG maillist ?- ?Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG > >