Re: [Pythonmac-SIG] problem fixing Carbon.AE/CarbonX.AE conflicts

2006-11-11 Thread Jack Jansen
On  10-Nov-2006, at 12:31 , has wrote:On 9 Nov 2006, at 16:49, Ronald Oussoren wrote: Unfortunately, when I try to do this, all I get is a bunch of  'symbol not found' errors on import: That's because there are hooks in the core interpreter for the  Carbon modules. Yeah, already took a look at mactoolboxglue.c, but it was all  hardwired and didn't really help. I think there must be other stuff  going on as well.Not really: the hooks are only there because at the time I wrote itI thought the export-via-python a bit too much of a hack.But since then everyone is doing it, and with cobject it can actuallybe done in a pretty safe way, so I would use something like thatnowadays.-- Jack Jansen, [EMAIL PROTECTED], http://www.cwi.nl/~jack If I can't dance I don't want to be part of your revolution -- Emma Goldman  

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] problem fixing Carbon.AE/CarbonX.AE conflicts

2006-11-10 Thread has
On 9 Nov 2006, at 16:49, Ronald Oussoren wrote:

 Unfortunately, when I try to do this, all I get is a bunch of  
 'symbol not found' errors on import:

 That's because there are hooks in the core interpreter for the  
 Carbon modules.

Yeah, already took a look at mactoolboxglue.c, but it was all  
hardwired and didn't really help. I think there must be other stuff  
going on as well.

 PyObjC's code contains an example of how top provide a C API to  
 other extensions without cooperation from the Python core is to  
 create a struct with function pointers, wrap that in a Python and  
 extract that struct again in the other extensions.

OK, will use that approach.

Many thanks,

has
-- 
http://freespace.virgin.net/hamish.sanderson/
http://appscript.sourceforge.net
http://rb-appscript.rubyforge.org


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


[Pythonmac-SIG] problem fixing Carbon.AE/CarbonX.AE conflicts

2006-11-09 Thread has
Hi all,

Trying to eliminate the conflict that occurs between Carbon.AE and  
CarbonX.AE when both extensions are loaded. The problem is that both  
extensions need to export the following functions for use by other  
extensions: AEDesc_New, AEDesc_NewBorrowed and AEDesc_Convert.

The logical solution is to rename the CarbonX functions and have the  
other appscript-related extensions (PSN, OSA, OSATerminology) refer  
to those instead. Unfortunately, when I try to do this, all I get is  
a bunch of 'symbol not found' errors on import:

  import aem
Traceback (most recent call last):
   File stdin, line 1, in ?
   File /Library/Frameworks/Python.framework/Versions/2.4/lib/ 
python2.4/site-packages/aeosa/aem/__init__.py, line 6, in ?
 from send import *
   File /Library/Frameworks/Python.framework/Versions/2.4/lib/ 
python2.4/site-packages/aeosa/aem/send/__init__.py, line 11, in ?
 import connect
   File /Library/Frameworks/Python.framework/Versions/2.4/lib/ 
python2.4/site-packages/aeosa/aem/send/connect.py, line 10, in ?
 import PSN
ImportError: Failure linking new module: /Library/Frameworks/ 
Python.framework/Versions/2.4/lib/python2.4/site-packages/aeosa/aem/ 
send/PSN.so: Symbol not found: __AEDescX_Convert
   Referenced from: /Library/Frameworks/Python.framework/Versions/2.4/ 
lib/python2.4/site-packages/aeosa/aem/send/PSN.so
   Expected in: dynamic lookup

A py-appscript branch containing patches to _AEmodule.c and PSN.c is  
available here:

svn checkout http://svn.macosforge.org/repository/appscript/py- 
appscript/branches/py-appscript-0.16.2

What am I doing wrong? I know my C's kinda ropey, but it's not  
usually this bad.

Thanks,

has
-- 
http://freespace.virgin.net/hamish.sanderson/
http://appscript.sourceforge.net
http://rb-appscript.rubyforge.org


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


Re: [Pythonmac-SIG] problem fixing Carbon.AE/CarbonX.AE conflicts

2006-11-09 Thread Ronald Oussoren


On  9 Nov 2006, at 5:38 PM, has wrote:


Hi all,

Trying to eliminate the conflict that occurs between Carbon.AE and
CarbonX.AE when both extensions are loaded. The problem is that both
extensions need to export the following functions for use by other
extensions: AEDesc_New, AEDesc_NewBorrowed and AEDesc_Convert.

The logical solution is to rename the CarbonX functions and have the
other appscript-related extensions (PSN, OSA, OSATerminology) refer
to those instead. Unfortunately, when I try to do this, all I get is
a bunch of 'symbol not found' errors on import:


That's because there are hooks in the core interpreter for the Carbon  
modules.  PyObjC's code contains an example of how top provide a C  
API to other extensions without cooperation from the Python core is  
to create a struct with function pointers, wrap that in a Python and  
extract that struct again in the other extensions.


PyObjC contains an example of how to do this (the code in pyobjc-api. 
[hm]).


Ronald

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