Re: [Pythonmac-SIG] Py2app error with libpng

2009-11-24 Thread Ronald Oussoren

On 6 Nov, 2009, at 23:55, Kevin Walzer wrote:

 On 11/6/09 11:27 AM, Brian Zambrano wrote:
 Hi there,
 
 I'm building an app with py2app and it runs successfully both on my
 computer and a friends.  We both have the developer tools installed.  On
 two other Macs, the application would die when loading one of the
 matplotlib .so files.  The problem is that the .so, matplotlib/_png.so,
 is linking to:
 
 /usr/X11/lib/libpng12.0.dylib
 
 ...which doesn't exist on the two machines where the crash is occurring.
 
 My understanding is that py2app (or, macholib?) tries to resolve these
 dependencies and copy over the necessary dylibs.
 
 I've tried adding /usr/X11/lib/libpng12.0.dylib to the build with the
 'frameworks' argument, but that doesn't seem to do anything.  Now, I'm
 thinking of doing a manual copy of that file into the Framework
 directory, along with using install_name_tool.
 
 What's the best way to handle this?
 
 
 py2app typically doesn't include system files. I think /usr/lib is considered 
 a system directory, which may explain why it's not bundling the files.

That's correct. /usr/lib is a system directory, and hence anything in it is 
assumed to be a file owned by Apple. That's why those files are not copied into 
the application bundle.

Ronald
 
 --Kevin
 
 -- 
 Kevin Walzer
 Code by Kevin
 http://www.codebykevin.com
 ___
 Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
 http://mail.python.org/mailman/listinfo/pythonmac-sig



smime.p7s
Description: S/MIME cryptographic signature
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


Re: [Pythonmac-SIG] Py2app PIL recipe

2009-11-24 Thread Ronald Oussoren

On 2 Nov, 2009, at 20:10, Christopher Barker wrote:

 Hi folks,
 
 For a while now, PIL has provided a proper package, so that you can do:
 
 from PIL import Image
 
 rather than relying on a pth file and:
 
 import Image
 
 
 I'm such a fanatic about proper use of packages and namespaces that I 
 removed the PIL.pth file from my system.
 
 Then I tried to use py2app on a program that uses PIL. It turns out that the 
 PIL py2app recipe has a prescript.py file that gets put into the bundle, and 
 it uses the old import Image form.
 
 I've hacked it to use:
 
try:
import Image
except ImportError:
from PIL import Image # note: the newer way to import PIL
import sys

I will commit this patch once py2apps repository gets back (I have connectivity 
problems to the repo at the moment)

 
 instead, which works fine for me.
 
 I'd really rather simple use the package form:
 
   from PIL import Image # note: the newer way to import PIL
 
 all by itself, but there is some chance that that would break older PIL 
 installations -- or is there? when was the PIL directory made a package?

