DannyB Moderator


Joined: 02 Apr 2003 Posts: 3991 Location: Lawrence, Kansas, USA
|
Posted: Wed Aug 20, 2003 12:27 pm Post subject: Unable to LoadComponentFromURL in Python? |
|
|
Okay, next Python to OOo problem I'm having.
From the Desktop object, I am unable to even call LoadComponentFromURL.
I get the Desktop object, roughly like this...
| Code: | import uno
# get the uno component context from the PyUNO runtime
oLocalContext = uno.getComponentContext()
# create the UnoUrlResolver
oLocalResolver = oLocalContext.ServiceManager.createInstanceWithContext(
"com.sun.star.bridge.UnoUrlResolver", oLocalContext )
# connect to the running office
OOo_Context = oLocalResolver.resolve( "uno:socket,host=localhost,port=8100;urp;StarOffice.ComponentContext" )
# get the ServiceManager object
OOo_ServiceManager = OOo_Context.ServiceManager
# get the central desktop object
OOo_Desktop = OOo_ServiceManager.createInstanceWithContext( "com.sun.star.frame.Desktop", OOo_Context )
|
Now, I can look at a method like this...
| Code: | >>> OOo_Desktop.getComponents
<PyUNO_callable object at 0x01A8E320>
|
and see that it is a callable method. But if I try to look at method LoadComponentFromURL, there is no such method...
| Code: | >>> OOo_Desktop.LoadComponentFromURL
Traceback (most recent call last):
File "<pyshell#37>", line 1, in ?
oDesktop.LoadComponentFromURL
AttributeError: LoadComponentFromURL
|
So I'm not surprised that I cannot even call LoadComponentFromURL, the method doesn't even seem to be in the Desktop object, from Python's perspective.
Any idea what's up? _________________ Want to make OOo Drawings like the colored flower design to the left? |
|