Kaydet (Commit) 7f4cb275 authored tarafından Lionel Elie Mamane's avatar Lionel Elie Mamane

fix loading of python-uno module by package.module name

üst 84a3f11c
...@@ -111,16 +111,18 @@ class Loader( XImplementationLoader, XServiceInfo, unohelper.Base ): ...@@ -111,16 +111,18 @@ class Loader( XImplementationLoader, XServiceInfo, unohelper.Base ):
g_loadedComponents[url] = mod g_loadedComponents[url] = mod
return mod return mod
elif "vnd.openoffice.pymodule" == protocol: elif "vnd.openoffice.pymodule" == protocol:
# the failure is on symbol lookup later in the parent ...
print ("Warning: Python module loading is almost certainly pre-broken")
nSlash = dependent.rfind('/') nSlash = dependent.rfind('/')
if -1 != nSlash: if -1 != nSlash:
path = unohelper.fileUrlToSystemPath( dependent[0:nSlash] ) path = unohelper.fileUrlToSystemPath( dependent[0:nSlash] )
dependent = dependent[nSlash+1:len(dependent)] dependent = dependent[nSlash+1:len(dependent)]
if not path in sys.path: if not path in sys.path:
sys.path.append( path ) sys.path.append( path )
var = __import__( dependent ) mod = __import__( dependent )
return var path_component, dot, rest = dependent.partition('.')
while dot == '.':
path_component, dot, rest = rest.partition('.')
mod = getattr(mod, path_component)
return mod
else: else:
if DEBUG: if DEBUG:
print("Unknown protocol '" + protocol + "'"); print("Unknown protocol '" + protocol + "'");
...@@ -140,7 +142,6 @@ class Loader( XImplementationLoader, XServiceInfo, unohelper.Base ): ...@@ -140,7 +142,6 @@ class Loader( XImplementationLoader, XServiceInfo, unohelper.Base ):
mod = self.getModuleFromUrl( locationUrl ) mod = self.getModuleFromUrl( locationUrl )
implHelper = mod.__dict__.get( "g_ImplementationHelper" , None ) implHelper = mod.__dict__.get( "g_ImplementationHelper" , None )
if DEBUG: if DEBUG:
print ("dump stuff")
print ("Fetched ImplHelper as " + str(implHelper)) print ("Fetched ImplHelper as " + str(implHelper))
if implHelper == None: if implHelper == None:
return mod.getComponentFactory( implementationName, self.ctx.ServiceManager, regKey ) return mod.getComponentFactory( implementationName, self.ctx.ServiceManager, regKey )
......
...@@ -59,7 +59,6 @@ class FaxWizardDialogImpl(FaxWizardDialog): ...@@ -59,7 +59,6 @@ class FaxWizardDialogImpl(FaxWizardDialog):
def startWizard(self, xMSF): def startWizard(self, xMSF):
self.running = True self.running = True
try: try:
print "entra"
#Number of steps on WizardDialog #Number of steps on WizardDialog
self.nMaxStep = 5 self.nMaxStep = 5
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment