Failed to run the HotKey Example

Jake Wang <[email protected]> Fri, 3 Jan 2014 22:02:58 +0800
Newsgroups gmane.comp.python.pyobjc.devel
Message-ID <CALtF252bem=QGWoMUOnJ2DU=m4a8e8gKGSCRdoUJdUjJz0cGvw@mail.gmail.com>
Hi,

I was trying to run the sample PyObjc HotKey example app downloaded from
this link:
http://pythonhosted.org/pyobjc/_downloads/PyObjCExample-HotKeyPython.zip

(My environment: Mac OS X 10.8.5, Python 2.7.5)

After I unpacked the file, I tried to:

1) run it via:

python HotKey.py

and got the following error:

Traceback (most recent call last):
  File "HotKey.py", line 18, in <module>
    from Carbon.CarbonEvt import RegisterEventHotKey,
GetApplicationEventTarget
ImportError: cannot import name RegisterEventHotKey

2) run it in 32bit mode, as I thought this might only be supported in 32bit.

arch -i386 python HotKey.py

and got another error:

2014-01-03 21:57:41.083 Python[2047:f0b] No Info.plist file in application
bundle or no NSPrincipalClass in the Info.plist file, exiting

3) Then I thought I might have to package it as an xx.app to run, then I
executed the following command to package it:

python setup.py py2app -A

(also tried 'arch -i386 python setup.py py2app -A')

The app couldn't be run, and then ran it from console, I got the following
errors:

Traceback (most recent call last):
  File
"/Users/jiakuanwang/opensource/PyObjCExample-HotKeyPython/dist/HotKey.app/Contents/Resources/__boot__.py",
line 69, in <module>
    _run()
  File
"/Users/jiakuanwang/opensource/PyObjCExample-HotKeyPython/dist/HotKey.app/Contents/Resources/__boot__.py",
line 62, in _run
    exec(compile(source, script, 'exec'), globals(), globals())
  File
"/Users/jiakuanwang/opensource/PyObjCExample-HotKeyPython/HotKey.py", line
16, in <module>
    from AppKit import *
ImportError: No module named AppKit
2014-01-03 22:00:41.775 HotKey[2126:707] HotKey Error

Is it possible to run it in some way? Thanks in advance!

Thanks,
Jake

------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk

_______________________________________________
Pyobjc-dev mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pyobjc-dev