I don't know, I don't even know which name is the preferred one. The PIL 
Handbook (http://www.pythonware.com/library/pil/handbook/index.htm) uses 
'import Image' throughout.

Ronald

smime.p7s
Description: S/MIME cryptographic signature
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


Re: [Pythonmac-SIG] Py2app PIL recipe

2009-11-24 Thread Christopher Barker

Ronald Oussoren wrote:

I will commit this patch once py2apps repository gets back (I have connectivity 
problems to the repo at the moment)


great, thanks.


I don't know, I don't even know which name is the preferred one.


I'm clear on that -- every package has moved to using namespaces over 
the years.


The PIL Handbook 
(http://www.pythonware.com/library/pil/handbook/index.htm) uses 
'import Image' throughout.


That's a pretty old document. I don't know what Fredrik thinks, but 
given that those are the docs, it's best to support it. However, my 
suggested change only effects how py2app finds PIL, I don't think it 
would break any user code.


No harm in having both ways, though.

-Chris




--
Christopher Barker, Ph.D.
Oceanographer

NOAA/ORR/HAZMAT (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


Re: [Pythonmac-SIG] Py2app PIL recipe

2009-11-24 Thread Bill Janssen
Ronald Oussoren ronaldousso...@mac.com wrote:

 I don't know, I don't even know which name is the preferred one. The
 PIL Handbook
 (http://www.pythonware.com/library/pil/handbook/index.htm) uses
 'import Image' throughout.

Note that the on-line PIL handbook is from 4.5 years ago.

Bill
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


Re: [Pythonmac-SIG] Py2app PIL recipe

2009-11-24 Thread Ronald Oussoren

On 24 Nov, 2009, at 20:27, Bill Janssen wrote:

 Ronald Oussoren ronaldousso...@mac.com wrote:
 
 I don't know, I don't even know which name is the preferred one. The
 PIL Handbook
 (http://www.pythonware.com/library/pil/handbook/index.htm) uses
 'import Image' throughout.
 
 Note that the on-line PIL handbook is from 4.5 years ago.

Is there more recent documentation? Even the version at effbot's site 
http://effbot.org/imagingbook/ says 'import Image'. 

Some of the examples in the 1.1.6 distribution seem to have been converted to 
'from PIL import Image', but I haven't found a definite source that says which 
is the prefered style.

Ronald



smime.p7s
Description: S/MIME cryptographic signature
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


Re: [Pythonmac-SIG] Py2app PIL recipe

2009-11-24 Thread Ronald Oussoren

On 24 Nov, 2009, at 20:06, Christopher Barker wrote:

 Ronald Oussoren wrote:
 I will commit this patch once py2apps repository gets back (I have 
 connectivity problems to the repo at the moment)
 
 great, thanks.

The patch is in the repo.

 
 I don't know, I don't even know which name is the preferred one.
 
 I'm clear on that -- every package has moved to using namespaces over the 
 years.
 
 The PIL Handbook (http://www.pythonware.com/library/pil/handbook/index.htm) 
 uses 'import Image' throughout.
 
 That's a pretty old document. I don't know what Fredrik thinks, but given 
 that those are the docs, it's best to support it. However, my suggested 
 change only effects how py2app finds PIL, I don't think it would break any 
 user code.
 
 No harm in having both ways, though.

I'm not 100% sure about that though, users may now end up with two copies of 
PIL unless they remove the .pth file as well. That wouldn't be a disaster, but 
I'd prefer to avoid that.

Ronald



smime.p7s
Description: S/MIME cryptographic signature
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


Re: [Pythonmac-SIG] Py2app PIL recipe

2009-11-24 Thread Christopher Barker



Ronald Oussoren wrote:


No harm in having both ways, though.


I'm not 100% sure about that though, users may now end up with two copies of 
PIL unless they remove the .pth file as well. That wouldn't be a disaster, but 
I'd prefer to avoid that.


hmm -- I suppose we should check that. I agree that it's probably not a 
good idea to have the contents of the package also in sys.path, but 
that's how PIL is installed now. It seems that users could have it 
imported in two different ways in their own code, regardless of how 
py2app imports it.


I guess the question is whether modulegraph is smart enough to realize 
that they are the same thing!


-Chris






--
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/ORR(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


[Pythonmac-SIG] py-appscript 0.20.3

2009-11-24 Thread has
Hi all,

Just checked in rev. 69 which contains a couple of 64-bit bug fixes along with 
a workaround for OS 10.6's return ID bug. Unfortunately, I don't have time to 
do a thorough test, particularly of 32- and 64-bit support on Python 3.1.1 (the 
python.org framework distro is 32-bit only), and I don't want to do a new 
release until it's been checked properly. If any appscript users here are 
willing to give it a workout (Python 2.3-3.1.1, 10.4-10.6, 32-bit PPC/i386, 
x86-64) and let me know if everything's okay or if any issues are still 
outstanding, I'd really appreciate it.

Thanks,

has
-- 
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


Re: [Pythonmac-SIG] py-appscript 0.20.3

2009-11-24 Thread Ned Deily
In article 8773f3ac-0873-47f6-9587-07a1e114d...@virgin.net,
 has hengist.p...@virgin.net wrote:
 Just checked in rev. 69 which contains a couple of 64-bit bug fixes along 
 with a workaround for OS 10.6's return ID bug. Unfortunately, I don't have 
 time to do a thorough test, particularly of 32- and 64-bit support on Python 
 3.1.1 (the python.org framework distro is 32-bit only), and I don't want to 
 do a new release until it's been checked properly. If any appscript users 
 here are willing to give it a workout (Python 2.3-3.1.1, 10.4-10.6, 32-bit 
 PPC/i386, x86-64) and let me know if everything's okay or if any issues are 
 still outstanding, I'd really appreciate it.

I just had time to run a few quick install and trivial functional test 
(with iTunes and Safari).

The outliers seemed to work OK:

custom python3.1+ x86_64 and i386 on 10.6.2
   using Distribute 0.6.8 easy_install
Apple python2.3 ppc (G3) on 10.4.11
   using setuptools 0.6c11 easy_install

plus
MacPorts python2.6.4 on i386 10.6.2 (setuptools 0.6c11)

However, attempts on a 10.5.8 PPC (G4) failed with:

$ /usr/bin/python2.5
Python 2.5.1 (r251:54863, Feb  6 2009, 19:02:12) 
[GCC 4.0.1 (Apple Inc. build 5465)] on darwin
Type help, copyright, credits or license for more information.
 from appscript import *
Traceback (most recent call last):
  File stdin, line 1, in module
  File build/bdist.macosx-10.5-ppc/egg/appscript/__init__.py, line 11, 
in module
  File build/bdist.macosx-10.5-ppc/egg/aem/__init__.py, line 6, in 
module
  File build/bdist.macosx-10.5-ppc/egg/aem/aemconnect.py, line 28, in 
module
  File build/bdist.macosx-10.5-ppc/egg/aem/aemsend.py, line 55, in 
__init__
aem.ae.MacOSError: -1700

Same results with the python.org 2.6.4 on this machine either via 
setuptools easy_install or direct python setup.py install.

-- 
 Ned Deily,
 n...@acm.org

___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


Re: [Pythonmac-SIG] py-appscript 0.20.3

2009-11-24 Thread Ned Deily
In article nad-b5e15d.17343224112...@news.gmane.org,
 Ned Deily n...@acm.org wrote:
 Same results with the python.org 2.6.4 on this machine either via 
 setuptools easy_install or direct python setup.py install.

Sorry, I overlooked the fact that the 2.6.4 traceback is a little more 
informative (again on 10.5.8 PPC G4):

$ /usr/local/bin/python2.6
Python 2.6.4 (r264:75821M, Oct 27 2009, 19:48:32) 
[GCC 4.0.1 (Apple Inc. build 5493)] on darwin
Type help, copyright, credits or license for more information.
 from appscript import *
Traceback (most recent call last):
  File stdin, line 1, in module
  File 
/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-pac
kages/appscript-0.20.2-py2.6-macosx-10.3-fat.egg/appscript/__init__.py, 
line 11, in module
from aem.findapp import ApplicationNotFoundError
  File 
/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-pac
kages/appscript-0.20.2-py2.6-macosx-10.3-fat.egg/aem/__init__.py, line 
6, in module
import ae, kae, findapp, mactypes, aemconnect
  File 
/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-pac
kages/appscript-0.20.2-py2.6-macosx-10.3-fat.egg/aem/aemconnect.py, 
line 28, in module
_launchevent = Event(_nulladdressdesc, 'ascrnoop').AEM_event
  File 
/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-pac
kages/appscript-0.20.2-py2.6-macosx-10.3-fat.egg/aem/aemsend.py, line 
55, in __init__
self.AEM_event = createproc(event[:4], event[4:], address, returnid, 
transaction)
aem.ae.MacOSError: -1700

-- 
 Ned Deily,
 n...@acm.org

___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig