Re: [Pythonmac-SIG] Can't get ASDictionary to work (py2app problems?)

2009-06-02 Thread Ronald Oussoren


On 2 Jun, 2009, at 7:11, Nicholas Riley wrote:


On Mon, Jun 01, 2009 at 09:19:01PM +0100, has wrote:

Odd. The osax module appears to be puking on a System Events command
(it uses SE to get a list of installed osaxen). What versions of
appscript and ASDictionary? What happens if you try to import the  
osax

module into a regular script? Anything unusual about your setup
(permissions, haxies, etc.)?


Gah, I should have thought of this.  I've got Default Folder X
installed, which loads itself by pretending to be an osax.  When I
disabled it, ASDictionary opened successfully.  I'll report it as a
bug in Default Folder X.

PyObjC/py2app questions I'll leave to those that know more about  
these

things. (FWIW, I build ASDictionary using user-installed Python 2.5.2
framework + PyObjC 1.x for portability.)


Anyone (Ronald?) have any idea about these problems?  They're less
important given that I have a fix for my ASDictionary issue, but still
seem pretty serious.


I don't have time to look into the py2app issues right now. That said,  
I wouldn't install a new version of pyobjc in the system install of  
python because this might break other bits of the system.


Ronald



Thanks,

--
Nicholas Riley njri...@uiuc.edu
x
___
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] Can't get ASDictionary to work (py2app problems?)

2009-06-02 Thread Nicholas Riley
To bring a (temporary) conclusion to all of this, the reason I
upgraded the system version of py2app (or rather its dependency,
modulegraph) was that it was incompatible with the current version of
setuptools (0.7a1).

I think this is actually a setuptools bug, which I've reported:

  http://bugs.python.org/setuptools/issue74

After removing my compiled versions of PyObjC, py2app, modulegraph
*and* setuptools, then installing aemreceive, osaterminology and
HTMLTemplate, ASDictionary built and runs fine against the stock 10.5
Python/PyObjC/py2app.

That was painful, but hopefully this thread means nobody else will
have to go through it :-)

-- 
Nicholas Riley njri...@uiuc.edu
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


Re: [Pythonmac-SIG] Can't get ASDictionary to work (py2app problems?)

2009-06-02 Thread Nicholas Riley

On Jun 2, 2009, at 1:58 AM, Ronald Oussoren wrote:

I don't have time to look into the py2app issues right now. That  
said, I wouldn't install a new version of pyobjc in the system  
install of python because this might break other bits of the system.


Thanks for the warning - you may want to make this clear in big  
letters on the PyObjC Web site.


--Nicholas

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


Re: [Pythonmac-SIG] Can't get ASDictionary to work (py2app problems?)

2009-06-01 Thread has

Nicholas Riley wrote:


I'm trying to use appscript on my MacBook Pro running OS X 10.5.7 and
the stock Apple Python.  It's never had appscript installed before.
However, I can't get the binary ASDictionary I downloaded to run:

 Traceback (most recent call last):
   File /Developer/Applications/appscript/ASDictionary.app/Contents/ 
Resources/__boot__.py, line 31, in module

 _run('ASDictionary.py')
   File /Developer/Applications/appscript/ASDictionary.app/Contents/ 
Resources/__boot__.py, line 28, in _run

 execfile(path, globals(), globals())
   File /Developer/Applications/appscript/ASDictionary.app/Contents/ 
Resources/ASDictionary.py, line 17, in module

 import osax, appscript, mactypes
   File build/bdist.macosx-10.3-i386/egg/osax.py, line 38, in  
module
   File build/bdist.macosx-10.3-i386/egg/aem/aemsend.py, line 82,  
in send
 aem.aemsend.EventError: Command failed: Application could not  
handle this command. (-1708)

 2009-05-31 15:42:43.946 ASDictionary[4551:10b] ASDictionary Error
 2009-05-31 15:42:43.948 ASDictionary[4551:10b] ASDictionary Error
 An unexpected error has occurred during execution of the main script



Odd. The osax module appears to be puking on a System Events command  
(it uses SE to get a list of installed osaxen). What versions of  
appscript and ASDictionary? What happens if you try to import the osax  
module into a regular script? Anything unusual about your setup  
(permissions, haxies, etc.)?


PyObjC/py2app questions I'll leave to those that know more about these  
things. (FWIW, I build ASDictionary using user-installed Python 2.5.2  
framework + PyObjC 1.x for portability.)



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] Can't get ASDictionary to work (py2app problems?)

2009-06-01 Thread Nicholas Riley
On Mon, Jun 01, 2009 at 09:19:01PM +0100, has wrote:
 Odd. The osax module appears to be puking on a System Events command  
 (it uses SE to get a list of installed osaxen). What versions of  
 appscript and ASDictionary? What happens if you try to import the osax  
 module into a regular script? Anything unusual about your setup  
 (permissions, haxies, etc.)?

Gah, I should have thought of this.  I've got Default Folder X
installed, which loads itself by pretending to be an osax.  When I
disabled it, ASDictionary opened successfully.  I'll report it as a
bug in Default Folder X.

 PyObjC/py2app questions I'll leave to those that know more about these  
 things. (FWIW, I build ASDictionary using user-installed Python 2.5.2  
 framework + PyObjC 1.x for portability.)

Anyone (Ronald?) have any idea about these problems?  They're less
important given that I have a fix for my ASDictionary issue, but still
seem pretty serious.

Thanks,

