On Dec 30, 2010, at 8:58 AM, Cédric Krier wrote:

<snip>

> It will require some more code to add support for MacOSX bundle and also some
> registry record for the windows setup.

<snip>

Greetings,

  I've done some work on the gtk-osx project to support custom URLs dispatched 
from the Mac.

You can find my fork of ige-mac-integration here 
https://github.com/pheller/ige-mac-integration  (and, a pygtk example in 
bindings/python/gtk_osxapplication/test-integration.py, from which the 
following example is pulled).

Basically, within a pygtk app, one would register a handler for the OpenURL 
events like so (assuming macapp is an OSXApplication object):

macapp.connect("NSApplicationOpenURL", urlhandler)
...
def urlhandler(self, widget, url):
    print "Invoked with URL: %s\n" % url

And, one must add some information to the Info.plist to indicate support of the 
URL to the Mac OS X LaunchServers.  This is done via py2app and setup.py by 
adding the following dict to the plist key within the py2app dict:

                'CFBundleURLTypes': [{
                        'CFBundleURLName': 'GTK-OSX Python Example',
                        'CFBundleURLSchemes': ['gtk-osx'],
                }],


There is one issue, however;  If the application is not running when a matching 
URL is invoked, the application launches, but the signal is not emitted.  If 
anyone has Cocoa experience, I'd certainly appreciate another set of eyes.

As far as integration within Tryton goes, I have a proof of concept, which 
(mostly) works.  The limitations being the aforementioned issue, as well as the 
inability to launch a new client to handle connections to a different 
server/database.  I'd like to solve the issues in the upstream bits first, then 
I'll clear up the issues within Tryton, and submit a patch.

Regards,

  Phil

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to