Forum at OOoForum.orgThe Forum
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

some problems ...

Post new topic   Reply to topic Forum Index -> Macros and API
View previous topic :: View next topic  
Author Message

Joined: 26 Oct 2007
Posts: 2
Location: Bucuresti

PostPosted: Sun Oct 28, 2007 7:46 am    Post subject: some problems ... Reply with quote

I try to use sopenoffice + python !
I use python2.4 and openoffice 2.0
Problem :
I see this example
and i try to use on this mode :

import os
import random
from sys import platform
from time import sleep

import uno
from import NoConnectException
from import Exception as UnoException

sOffice = os.path.join("/usr/lib/openoffice/program/soffice", "soffice")
if platform.startswith("win"):
    sOffice += ".exe"
sPipeName = "uno" + str(random.random())[2:]
cmdArray = (sOffice, "-nologo", "-nodefault", "".join(["-accept=pipe,name=", sPipeName, ";urp;"]))     
os.spawnv(os.P_NOWAIT, sOffice, cmdArray)
xLocalContext = uno.getComponentContext()
resolver = xLocalContext.ServiceManager.createInstanceWithContext("", xLocalContext)
sConnect = "".join(["uno:pipe,name=", sPipeName, ";urp;StarOffice.ComponentContext"])
xContext = resolver.resolve(sConnect)

the output is this error:
Traceback (most recent call last):
  File "", line 24, in ?
    xContext = resolver.resolve(sConnect) Connector : couldn't connect to pipe uno49118954922(10)

Have some suggestion for me ?
Thanks !
I suppouse is from this line
cmdArray = (sOffice, "-nologo", "-nodefault", "".join(["-accept=pipe,name=", sPipeName, ";urp;"]))   

You see

and i try some example with

and is work . The diff is this " but i not sure ...
sorry but i d'ont speak very well eng .
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic Forum Index -> Macros and API All times are GMT - 8 Hours
Page 1 of 1

Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Powered by phpBB © 2001, 2005 phpBB Group