Re: [pyxpcom] What changed in PyXPCOM component registration in 1.9?
by Mark Hammond other posts by this author
Nov 29 2007 3:01PM messages near this date
view in the new Beta List Site
Re: [pyxpcom] What changed in PyXPCOM component registration in 1.9?
|
Re: [pyxpcom] What changed in PyXPCOM component registration in 1.9?
> 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)
So don't do that!
> I get a lot of this:
>
> -- loadModule path
> /Users/lauri/Documents/koodi/CommunityTV/branches/smak2/components/SMAK
> /semantic_overlay/scripts/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/Co
> ntents/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/Co
> ntents/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/Co
> ntents/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.
The stuff in the 'component' directory is only supposed to relate to
components. Trying to convince the system to use a more general-purpose
directory to store components is not a supported use-case. Maybe you can
step back and tell us what problem you were trying to solve in the first
place?
Mark
_______________________________________________
pyxpcom mailing list
pyxpcom@[...].com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Thread:
Lauri Kainulainen
Mark Hammond
Lauri Kainulainen
Mark Hammond
|