Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Python/UNO/OpenOffice?
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  15 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
kenneth.m.mcdon...@sbcglobal.net  
View profile  
 More options Sep 30 2006, 1:33 am
Newsgroups: comp.lang.python
From: kenneth.m.mcdon...@sbcglobal.net
Date: Sat, 30 Sep 2006 05:33:00 GMT
Subject: Python/UNO/OpenOffice?
Are then any currently active and reasonably mature Python plugins/
apis/whatever for programming/scripting OpenOffice? The page I've
found is http://udk.openoffice.org/python/python-bridge.html, but
it was last updated more than a year ago.

Thanks,
Ken


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
gregarican  
View profile  
 More options Sep 30 2006, 1:50 am
Newsgroups: comp.lang.python
From: "gregarican" <greg.kuj...@gmail.com>
Date: 29 Sep 2006 22:50:27 -0700
Local: Sat, Sep 30 2006 1:50 am
Subject: Re: Python/UNO/OpenOffice?
Just because the last code update was a little over a year ago doesn't
mean the UNO project is dead. If the OpenOffice API has remained
basically the same since UNO was last updated and the Python wrappers
are relatively comprehensive then it should fit the bill. Googling
around the UNO project was the only thing I found off-hand as well...


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Gary Herron  
View profile  
 More options Sep 30 2006, 2:04 am
Newsgroups: comp.lang.python
From: Gary Herron <gher...@islandtraining.com>
Date: Fri, 29 Sep 2006 23:04:14 -0700
Local: Sat, Sep 30 2006 2:04 am
Subject: Re: Python/UNO/OpenOffice?
kenneth.m.mcdon...@sbcglobal.net wrote:
> Are then any currently active and reasonably mature Python plugins/
> apis/whatever for programming/scripting OpenOffice? The page I've
> found is http://udk.openoffice.org/python/python-bridge.html, but
> it was last updated more than a year ago.

> Thanks,
> Ken

I don't believe that information is out-of-date. I use the python-bridge
with the OpenOffice version 2.0.3 quite successfully. In my case I open
a spread sheet and search around for and extract various values. It
works just fine for me.

Gary Herron


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
gregarican  
View profile  
 More options Sep 30 2006, 2:14 am
Newsgroups: comp.lang.python
From: "gregarican" <greg.kuj...@gmail.com>
Date: 29 Sep 2006 23:14:34 -0700
Local: Sat, Sep 30 2006 2:14 am
Subject: Re: Python/UNO/OpenOffice?
That's what I would imagine. Kind of like calling some Microsoft Office
COM/OLE methods in a wrapper. As long as the wrapper has most of the
methods you need and the core COM/OLE calls don't change then that's a
great start.


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Sybren Stuvel  
View profile  
 More options Sep 30 2006, 3:45 am
Newsgroups: comp.lang.python
From: Sybren Stuvel <sybren...@YOURthirdtower.com.imagination>
Date: Sat, 30 Sep 2006 09:45:52 +0200
Local: Sat, Sep 30 2006 3:45 am
Subject: Re: Python/UNO/OpenOffice?
kenneth.m.mcdon...@sbcglobal.net enlightened us with:

> Are then any currently active and reasonably mature Python plugins/
> apis/whatever for programming/scripting OpenOffice? The page I've
> found is http://udk.openoffice.org/python/python-bridge.html, but it
> was last updated more than a year ago.

Aside from what has already been said, it might be nice for you to
read my article about OOo and Python at
http://www.stuvel.eu/ooo-python ;-)

Sybren
--
Sybren Stüvel
Stüvel IT - http://www.stuvel.eu/


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
wesley chun  
View profile  
 More options Sep 30 2006, 1:49 pm
Newsgroups: comp.lang.python
From: "wesley chun" <wes...@gmail.com>
Date: Sat, 30 Sep 2006 10:49:03 -0700
Local: Sat, Sep 30 2006 1:49 pm
Subject: Re: Python/UNO/OpenOffice?
as others have said, that project provides a working interface to OOo
(OpenOffice 2 on Ubuntu Breezy and Dapper).  i've made several posts
to this regard over the summer here on CLP.  i was mostly using it to
"mess around" with documents in StarWriter.

cheers,
-- wesley
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
"Core Python Programming", Prentice Hall, (c)2007,2001
    http://corepython.com

wesley.j.chun :: wescpy-at-gmail.com
python training and technical consulting
cyberweb.consulting : silicon valley, ca
http://cyberwebconsulting.com


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
John Machin  
View profile  
 More options Sep 30 2006, 9:21 pm