-- 
Nicholas Riley njri...@uiuc.edu
x
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


[Pythonmac-SIG] Can't get ASDictionary to work (py2app problems?)

2009-05-31 Thread Nicholas Riley
Hi,

I'm trying to use appscript on my MacBook Pro running OS X 10.5.7 and
the stock Apple Python.  It's never had appscript installed before.
However, I can't get the binary ASDictionary I downloaded to run:

  Traceback (most recent call last):
File 
/Developer/Applications/appscript/ASDictionary.app/Contents/Resources/__boot__.py,
 line 31, in module
  _run('ASDictionary.py')
File 
/Developer/Applications/appscript/ASDictionary.app/Contents/Resources/__boot__.py,
 line 28, in _run
  execfile(path, globals(), globals())
File 
/Developer/Applications/appscript/ASDictionary.app/Contents/Resources/ASDictionary.py,
 line 17, in module
  import osax, appscript, mactypes
File build/bdist.macosx-10.3-i386/egg/osax.py, line 38, in module
File build/bdist.macosx-10.3-i386/egg/aem/aemsend.py, line 82, in send
  aem.aemsend.EventError: Command failed: Application could not handle this 
command. (-1708)
  2009-05-31 15:42:43.946 ASDictionary[4551:10b] ASDictionary Error
  2009-05-31 15:42:43.948 ASDictionary[4551:10b] ASDictionary Error
  An unexpected error has occurred during execution of the main script
  
  EventError: Command failed: Application could not handle this command. (-1708)

So I tried building newer versions of everything, which helped in the
past.  I did run into a problem with modulegraph and newer versions of
setuptools but that was easily fixed.

Now I seem to be having issues with py2app.  First, if I try to use
the bundled PyObjC, py2app doesn't pick it up, so I get an error
trying to import 'objc'.

Next, I tried installing the current PyObjC, but now I get a truly
weird error running the built ASDictionary:

  Traceback (most recent call last):
File 
/Users/nicholas/src/ASDictionary/src/dist/ASDictionary.app/Contents/Resources/__boot__.py,
 line 31, in module
  _run('ASDictionary.py')
File 
/Users/nicholas/src/ASDictionary/src/dist/ASDictionary.app/Contents/Resources/__boot__.py,
 line 28, in _run
  execfile(path, globals(), globals())
File 
/Users/nicholas/src/ASDictionary/src/dist/ASDictionary.app/Contents/Resources/ASDictionary.py,
 line 11, in module
  import objc
File objc/__init__.pyc, line 22, in module
File objc/__init__.pyc, line 19, in _update
File objc/_objc.pyc, line 18, in module
File objc/_objc.pyc, line 15, in __load
  ImportError: 
'/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/lib-dynload/objc/_objc.so'
 not found
  2009-05-31 15:47:49.610 ASDictionary[4560:10b] ASDictionary Error
  2009-05-31 15:47:49.612 ASDictionary[4560:10b] ASDictionary Error
  An unexpected error has occurred during execution of the main script
  
  ImportError: 
'/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/lib-dynload/objc/_objc.so'
 not found
  
Why is it trying to look for _objc.so *there*?  It's actually in
/Library/Python/2.5/site-packages/pyobjc_core-2.2b2-py2.5-macosx-10.5-i386.egg/objc/_objc.so.

If I build ASDictionary with py2app -A, I'm back to the old error
about not being able to import objc:

  Traceback (most recent call last):
File 
/Users/nicholas/src/ASDictionary/src/dist/ASDictionary.app/Contents/Resources/__boot__.py,
 line 58, in module
  
_run(('\x00\x00\x00\x00\x01(\x00\x02\x00\x00\x04Babs\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xc1V\xc6\x82H+\x00\x00\x01-\xf1\xbf\x0fASDictionary.py\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01-\xf2\x03\xc6HIk\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\xff\xff\x00\x00I
 
\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x08\x00\x00\xc1W\x0c\xd2\x00\x00\x00\x11\x00\x08\x00\x00\xc6H\x8f\xbb\x00\x00\x00\x0e\x00
 
\x00\x0f\x00A\x00S\x00D\x00i\x00c\x00t\x00i\x00o\x00n\x00a\x00r\x00y\x00.\x00p\x00y\x00\x0f\x00\n\x00\x04\x00B\x00a\x00b\x00s\x00\x12\x003Users/nicholas/src/ASDictionary/src/ASDictionary.py\x00\x00\x13\x00\x01/\x00\x00\x15\x00\x02\x00\x0f\xff\xff\x00\x00',
 '/Users/nicholas/src/ASDictionary/src/ASDictionary.py'))
File 
/Users/nicholas/src/ASDictionary/src/dist/ASDictionary.app/Contents/Resources/__boot__.py,
 line 54, in _run
  execfile(path, globals(), globals())
File /Users/nicholas/src/ASDictionary/src/ASDictionary.py, line 11, in 
module
  import objc
  ImportError: No module named objc
  2009-05-31 15:49:24.391 ASDictionary[4605:10b] ASDictionary Error
  2009-05-31 15:49:24.394 ASDictionary[4605:10b] ASDictionary Error
  An unexpected error has occurred during execution of the main script
  
  ImportError: No module named objc

despite the fact that there is not one but *two* copies of PyObjC
installed.  (Everything works fine if I just 'import objc' from a
script, of course.)

Help?  I just wanted to write a quick script to tag some PDFs and I'm
now over two hours into this... it's