Hello World Example

3 views
Skip to first unread message

Charles Albrecht

unread,
Nov 22, 2008, 1:37:10 AM11/22/08
to frontpython-discuss.
I'm trying to get a simple Hello World-style plugin working with the
frontpython code - just trying to launch an external app when the main
menu is selected in Front Row, but somehow, I think I must be missing
something fundamental. (XCode 3.1 on MBP 10.5.5)

The code itself is kind of mindless right now - it's intended to
simply launch an external app when the plugin is first activated....

## TextEdit.py ##
#
#import modules required by application
import PyFR.Appliance
import PyFR.WaitController
import PyFR.Debugging
import PyFR.OptionDialog
import PyFR.FileBrowser
import PyFR.AppLauncherController

class RUIPythonAppliance( PyFR.Appliance.Appliance ):
def getController(self):
self.stack().pushController_(
PyFR.appLauncherController.AppLauncherController.alloc
().initWithApp_('Launching TextEdit','/Applications/TextEdit.app'))
return 0



...but I never get as far as getting it loaded into Front Row. I run:

% python setup.py py2app -A
running py2app
*** creating plugin bundle: TextEdit ***

And then symlink the `pwd`/dist/TextEdit.frappliance directory into
the Front Row plugins directory, but when I kill Front Row and restart
it, the new menu doesn't show up.

I get the same behavior with the a largely unmodified FrontPython
build (adjusting only certain hardcoded paths).



If I remove the -A flag, I get a syntax error:

File "/[...]/PyFR/DynamicMenuController.py", line 104
self.log("Deallocing DynamicMenuController %s" % self.title.encode
("ascii","replace")))

^
SyntaxError: invalid syntax
> /System/Library/Frameworks/Python.framework/Versions/2.5/Extras/lib/python/modulegraph/modulegraph.py(512)load_module()
-> co = compile(fp.read() + '\n', pathname, 'exec')


My guess is I probably have three completely different problems here,
and that none of them is related to any of the others.

Any suggestions from those who are old hands at this?

Charles Albrecht

unread,
Nov 22, 2008, 3:28:52 AM11/22/08
to frontpython-discuss.
It turns out my main issue was that I didn't have my CFBundleName
specified correctly in the lproj.

The code itself was buggy as well, but since the code from the
FrontMyth project does exactly what I was trying to test, it was easy
enough to crib.

So, everything mostly appears to be working with TextEdit as the
target app, though it seems to open in the background. The final goal
is to open Boxee so that it takes over until it exits, but that seems
a little trickier to tackle.

-Charles

On Nov 21, 10:37 pm, Charles Albrecht <charles.albre...@gmail.com>
wrote:

Kirk

unread,
Nov 22, 2008, 9:52:16 AM11/22/08
to frontpython-discuss.
Look at the recent thread on opening an NSWindow [1]. The code that
Jon Christopher points out will cause Front Row to fade out and
basically hide. Anything you've activated prior to do that will be
waiting as the front most app. In my case Front Row can be reactivated
(by remote or normal App launch) and basically picks up where it left
off. If boxee recognizes the remote then things may play out
differently.

[1] see: http://groups.google.com/group/frontpython-discuss/browse_thread/thread/b3afa6c6be13dc68

On Nov 22, 3:28 am, Charles Albrecht <charles.albre...@gmail.com>
wrote:
Reply all
Reply to author
Forward
0 new messages