Hello,
I wonder how and where the environment variables for Openoffice set up
after installing Openoffice package.
My issue is that I wanna move previous installed Openoffice to other
machine which doesn't have any distribution package for Openoffice.
I could launch it without any error but I tried to start it with
python scritp as follows:

----------------------------------------------------------------------------------------
import socket  # only needed on win32-OOo3.0.0
import uno

# get the uno component context from the PyUNO runtime
localContext = uno.getComponentContext()

# create the UnoUrlResolver
resolver = localContext.ServiceManager.createInstanceWithContext(
                                "com.sun.star.bridge.UnoUrlResolver", 
localContext )

# connect to the running office
ctx = resolver.resolve(
"uno:socket,host=localhost,port=2002;urp;StarOffice.ComponentContext"
)
smgr = ctx.ServiceManager

# get the central desktop object
desktop = smgr.createInstanceWithContext( "com.sun.star.frame.Desktop",ctx)

# access the current writer document
model = desktop.getCurrentComponent()

# access the document's text property
text = model.Text

# create a cursor
cursor = text.createTextCursor()

# insert the text into the document
text.insertString( cursor, "Hello World", 0 )
ctx.ServiceManager
----------------------------------------------------------------------------

I got error msg at this part:
localContext = uno.getComponentContext()
AttributeError: 'module' object has no attribute 'getComponentContext

I set up environment variables as follows by refering to
http://hg.services.openoffice.org/DEV300/file/2ebd15d9e8a6/pyuno/zipcore/python.sh#l57

_=/usr/bin/printenv
URE_BOOTSTRAP=vnd.sun.star.pathname:/usr/lib/openoffice/program/fundamentalrc
PYTHONPATH=:/usr/lib/openoffice/basis3.1/program/
HOME=/home/vaio
SUDO_COMMAND=/bin/bash
SHLVL=2
LANG=en_US.UTF-8
PWD=/home/
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/X11R6/bin:/usr/lib/openoffice/program/
LD_LIBRARY_PATH=:/usr/lib/openoffice/basis3.1/ure-link/lib:/usr/lib/openoffice/basis3.1/program
USER=root
OLDPWD=/home
TERM=xterm
SHELL=/bin/bash

Any help is appreciated.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@udk.openoffice.org
For additional commands, e-mail: dev-h...@udk.openoffice.org

Reply via email to