Subject: Python script didn't work

From: [email-masked]
Date: Tue, 27 Jan 2009 17:07:15 -0500

Hello,

I am having the same problem as Phil. I tried the testunoconv.py as you suggested (picking a different file and using a lowercase 'f' in "from"), and received the following error message:

Traceback (most recent call last):
  File "./conv.py", line 14, in <module>
    doc = desktop.loadComponentFromURL( FILE , "_blank", 0, inputprops )
__main__.IllegalArgumentException: URL seems to be an unsupported one.

I did start openoffice with the command you gave, but besides not working, it actually took up 100% of my CPU while it was running.

I have tried removing my ~/.openoffice.org2 directory (which does contain some unoconv stuff), but it made no difference.

$ mv .openoffice.org2/ old.openoffice.org2
$ cat conv.py
#!/usr/bin/env python

FILE='/tmp/somefile.odt'

import uno
from com.sun.star.beans import PropertyValue
localContext = uno.getComponentContext()
resolver = localContext.ServiceManager.createInstanceWithContext(
    "com.sun.star.bridge.UnoUrlResolver", localContext)
ctx = resolver.resolve( "uno:socket,host=localhost,port=2002;urp;StarOffice.ComponentContext" )
smgr = ctx.ServiceManager
desktop = smgr.createInstanceWithContext( "com.sun.star.frame.Desktop",ctx)
inputprops = ( PropertyValue( "Hidden" , 0 , True, 0 ), )
doc = desktop.loadComponentFromURL( FILE , "_blank", 0, inputprops )
$ soffice "-accept=socket,host=localhost,port=2002;urp;"
$ ./conv.py
Traceback (most recent call last):
  File "./conv.py", line 14, in <module>
    doc = desktop.loadComponentFromURL( FILE , "_blank", 0, inputprops )
__main__.IllegalArgumentException: URL seems to be an unsupported one.
$

Hope this helps.

-- 
dwk

Seek and ye shall find. quaere et invenies.

"Simplicity does not precede complexity, but follows it." -- Alan Perlis
"Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
"The only real mistake is the one from which we learn nothing." -- John Powell

My website: http://dwks.theprogrammingsite.com/