Bug 37058 - Starting libreoffice with (python)script by shell command impossible
Summary: Starting libreoffice with (python)script by shell command impossible
Status: RESOLVED INVALID
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: BASIC (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-10 03:15 UTC by a.richi
Modified: 2012-12-29 14:54 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description a.richi 2011-05-10 03:15:08 UTC
Hello!

I wrote a macro using python (pyUno) and have to start it from the terminal. In the documentation, I found the following way to do that:

libreoffice /home/me/desktop/myEmptyFile.odt "vnd.sun.star.script:HelloWorld.py$helloWorldPython?language=Python&location=user"

Where the file HelloWorld.py is in the following dir:    /home/me/.libreoffice/3/user/Scripts/python/
And the file contains the following function as you can see in the code below: helloWorldPython()

But it doesn't work, I get an Error in from the file pythonscript.py in line 896 which should load the python scripts... I tried locating the bug. As far as I can see, the scriptUri in the function 'getScript' around line 896 contains the wrong string ('$helloWorldPython' is missing). But I coudn't find the reason, why this variable contains the wrong value...

I think, this works for openoffice, but not for libreoffice, at least in my case. Calling the function in a basic macro (which can be called from terminal) works as expected.

To reproduce the bug, i add here some code: helloWorldScript and basicMacro (workaround)




Content of HelloWorld.py

import uno

def helloWorldPython( ):
    context = uno.getComponentContext()
    smgr = context.ServiceManager
    desktop = smgr.createInstanceWithContext("com.sun.star.frame.Desktop", context)
    document = desktop.loadComponentFromURL("private:factory/swriter", "_blank", 0, ())
    cursor = document.Text.createTextCursor()
    document.Text.insertString(cursor, "Hello world.", 0)

################################################################

Content of the basic macro which finally executed the python function succesfull from the terminal with the following command (soffice "macro:///Standard.Module3.CallPython"):

Sub CallPython
   oFactory = createUnoService("com.sun.star.script.provider.MasterScriptProviderFactory")
   oProvider = oFactory.createScriptProvider("")
   oScript = oProvider.getScript("vnd.sun.star.script:HelloWorld.py$helloWorldPython?language=Python&location=user")
   oScript.Invoke(Array(), Array(), Array())
end sub
Comment 1 Björn Michaelsen 2011-12-23 12:02:07 UTC
[This is an automated message.]
This bug was filed before the changes to Bugzilla on 2011-10-16. Thus it
started right out as NEW without ever being explicitly confirmed. The bug is
changed to state NEEDINFO for this reason. To move this bug from NEEDINFO back
to NEW please check if the bug still persists with the 3.5.0 beta1 or beta2 prereleases.
Details on how to test the 3.5.0 beta1 can be found at:
http://wiki.documentfoundation.org/QA/BugHunting_Session_3.5.0.-1

more detail on this bulk operation: http://nabble.documentfoundation.org/RFC-Operation-Spamzilla-tp3607474p3607474.html
Comment 2 sasha.libreoffice 2012-02-28 04:08:42 UTC
Please, verify: in version 3.5.0 problem still exist?
Comment 3 Florian Reisinger 2012-08-14 14:01:46 UTC
Dear bug submitter!

Due to the fact, that there are a lot of NEEDINFO bugs with no answer within the last six months, we close all of these bugs.

To keep this message short, more infos are available @ https://wiki.documentfoundation.org/QA/NeedinfoClosure#Statement

Thanks for understanding and hopefully updating your bug, so that everything is prepared for developers to fix your problem.

Yours!

Florian
Comment 4 Florian Reisinger 2012-08-14 14:02:49 UTC
Dear bug submitter!

Due to the fact, that there are a lot of NEEDINFO bugs with no answer within the last six months, we close all of these bugs.

To keep this message short, more infos are available @ https://wiki.documentfoundation.org/QA/NeedinfoClosure#Statement

Thanks for understanding and hopefully updating your bug, so that everything is prepared for developers to fix your problem.

Yours!

Florian
Comment 5 Florian Reisinger 2012-08-14 14:07:24 UTC
Dear bug submitter!

Due to the fact, that there are a lot of NEEDINFO bugs with no answer within the last six months, we close all of these bugs.

To keep this message short, more infos are available @ https://wiki.documentfoundation.org/QA/NeedinfoClosure#Statement

Thanks for understanding and hopefully updating your bug, so that everything is prepared for developers to fix your problem.

Yours!

Florian
Comment 6 Florian Reisinger 2012-08-14 14:09:30 UTC
Dear bug submitter!

Due to the fact, that there are a lot of NEEDINFO bugs with no answer within the last six months, we close all of these bugs.

To keep this message short, more infos are available @ https://wiki.documentfoundation.org/QA/NeedinfoClosure#Statement

Thanks for understanding and hopefully updating your bug, so that everything is prepared for developers to fix your problem.

Yours!

Florian