Hi,
I previously had this kind of problem with OOo ...
until I realize that my LD_LIBRARY_PATH and PYTHONPATH where not correct
and that I was using the OOo1.1.x python-uno bridge with OOo2 (and thus
the wrong services.rdb).
Check with ldd or gcc that you are really using the correct lib with
your pyuno.
Hope it helps,
Pierre
Le mardi 26 juillet 2005 à 18:42 +0200, Laurent Godard a écrit :
> Hi all
>
> i simply try to load/export a file using PyUNO in OOo2 (m118)
> (code at the end)
>
> i end with this error
> Traceback (most recent call last):
> File "./testMe.py", line 23, in ?
> sourceDoc.storeToURL(url,args)
> AttributeError: storeToURL
>
>
> while all is ok with 1.1.4
> the same code (or nearly) as macro works
>
> I tried alot of source files, target format (PDF, MS, nothoing ..)
> same result ...
> same also with a storeAsURL
>
> Is it a known issue ? Am I to tired ?
>
> Thanks in advance
>
> laurent
> '----------------
> import uno, unohelper
> from com.sun.star.beans import PropertyValue
>
>
> theSourceFile="/home/lgodard/Chronique.sxw"
> theTargetFile="/home/lgodard/tmp/toto.pdf"
>
> localContext = uno.getComponentContext()
> resolver =
> localContext.ServiceManager.createInstanceWithContext('com.sun.star.bridge.UnoUrlResolver',
>
> localContext )
> ctx =
> resolver.resolve('uno:socket,host=%s,port=%s;urp;StarOffice.ComponentContext'
> % ('localhost', '2002'))
>
> smgr = ctx.ServiceManager
> desktop =
> smgr.createInstanceWithContext('com.sun.star.frame.Desktop',ctx)
>
>
> args = (PropertyValue('Hidden', 0, False, 0),)
> url = unohelper.systemPathToFileUrl(theSourceFile)
> sourceDoc = desktop.loadComponentFromURL(url, '_blank', 0, args)
>
> url = unohelper.systemPathToFileUrl(theTargetFile)
> args = (PropertyValue('FilterName', 0, 'writer_pdf_Export', 0),)
>
> sourceDoc.storeToURL(url,args)
> sourceDoc.close(True)
>
>
--
Pierre Martineau
mail: [EMAIL PROTECTED]
Bibus home: http://bibus-biblio.sourceforge.net/
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]