Re: [Pythonmac-SIG] py-Appscript broken with FileMaker 11?
Thanks for this. It worked in terms of getting the application to talk to FileMaker, just as you described. I've filed a bug report with FileMaker. But it appears that they have broken a lot more in the AppleScript implementation (see http://forums.filemaker.com/posts/4b2544f7a4) such that it accepts events w/o delay (in some sort of parallel manner causing database deadlocks. It doesn't wait for internal scripts to finish before accepting another applescript -- which it use to. I'm now running into so many issues that I may just have to abandon version 11 until they fix them. On Jul 12, 2010, at 10:19 AM, has wrote: > John Jackson wrote: > >> I recently upgraded FileMaker to version 11, and discovered that my >> python-based application that relies on appscript to control a FileMaker >> database has broken. > > I believe that's a bug in FMP 11, where sending an ascr/gdte (get > terminology) event to FMP returns the default Cocoa Scripting terminology, > rather than FMP's actual dictionary. You should file a bug report with > FileMaker, as this will also affect scripting FMP from AppleScript via Remote > Apple Events. > > As a workaround, use the dump function in appscript.terminology to export the > FMP dictionary to a static module and pass that module when creating app > objects, like this: app('FileMaker Pro', terms=fmp11terminologymodule). Make > sure you run the dump command under 32-bit Python (use 'arch -i386' followed > by the path to the python interpreter in the Python.framework bundle) as it > uses OSAGetAppTerminology, which isn't present in OS X's 64-bit APIs. > > HTH > > has > -- > Learn AppleScript, 3rd edition, Sanderson & Rosenthal: > http://apress.com/book/view/9781430223610 > Control AppleScriptable applications from Python, Ruby and ObjC: > http://appscript.sourceforge.net > > ___ > Pythonmac-SIG maillist - Pythonmac-SIG@python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG > ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG
[Pythonmac-SIG] py2app hang on build
Hello, I hope this is the appropriate place to ask for help using py2app. If not, please redirect me. I've built my app for windows using py2exe, and now trying to build a mac app. py2app appears to work until the last line in the inline message, at which point I went to bed and it was still chugging on it the next morning. All of the previous 'creating...' data messages went relatively quickly, as in less than 5 seconds. Is this an ascii/unicode issue? Thanks for any pointers you can offer. By the way, the data it hangs on are shapefiles. system: OS X 10.6.3, Intel. *** creating application bundle: toolkit *** creating /Users/stephens/code/eda08/code/toolkit/dist/toolkit.app/Contents/Resources/mpl-data creating /Users/stephens/code/eda08/code/toolkit/dist/toolkit.app/Contents/Resources/mpl-data/example creating /Users/stephens/code/eda08/code/toolkit/dist/toolkit.app/Contents/Resources/mpl-data/fonts creating /Users/stephens/code/eda08/code/toolkit/dist/toolkit.app/Contents/Resources/mpl-data/fonts/afm creating /Users/stephens/code/eda08/code/toolkit/dist/toolkit.app/Contents/Resources/mpl-data/images creating /Users/stephens/code/eda08/code/toolkit/dist/toolkit.app/Contents/Resources/mpl-data/fonts/ttf creating /Users/stephens/code/eda08/code/toolkit/dist/toolkit.app/Contents/Resources/mpl-data/fonts/pdfcorefonts creating /Users/stephens/code/eda08/code/toolkit/dist/toolkit.app/Contents/Resources/data creating /Users/stephens/code/eda08/code/toolkit/dist/toolkit.app/Contents/Resources/data/toolkit_data creating /Users/stephens/code/eda08/code/toolkit/dist/toolkit.app/Contents/Resources/data/toolkit_data/tracts1990 creating /Users/stephens/code/eda08/code/toolkit/dist/toolkit.app/Contents/Resources/data/toolkit_data/tracts2000 creating /Users/stephens/code/eda08/code/toolkit/dist/toolkit.app/Contents/Resources/data/toolkit_data/1990_dissolved_unproj creating /Users/stephens/code/eda08/code/toolkit/dist/toolkit.app/Contents/Resources/data/toolkit_data/2000_dissolved_unproj creating /Users/stephens/code/eda08/code/toolkit/dist/toolkit.app/Contents/Resources/data/toolkit_data/neighborhoods1990 creating /Users/stephens/code/eda08/code/toolkit/dist/toolkit.app/Contents/Resources/data/toolkit_data/neighborhoods2000 creating /Users/stephens/code/eda08/code/toolkit/dist/toolkit.app/Contents/Resources/data/toolkit_data/msaTracts2000polygons_unproj ^CTraceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/6.0.4/lib/python2.6/site-packages/py2app/build_app.py", line 589, in _run self.run_normal() File "/Library/Frameworks/Python.framework/Versions/6.0.4/lib/python2.6/site-packages/py2app/build_app.py", line 660, in run_normal self.create_binaries(py_files, pkgdirs, extensions, loader_files) File "/Library/Frameworks/Python.framework/Versions/6.0.4/lib/python2.6/site-packages/py2app/build_app.py", line 755, in create_binaries target, arcname, pkgexts, copyexts, target.script) File "/Library/Frameworks/Python.framework/Versions/6.0.4/lib/python2.6/site-packages/py2app/build_app.py", line 1180, in build_executable copy_resource(src, dest, dry_run=self.dry_run) File "/Library/Frameworks/Python.framework/Versions/6.0.4/lib/python2.6/site-packages/py2app/util.py", line 96, in copy_resource copy_file(source, destination, dry_run=dry_run) File "/Library/Frameworks/Python.framework/Versions/6.0.4/lib/python2.6/site-packages/py2app/util.py", line 101, in copy_file zf, zp = path_to_zip(source) File "/Library/Frameworks/Python.framework/Versions/6.0.4/lib/python2.6/site-packages/py2app/util.py", line 127, in path_to_zip while not os.path.exists(path): KeyboardInterrupt > /Library/Frameworks/Python.framework/Versions/6.0.4/lib/python2.6/site-packages/py2app/util.py(127)path_to_zip() -> while not os.path.exists(path): (Pdb) (Pdb) -- Philip Stephens Research Analyst GeoDa Center for Geospatial Analysis and Computation Arizona State University philip.steph...@asu.edu "Please do not send me Microsoft Office/Apple iWork documents. Send OpenDocument instead! http://fsf.org/campaigns/opendocument/"; ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG
Re: [Pythonmac-SIG] py2app problem: invalid matplotlib recipe
Russell E. Owen wrote: Removing the line listed above from the recipe fixes the problem -- great. But it also loses the test for the presence of pytz, which may be a bad thing (if so, it should also test for dateutils, right?). I don't think testing for the presence of something is py2apps job. If you don't need it, it's OK if it' snot present, and if you do, your app tests should catch it. The point of this sort of recipe is to include stuff that many people need, but which are not imported in the usual way, so py2app would otherwise miss it. I suspect that MPL imports pytz differently than it used to, and thus this recipe is not longer needed. Of course, it may still be needed for other versions of MPL, so I don't know if we should just strip it out. But I can't remember who wrote it when, so I don't know how old a version of MPL you need it for. -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.bar...@noaa.gov ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG
[Pythonmac-SIG] py2app problem: invalid matplotlib recipe
py2app 0.4.3's matplotlib recipe includes: mf.import_hook('pytz.zoneinfo', m, ['UTC']) This has two incompatibilities with the current version of pytz: - zoneinfo is a data directory but not a package (no __init__.py) - UTC is not a python file (it is called UTC, not UTC.py) Removing the line listed above from the recipe fixes the problem -- it allows my build to complete, and the resulting application includes pytz with its zoneinfo directory and data files). But it also loses the test for the presence of pytz, which may be a bad thing (if so, it should also test for dateutils, right?). I'm curious: is the line in question supposed to do more than test if pytz exists? If it only tests if pytz works then why does it have such detail about the internals of pytz? If it does more (e.g. add pytz files to the bundled application), then why did my fix work? -- Russell ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG
[Pythonmac-SIG] AEDesc error: Unsupported Type
Hello all, Working with py-appscript to automate testing and I'm getting an error deep in aemreference/aemcodecs. Following are the trace and some code to reproduce. The error seems to be caused by calling a separate function in a parent class that returns a reference to an appscript object - commenting the last line of setUp and uncommenting the 2 lines above it lead to working code. That's an acceptable workaround, but I'm very curious what is causing the issue ... does application object get cleaned up prematurely? Traceback (most recent call last): File "test_syslog.py", line 78, in testClass.testMe() File "test_syslog.py", line 74, in testMe self.testApp.menu_bars[0].menus["File"].menu_items["Show Properties"].click() File "build/bdist.macosx-10.6-universal/egg/appscript/reference.py", line 463, in __call__ File "build/bdist.macosx-10.6-universal/egg/aem/__init__.py", line 192, in event File "build/bdist.macosx-10.6-universal/egg/aem/aemsend.py", line 57, in __init__ File "build/bdist.macosx-10.6-universal/egg/appscript/reference.py", line 275, in pack File "build/bdist.macosx-10.6-universal/egg/aem/aemcodecs.py", line 313, in pack File "build/bdist.macosx-10.6-universal/egg/aem/aemreference.py", line 118, in AEM_packself File "build/bdist.macosx-10.6-universal/egg/aem/aemreference.py", line 177, in _packself File "build/bdist.macosx-10.6-universal/egg/aem/aemreference.py", line 534, in AEM_packself File "build/bdist.macosx-10.6-universal/egg/aem/aemreference.py", line 118, in AEM_packself File "build/bdist.macosx-10.6-universal/egg/aem/aemreference.py", line 177, in _packself File "build/bdist.macosx-10.6-universal/egg/aem/aemreference.py", line 534, in AEM_packself File "build/bdist.macosx-10.6-universal/egg/aem/aemreference.py", line 118, in AEM_packself File "build/bdist.macosx-10.6-universal/egg/aem/aemreference.py", line 177, in _packself File "build/bdist.macosx-10.6-universal/egg/aem/aemreference.py", line 534, in AEM_packself File "build/bdist.macosx-10.6-universal/egg/aem/aemreference.py", line 118, in AEM_packself File "build/bdist.macosx-10.6-universal/egg/aem/aemreference.py", line 176, in _packself File "build/bdist.macosx-10.6-universal/egg/aem/aemreference.py", line 304, in _packkey File "build/bdist.macosx-10.6-universal/egg/appscript/reference.py", line 275, in pack File "build/bdist.macosx-10.6-universal/egg/aem/aemcodecs.py", line 325, in pack File "build/bdist.macosx-10.6-universal/egg/aem/aemcodecs.py", line 290, in packunknown TypeError: Can't pack data into an AEDesc (unsupported type): <__main__.Test instance at 0x1007a5cb0> import appscript class SuperTest(): def getProcessHandle(procName="TextEdit"): sysEvents = appscript.app("System Events") testApp = sysEvents.application_processes[procName] return testApp class Test(SuperTest): def setUp(self): application = appscript.app("TextEdit") application.activate() #sysEvents = appscript.app("System Events") #self.testApp = sysEvents.application_processes["TextEdit"] self.testApp = self.getProcessHandle() def testMe(self): self.testApp.menu_bars[0].menus["File"].menu_items["Show Properties"].click() testClass = Test() testClass.setUp() testClass.testMe() Thanks, Ben P ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG
Re: [Pythonmac-SIG] py-Appscript broken with FileMaker 11?
John Jackson wrote: > I recently upgraded FileMaker to version 11, and discovered that my > python-based application that relies on appscript to control a FileMaker > database has broken. I believe that's a bug in FMP 11, where sending an ascr/gdte (get terminology) event to FMP returns the default Cocoa Scripting terminology, rather than FMP's actual dictionary. You should file a bug report with FileMaker, as this will also affect scripting FMP from AppleScript via Remote Apple Events. As a workaround, use the dump function in appscript.terminology to export the FMP dictionary to a static module and pass that module when creating app objects, like this: app('FileMaker Pro', terms=fmp11terminologymodule). Make sure you run the dump command under 32-bit Python (use 'arch -i386' followed by the path to the python interpreter in the Python.framework bundle) as it uses OSAGetAppTerminology, which isn't present in OS X's 64-bit APIs. HTH has -- Learn AppleScript, 3rd edition, Sanderson & Rosenthal: http://apress.com/book/view/9781430223610 Control AppleScriptable applications from Python, Ruby and ObjC: http://appscript.sourceforge.net ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG