Comic Book Browser

5 views
Skip to first unread message

Ja...@mungki.co.uk

unread,
Feb 26, 2009, 12:35:35 PM2/26/09
to frontpython-discuss.
Hi Everyone, i've been following this group for while now dabbling
here and there, but i'm no programmer so i've had very little success,
a few days back i came on for a look round and noticed the whilst
browsing the source code it contained a basic menu browser and movie
launcher for vlc this is basically want i want to make but for "simple
comic" but i'm having difficulty following the instructions as i've
said, i'm no programmer

I think this is where im going wrong in Plugin101 it says...

4. Edit the setup.py file. You'll want to change the NSPrincipleClass,
CFBundleExecutable, and CFBundleName..
5. Rename FrontPython.py to match what you named the
CFBundleExecutable (followed by the .py)..

from distutils.core import setup
import py2app


plist = dict(NSPrincipalClass='Comics',
CFBundleDevelopmentRegion='English',
CFBundleExecutable='Comics',
CFBundleName='Comics',

CFBundleIdentifier="com.apple.frontrow.appliance.FrontPython",
CFBundleInfoDictionaryVersion='6.0',
CFBundlePackageType='BNDL',
CFBundleSignature='????',
CFBundleVersion='1.0',
FRApplianceIconHorizontalOffset=0.046899999999999997,
FRApplianceIconKerningFactor=0.10000000000000001,
FRApplianceIconReflectionOffset=-0.125,
FRAppliancePreferedOrderValue=-1,
FRRemoteAppliance=True )


setup(
plugin=['Comics.py'],
data_files=['English.lproj', 'PyFR', 'Comics.py'],
options=dict(py2app=dict(extension='.frappliance', plist=plist))
)

so i guess i replace 5 things with the word comics?? as above


and then in frontpython.py

#
# main.py
# Comics
#
# Created by garion on 12/15/07.
# Copyright __MyCompanyName__ 2007. All rights reserved.
#


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

class MyFileBrowser(PyFR.FileBrowser.FileBrowserController):
def init(self):
PyFR.FileBrowser.FileBrowserController.initWithDirectory_
( self, "/Users/James/Comics" )
return self

def fileSelected_(self, selectedFile):
self.stack().pushController_(
PyFR.AppLauncherController.AppLauncherController.alloc
().initWithApp_file_( 'Launching Comic',

'/Applications/simple comic.app',

selectedFile ) )

class RUIPythonAppliance( PyFR.Appliance.Appliance ):
def getController(self):
return MyFileBrowser.alloc().init()


so i've changed frontpython on line 3 to comics

changed line 20: /Users/James/Comics

line 26:
( 'Launching Comic',
'/Applications/simple comic.app',
selectedFile ) )


any help on any this would be appreciated, (even if its just telling
me to give up and leave lol) i dont imagine this is that hard to do,
but then what would i know,

thanks in advance

James

Matt

unread,
Feb 26, 2009, 1:35:08 PM2/26/09
to frontpython-discuss.
Your main class, currently named RUIPythonAppliance needs to match the
NSPrincipalClass value, currently Comics.

Is there a specific error you're encountering?

Ja...@mungki.co.uk

unread,
Feb 27, 2009, 6:26:52 AM2/27/09
to frontpython-discuss.
thanks for the reply, yeah i seem to be encountering a problem when i
go to build the plugin, it starts running then i get an error:

running py2app
creating /Users/james/Desktop/Comics/build
creating /Users/james/Desktop/Comics/build/bdist.macosx-10.5-i386
creating /Users/james/Desktop/Comics/build/bdist.macosx-10.5-i386/
python2.5-standalone
creating /Users/james/Desktop/Comics/build/bdist.macosx-10.5-i386/
python2.5-standalone/app
creating /Users/james/Desktop/Comics/build/bdist.macosx-10.5-i386/
python2.5-standalone/app/collect
creating /Users/james/Desktop/Comics/build/bdist.macosx-10.5-i386/
python2.5-standalone/app/temp
creating /Users/james/Desktop/Comics/dist
creating build/bdist.macosx-10.5-i386/python2.5-standalone/app/lib-
dynload
creating build/bdist.macosx-10.5-i386/python2.5-standalone/app/
Frameworks
Traceback (most recent call last):
File "/System/Library/Frameworks/Python.framework/Versions/2.5/
Extras/lib/python/py2app/build_app.py", line 570, in _run
self.run_normal()
File "/System/Library/Frameworks/Python.framework/Versions/2.5/
Extras/lib/python/py2app/build_app.py", line 622, in run_normal
mf = self.get_modulefinder()
File "/System/Library/Frameworks/Python.framework/Versions/2.5/
Extras/lib/python/py2app/build_app.py", line 530, in get_modulefinder
debug=debug,
File "/System/Library/Frameworks/Python.framework/Versions/2.5/
Extras/lib/python/modulegraph/find_modules.py", line 255, in
find_modules
find_needed_modules(mf, scripts, includes, packages)
File "/System/Library/Frameworks/Python.framework/Versions/2.5/
Extras/lib/python/modulegraph/find_modules.py", line 176, in
find_needed_modules
mf.run_script(path)
File "/System/Library/Frameworks/Python.framework/Versions/2.5/
Extras/lib/python/modulegraph/modulegraph.py", line 369, in run_script
self.scan_code(co, m)
File "/System/Library/Frameworks/Python.framework/Versions/2.5/
Extras/lib/python/modulegraph/modulegraph.py", line 610, in scan_code
self._safe_import_hook(name, m, fromlist)
File "/System/Library/Frameworks/Python.framework/Versions/2.5/
Extras/lib/python/modulegraph/modulegraph.py", line 540, in
_safe_import_hook
mods = self.import_hook(name, caller)
File "/System/Library/Frameworks/Python.framework/Versions/2.5/
Extras/lib/python/modulegraph/modulegraph.py", line 381, in
import_hook
m = self.load_tail(q, tail)
File "/System/Library/Frameworks/Python.framework/Versions/2.5/
Extras/lib/python/modulegraph/modulegraph.py", line 441, in load_tail
m = self.import_module(head, mname, m)
File "/System/Library/Frameworks/Python.framework/Versions/2.5/
Extras/lib/python/modulegraph/modulegraph.py", line 498, in
import_module
m = self.load_module(fqname, fp, pathname, stuff)
File "/System/Library/Frameworks/Python.framework/Versions/2.5/
Extras/lib/python/modulegraph/modulegraph.py", line 533, in
load_module
self.scan_code(co, m)
File "/System/Library/Frameworks/Python.framework/Versions/2.5/
Extras/lib/python/modulegraph/modulegraph.py", line 610, in scan_code
self._safe_import_hook(name, m, fromlist)
File "/System/Library/Frameworks/Python.framework/Versions/2.5/
Extras/lib/python/modulegraph/modulegraph.py", line 540, in
_safe_import_hook
mods = self.import_hook(name, caller)
File "/System/Library/Frameworks/Python.framework/Versions/2.5/
Extras/lib/python/modulegraph/modulegraph.py", line 380, in
import_hook
q, tail = self.find_head_package(parent, name)
File "/System/Library/Frameworks/Python.framework/Versions/2.5/
Extras/lib/python/modulegraph/modulegraph.py", line 419, in
find_head_package
q = self.import_module(head, qname, parent)
File "/System/Library/Frameworks/Python.framework/Versions/2.5/
Extras/lib/python/modulegraph/modulegraph.py", line 498, in
import_module
m = self.load_module(fqname, fp, pathname, stuff)
File "/System/Library/Frameworks/Python.framework/Versions/2.5/
Extras/lib/python/modulegraph/modulegraph.py", line 512, in
load_module
co = compile(fp.read() + '\n', pathname, 'exec')
File "/Users/james/Desktop/Comics/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')
(Pdb)

Jon Christopher

unread,
Mar 16, 2009, 1:27:27 PM3/16/09
to frontpyth...@googlegroups.com
Why are there three closing parens in your line 104 below? That would
cause a syntax error...
Reply all
Reply to author
Forward
0 new messages