Newsgroups: comp.lang.python
From: "John Machin" <sjmac...@lexicon.net>
Date: 30 Sep 2006 18:21:17 -0700
Local: Sat, Sep 30 2006 9:21 pm
Subject: Re: Python/UNO/OpenOffice?

Sybren Stuvel wrote:
> kenneth.m.mcdon...@sbcglobal.net enlightened us with:
> > Are then any currently active and reasonably mature Python plugins/
> > apis/whatever for programming/scripting OpenOffice? The page I've
> > found is http://udk.openoffice.org/python/python-bridge.html, but it
> > was last updated more than a year ago.

> Aside from what has already been said, it might be nice for you to
> read my article about OOo and Python at
> http://www.stuvel.eu/ooo-python ;-)

Hi, Sybren. I tried folloing your recipe on Windows with OOo 2.0 ...

Minor problem: the executable is called soffice, not ooffice.

Major problem: it crashed right at the start, somewhere in the maze of
dlls.

The following interactive session reproduces the problem:

| C:\Program Files\OpenOffice.org
2.0\program\python-core-2.3.4\bin>python

# OOo includes a complete python distribution. Note the directory name
says 2.3.4 ...

| Python 2.3.5 (#62, Feb  8 2005, 16:23:02) [MSC v.1200 32 bit (Intel)]
on win32

... but the program identifies itself as 2.3.5

| Type "help", "copyright", "credits" or "license" for more
information.
| >>> import sys
| >>> sys.path.append(r'C:\Program Files\OpenOffice.org 2.0\program')

# The above directory contains all the dlls plus a handful of python
files

| >>> import pyuno # from pyuno.dll; there's no other pyuno.*
| >>> _g_ctx = pyuno.getComponentContext()

# crash

Has anyone managed to get further than this on Windows (XP Pro, SP 2)?

Cheers,
John


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Sybren Stuvel  
View profile  
 More options Oct 1 2006, 8:13 am
Newsgroups: comp.lang.python
From: Sybren Stuvel <sybren...@YOURthirdtower.com.imagination>
Date: Sun, 1 Oct 2006 14:13:23 +0200
Local: Sun, Oct 1 2006 8:13 am
Subject: Re: Python/UNO/OpenOffice?
John Machin enlightened us with:

> Hi, Sybren. I tried folloing your recipe on Windows with OOo 2.0 ...

> Minor problem: the executable is called soffice, not ooffice.

> Major problem: it crashed right at the start, somewhere in the maze
> of dlls.

That's not nice.

> Has anyone managed to get further than this on Windows (XP Pro, SP
> 2)?

Not me - I'm not using Windows. If anyone knows more about this,
please post here or post a comment at
http://www.stuvel.eu/archive/31/article-about-openofficeorg-and-python
so that I can improve the article.

Sybren
--
Sybren Stüvel
Stüvel IT - http://www.stuvel.eu/


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
olive  
View profile  
 More options Oct 2 2006, 3:27 am
Newsgroups: comp.lang.python
From: "olive" <ocolli...@gmail.com>
Date: 2 Oct 2006 00:27:34 -0700
Local: Mon, Oct 2 2006 3:27 am
Subject: Re: Python/UNO/OpenOffice?
For me the problem is that OO2.0 is compiled against P2.3.

Is there any OO compiled with P2.4x for Windows somewhere ?


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Colin J. Williams  
View profile  
 More options Oct 2 2006, 7:56 am
Newsgroups: comp.lang.python
From: "Colin J. Williams" <c...@sympatico.ca>
Date: Mon, 02 Oct 2006 07:56:58 -0400
Local: Mon, Oct 2 2006 7:56 am
Subject: Re: Python/UNO/OpenOffice?

I've done some small things with Python/OpenOffice, using Windows XP.
They appear to work OK.

It seems that there is only one person to maintain the Python interface
and that there few users - no critical mass.  I hope that this will
change as OpenOffice is, with the exception of the Base component, a
solid package. The base (database) component is evolving.

Colin W.


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
John Machin  
View profile  
 More options Oct 2 2006, 8:35 am
Newsgroups: comp.lang.python
From: "John Machin" <sjmac...@lexicon.net>
Date: 2 Oct 2006 05:35:56 -0700
Local: Mon, Oct 2 2006 8:35 am
Subject: Re: Python/UNO/OpenOffice?

Colin J. Williams wrote:
> I've done some small things with Python/OpenOffice, using Windows XP.
> They appear to work OK.

As you might have noticed from my earlier post, I can't get off the
ground. Can you please give an example (with code) of a "small thing"
that works OK?

TIA,
John


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
olive  
View profile  
 More options Oct 2 2006, 9:08 am
Newsgroups: comp.lang.python
From: "olive" <ocolli...@gmail.com>
Date: 2 Oct 2006 06:08:03 -0700
Local: Mon, Oct 2 2006 9:08 am
Subject: Re: Python/UNO/OpenOffice?
John,

Here is something that works for me under XPsp2 to either save a doc or
save it as PDF:

    filepath = argv[0]
    exportpdf  = argv[1]

    ctxLocal = uno.getComponentContext()
    smgrLocal = ctxLocal.ServiceManager
    resolver =
smgrLocal.createInstanceWithContext("com.sun.star.bridge.UnoUrlResolver",ct xLocal)
    url =
"uno:socket,host=localhost,port=2002;urp;StarOffice.ComponentContext"
    ctx = resolver.resolve(url)
    smgr = ctx.ServiceManager
    desktop =
smgr.createInstanceWithContext("com.sun.star.frame.Desktop",ctx)

    properties = []
    if exportpdf == "yes":
        p = PropertyValue()
        p.Name = "Hidden"
        p.Value = True
        properties.append(p)
    properties = tuple(properties)
    doc = desktop.loadComponentFromURL("file:///c:"+filepath+".odt" ,
"_blank", 0, properties)

    if exportpdf == "yes":
        properties = []

        p = PropertyValue()
        p.Name = "Overwrite"
        p.Value = True
        properties.append(p)

        p = PropertyValue()
        p.Name = "FilterName"
        p.Value = 'writer_pdf_Export'
        properties.append(p)

        properties = tuple(properties)
        doc.storeToURL("file:///c:"+filepath+".pdf", properties)

    else:
        doc.store()

    doc.dispose()

You must start OO this way first:
cd C:\Program Files\OpenOffice.org 2.0\program
soffice "-accept=socket,host=localhost,port=2002;urp;"


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
olive  
View profile  
 More options Oct 2 2006, 9:14 am
Newsgroups: comp.lang.python
From: "olive" <ocolli...@gmail.com>
Date: 2 Oct 2006 06:14:22 -0700
Local: Mon, Oct 2 2006 9:14 am
Subject: Re: Python/UNO/OpenOffice?

... and you have to start your py file with:

import uno, sys, socket
from com.sun.star.beans import PropertyValue

... and your start_oo_server.bat file with:

@SET PYTHONPATH=C:\Program Files\OpenOffice.org 2.0\program;C:\Program
Files\OpenOffice.org 2.0\program\python-core-2.3.4\lib
@SET PATH=C:\Program Files\OpenOffice.org 2.0\program;C:\Program
Files\OpenOffice.org 2.0\program\python-core-2.3.4\bin


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
John Machin  
View profile  
 More options Oct 2 2006, 10:46 am
Newsgroups: comp.lang.python
From: "John Machin" <sjmac...@lexicon.net>
Date: 2 Oct 2006 07:46:53 -0700
Local: Mon, Oct 2 2006 10:46 am
Subject: Re: Python/UNO/OpenOffice?

olive wrote:
> ... and you have to start your py file with:

> import uno, sys, socket
> from com.sun.star.beans import PropertyValue

> ... and your start_oo_server.bat file with:

> @SET PYTHONPATH=C:\Program Files\OpenOffice.org 2.0\program;C:\Program
> Files\OpenOffice.org 2.0\program\python-core-2.3.4\lib
> @SET PATH=C:\Program Files\OpenOffice.org 2.0\program;C:\Program
> Files\OpenOffice.org 2.0\program\python-core-2.3.4\bin

Many thanks for all that, olive; I made the minimal hacks to make it
open an XLS ffile, and it worked!
I'll try to see why that worked and my previous experiment crashed
inside a DLL.
Cheers,
John

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Sybren Stuvel  
View profile  
 More options Oct 2 2006, 12:52 pm
Newsgroups: comp.lang.python
From: Sybren Stuvel <sybren...@YOURthirdtower.com.imagination>
Date: Mon, 2 Oct 2006 18:52:31 +0200
Local: Mon, Oct 2 2006 12:52 pm
Subject: Re: Python/UNO/OpenOffice?
John Machin enlightened us with:

> Many thanks for all that, olive; I made the minimal hacks to make it
> open an XLS ffile, and it worked!
> I'll try to see why that worked and my previous experiment crashed
> inside a DLL.

Thanks, keep us posted!

Sybren
--
Sybren Stüvel
Stüvel IT - http://www.stuvel.eu/


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google