[Pythonmac-SIG] [patch] GetURL argv emulation for py2app 0.5.2

Ronald Oussoren ronaldoussoren at mac.com
Sun Mar 13 13:13:02 CET 2011


On 12 Mar, 2011, at 19:28, Brendan Simon (eTRIX) wrote:

> 
> 
> On 11/03/11 10:04 AM, Brendan Simon (eTRIX) wrote:
>> NOTE: for some reason the AppleEvent constants kAEInternetSuite and
>> kAEISGetURL does not work as they are set to 'gurl' (lowercase). 
>> However using 'GURL' does work :)
>> 
>> Cheers, Brendan.
> 
> Was thinking it may be "nicer" to convert the constants to upper case
> rather than having a magic string ??
> 
> -            AE.AEInstallEventHandler('GURL', 'GURL', self.__geturl)
> +            AE.AEInstallEventHandler(kAEInternetSuite.upper(), kAEISGetURL.upper(), self.__geturl)
> 
> 
> -            AE.AERemoveEventHandler('GURL', 'GURL')
> +            AE.AERemoveEventHandler(kAEInternetSuite.upper(), kAEISGetURL.upper())

I'd prefer to keep the hardcoded literals for now, that makes it clear that the definition in the stdlib is wrong.

The current code doesn't work in python3, as the entire Carbon package is not present there. I will therefore rewrite argv_emulation.py using ctypes in the near future and then this issue entirely goes away ;-)

Ronald



More information about the Pythonmac-SIG mailing list