xref: /aoo41x/main/pyuno/demo/swritercompclient.py (revision bd8ef897)
1*bd8ef897SAndrew Rist# *************************************************************
2*bd8ef897SAndrew Rist#
3*bd8ef897SAndrew Rist#  Licensed to the Apache Software Foundation (ASF) under one
4*bd8ef897SAndrew Rist#  or more contributor license agreements.  See the NOTICE file
5*bd8ef897SAndrew Rist#  distributed with this work for additional information
6*bd8ef897SAndrew Rist#  regarding copyright ownership.  The ASF licenses this file
7*bd8ef897SAndrew Rist#  to you under the Apache License, Version 2.0 (the
8*bd8ef897SAndrew Rist#  "License"); you may not use this file except in compliance
9*bd8ef897SAndrew Rist#  with the License.  You may obtain a copy of the License at
10*bd8ef897SAndrew Rist#
11*bd8ef897SAndrew Rist#    http://www.apache.org/licenses/LICENSE-2.0
12*bd8ef897SAndrew Rist#
13*bd8ef897SAndrew Rist#  Unless required by applicable law or agreed to in writing,
14*bd8ef897SAndrew Rist#  software distributed under the License is distributed on an
15*bd8ef897SAndrew Rist#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*bd8ef897SAndrew Rist#  KIND, either express or implied.  See the License for the
17*bd8ef897SAndrew Rist#  specific language governing permissions and limitations
18*bd8ef897SAndrew Rist#  under the License.
19*bd8ef897SAndrew Rist#
20*bd8ef897SAndrew Rist# *************************************************************
21*bd8ef897SAndrew Rist
22cdf0e10cSrcweir# instantiating
23cdf0e10cSrcweirimport uno
24cdf0e10cSrcweir
25cdf0e10cSrcweirlocalContext = uno.getComponentContext()
26cdf0e10cSrcweirresolver = localContext.ServiceManager.createInstanceWithContext(
27cdf0e10cSrcweir				"com.sun.star.bridge.UnoUrlResolver", localContext )
28cdf0e10cSrcweirremoteContext = resolver.resolve( "uno:socket,host=localhost,port=2002;urp;StarOffice.ComponentContext" )
29cdf0e10cSrcweirremoteSmgr = remoteContext.ServiceManager
30cdf0e10cSrcweir
31cdf0e10cSrcweirpyComp = remoteSmgr.createInstanceWithContext( "org.openoffice.demo.SWriter" , remoteContext )
32cdf0e10cSrcweir
33cdf0e10cSrcweirpyComp.run( (), )
34cdf0e10cSrcweir
35