Re: [pyxpcom] What changed in PyXPCOM component registration in 1.9?
by Lauri Kainulainen other posts by this author
Nov 29 2007 2:14AM messages near this date
view in the new Beta List Site
[pyxpcom] int array in pyxpcom
|
Re: [pyxpcom] What changed in PyXPCOM component registration in 1.9?
Hi,
I'm moving this discussion here since this seems to be the right forum.
mhammond wrote:
> On Nov 28, 12:26 am, Lauri Kainulainen <lauri.kainulai...@[...].com>
> wrote:
> > Hi all,
> >
> > I've moved to trunk from using 1.8 branch and my PyXPCOM-registration
> > is acting weird. I'm using a components folder that contains a
> > subfolder with all the python modules my components need. So something
> > like:
> >
> > components/
> > components/MyPythonModules
> > MyApp.app/
> > MyApp.app/Contents
> > MyApp.app/Contents/components <- links to /components
> >
> > on 1.8 it worked like a dream, but on 1.9 I'm thinking that pyxpcom is
> > trying to load the python files under 'MyPythonModules' as XPCOM
> > components and I end up with a more or less infinite amount of errors.
>
> I can't recall any significant changes to the pyxpcom loader process
> in that timeframe. You may want to debug xpcom/server/loader.py to
> try and see what is going on and why.
I placed a print in xpcom/server/loader.py:ModuleLoader-> loadModule:
def loadModule(self, aFile):
print "-- loadModule path", aFile.path
return self._getCOMModuleForLocation(aFile)
And when I link my whole components directory into the App-folder
(including all non-XPCOM-python files) I get a lot of this:
-- loadModule path
/Users/lauri/Documents/koodi/CommunityTV/branches/smak2/components/SMAK/semantic_overlay/scr
ipts/probe.pyc
DEBUG:xpcom:'int8 loadModule(in nsISomething, out retval nsISomething);'
raised COM Exception -2147024809 (-2147024809)
Traceback (most recent call last):
File
"/Users/lauri/Documents/koodi/CommunityTV/branches/smak2/XULSmak.app/Contents/Frameworks/XUL
.framework-debug-trunk-2/python/xpcom/server/policy.py",
line 277, in _CallMethod_
return 0, func(*params)
File
"/Users/lauri/Documents/koodi/CommunityTV/branches/smak2/XULSmak.app/Contents/Frameworks/XUL
.framework-debug-trunk-2/python/xpcom/server/loader.py",
line 96, in loadModule
return self._getCOMModuleForLocation(aFile)
File
"/Users/lauri/Documents/koodi/CommunityTV/branches/smak2/XULSmak.app/Contents/Frameworks/XUL
.framework-debug-trunk-2/python/xpcom/server/loader.py",
line 102, in _getCOMModuleForLocation
raise xpcom.ServerException(nsError.NS_ERROR_INVALID_ARG)
ServerException: -2147024809 (-2147024809)
Which comes from loader.py:ModuleLoader-> _getCOMModuleForLocation:
if not fqn.endswith(".py"):
raise xpcom.ServerException(nsError.NS_ERROR_INVALID_ARG)
So it seems that loadModule is getting all the files from the
subdirectories as well. As I can't find anything under
XUL.framework/python that calls loadModule, I'm guessing that the "new
feature" is somewhere outside pyxpcom and instead of just getting
.py-files, loadModule receives all of them.
> Also note that typing "pyxpcom" into google, the first link is to the
> Mozilla developer wiki, and you will find a pointer to a mailing list
> dedicated to pyxpcom, where you might find a better audience for
> pyxpcom stuff.
Thanks for the tip. It's a bit confusing that
http://developer.mozilla.org/en/docs/PyXPCOM points to the xpcom-list.
Cheers,
Lauri Kainulainen
--
Lauri Kainulainen
___SW Designer
_____University of Art and Design Helsinki
_______________________________________________
pyxpcom mailing list
pyxpcom@[...].com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Thread:
Lauri Kainulainen
Mark Hammond
Lauri Kainulainen
Mark Hammond
|