Bug 57779 - LibreLogo 0.2 starts with scripting framework error
Summary: LibreLogo 0.2 starts with scripting framework error
Status: RESOLVED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Extensions (show other bugs)
Version:
(earliest affected)
4.0.0.0.alpha1
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-12-01 17:03 UTC by Thomas Hackert
Modified: 2014-10-14 18:19 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
error screenshot (23.85 KB, image/png)
2012-12-07 21:50 UTC, Julien Nabet
Details
Screenshot of LibreLogo extension installation error message (49.22 KB, image/png)
2013-04-15 22:17 UTC, Ken DiPietro
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Hackert 2012-12-01 17:03:32 UTC
Hello @ll,
after installing LibreLogo 0.2 (to translate the strings for the Germanophone project) in  my parallel installed LibreOffice Version 4.0.0.0.alpha1+ under Debian Testing AMD64 I got the following message, when I click on "Start (the program in the writer document)":

<quote>
Ein Scripting Framework Fehler trat während der Ausführung vom Python-Skript vnd.sun.star.script:librelogo-0.2.oxt|LibreLogo|LibreLogo.py$gobackward?language=Python&location=user:uno_packages auf.

Meldung: <type 'exceptions.AttributeError'>: get_path
  ~/LO/opt/lodev4.0/user/uno_packages/cache/uno_packages/lu2oqs8q.tmp_/librelogo-0.2.oxt/LibreLogo/LibreLogo.py:8 in function <module>() [__lngpath__ = re.sub("[\w_.]*$", "", ctx.ServiceManager.createInstanceWithContext("org.openoffice.LibreLogo.LibreLogoDummy", ctx).get_path())]
  ~/LO/opt/lodev4.0/share/extensions/script-provider-for-python/pythonscript.py:416 in function getModuleByUrl() [exec code in entry.module.__dict__]
  ~/LO/opt/lodev4.0/share/extensions/script-provider-for-python/pythonscript.py:917 in function getScript() [mod = self.provCtx.getModuleByUrl( fileUri )]
</quote>

I have shortened the full path name to my home directory to "~" to retain some privacy ... ;) Additionally I tested it with my installed LO Version 3.6.3.2 (Build ID: 58f22d5), where the same error occured ... :(
Sorry for the inconvenience
Thomas.
Comment 1 Julien Nabet 2012-12-07 21:50:54 UTC
Created attachment 71162 [details]
error screenshot

On pc Debian x86-64 with master sources updated today (commit a99bf813c0079c26f2a2c940c3db8d8597e3047f), I reproduced this.

I attached the screenshot.
Here are the console logs too:
Python exception: <class 'AttributeError'>: 'dict' object has no attribute 'has_key', traceback follows
  /home/julien/compile-libreoffice/libo/solver/unxlngx6/installation/opt/program/pythonscript.py:331 in function addPackageByUrl() [if self.mapPackageName2Path.has_key( packageName ):]
  /home/julien/compile-libreoffice/libo/solver/unxlngx6/installation/opt/program/pythonscript.py:996 in function insertByName() [self.provCtx.addPackageByUrl( uri )]


warn:desktop.deployment:2557:18:/home/julien/compile-libreoffice/libo/desktop/source/deployment/registry/dp_backend.cxx:676: unexpected RuntimeException "Failed to register package for vnd.sun.star.expand:$UNO_SHARED_PACKAGES_CACHE/uno_packages/luftqxw2.tmp_/librelogo-0.2.oxt/LibreLogo"
warn:desktop.deployment:2557:18:/home/julien/compile-libreoffice/libo/desktop/source/deployment/registry/dp_backend.cxx:676: unexpected RuntimeException "Failed to register package for vnd.sun.star.expand:$UNO_SHARED_PACKAGES_CACHE/uno_packages/luftqxw2.tmp_/librelogo-0.2.oxt/LibreLogo"
Comment 2 Julien Nabet 2012-12-07 21:51:07 UTC
so confirmed.
Comment 3 László Németh 2012-12-08 20:02:14 UTC
Hi Thomas, 

Unfortunately, this extension hasn't supported Python 3.3 of LibreOffice 4.0, so the solution is to install the extension in a LibO 3.x or use the inner LibreLogo of LibreOffice 4.0 alpha. (Check View->Toolbars->Logo in Writer). 
The language of the Logo commands is the language of the actual document or – without the relevant translation – English. The German translation of the Logo commands is in the libreoffice_installation_path/share/Scripts/python/LibreLogo/Librelogo_de.properties file. It seems, some of the commands has already been translated in the beta 1, eg. the black color constant, so you can draw a black filled circle with 10cm diameter in a German document with the following commands:

fillcolor “schwarz” circle 10cm

After a complete translation, maybe this command line will be

füllfarbe „schwarz“ ring 10cm

(or kreis, I don't know which is the better translation for circle here).

I have found a Logo user guide with full German localization, see page 92:

http://www.alancsmith.co.uk/logo/LogoUserGuide151.pdf

You can keep the English commands, too, if you want, in the German translation, eg:

FORWARD=vorwärts|vw|forward|fd

I will write to the l10n list on Monday, please, send your questions. Thanks, László
Comment 4 Thomas Hackert 2012-12-09 08:39:20 UTC
Hello László, *,
(In reply to comment #3)
> Unfortunately, this extension hasn't supported Python 3.3 of LibreOffice
> 4.0, so the solution is to install the extension in a LibO 3.x or use the
> inner LibreLogo of LibreOffice 4.0 alpha. (Check View->Toolbars->Logo in
> Writer). 

well, as I have written below the error report, I have tested it with my installed 3.6.3 as well, but got the same error message ... :(

> The language of the Logo commands is the language of the actual document or
> – without the relevant translation – English. The German translation of the
> Logo commands is in the
> libreoffice_installation_path/share/Scripts/python/LibreLogo/Librelogo_de.
> properties file. It seems, some of the commands has already been translated
> in the beta 1, eg. the black color constant, so you can draw a black filled
> circle with 10cm diameter in a German document with the following commands:

Were there no strings in the Pootle instance of LO? I seem to remember, that someone reported at the Germanophone ML that we should not translate them ... ;)

> fillcolor “schwarz” circle 10cm
> 
> After a complete translation, maybe this command line will be
> 
> füllfarbe „schwarz“ ring 10cm
> 
> (or kreis, I don't know which is the better translation for circle here).

Indeed, "Kreis" is more used here ... ;)

> I have found a Logo user guide with full German localization, see page 92:
> 
> http://www.alancsmith.co.uk/logo/LogoUserGuide151.pdf

Aha, thank you for the link :)

> You can keep the English commands, too, if you want, in the German
> translation, eg:
> 
> FORWARD=vorwärts|vw|forward|fd
> 
> I will write to the l10n list on Monday, please, send your questions.

Well, i am not subscribed to it, but maybe I will find the time the next days to look in its archive ... ;)
Thank you for your elaborated answer and have a nice day
Thomas.
Comment 5 László Németh 2012-12-10 14:49:17 UTC
Hello Thomas,

Using LibreLogo 0.2 beta can solve this registration problem in LO 3.6.3 (this is a little bit older version without the problematic “dummy” component): 

http://www.numbertext.org/logo/librelogo-0.2b/librelogo-0.2.oxt

You are right, Logo translation had an optional status. Now it seems, LibreLogo will be a new feature in LibreOffice, but the translation is not an urgent task. Without translation the English commands will work in non-English documents, too, also this special translation task may need more time to choose the best alternative(s). I haven't written to the list, yet, but I will post it to you, too. Thanks, and best regards, László
Comment 7 László Németh 2012-12-10 16:53:34 UTC
(In reply to comment #6)
Julien, that is an important patch, because Python 3.3 is no longer supported has_key(). I will check with it the registration problem of the bundled English python module, too. Thanks, László
Comment 8 Thomas Hackert 2012-12-10 18:32:18 UTC
Hello László, *,

(In reply to comment #5)
> Using LibreLogo 0.2 beta can solve this registration problem in LO 3.6.3

indeed, it did :) Thanks for the tip :)

> (this is a little bit older version without the problematic “dummy”
> component): 
> 
> http://www.numbertext.org/logo/librelogo-0.2b/librelogo-0.2.oxt
> 
> You are right, Logo translation had an optional status. Now it seems,
> LibreLogo will be a new feature in LibreOffice, but the translation is not
> an urgent task.

O.K.

> Without translation the English commands will work in
> non-English documents, too, also this special translation task may need more
> time to choose the best alternative(s). I haven't written to the list, yet,
> but I will post it to you, too. Thanks, and best regards, László

O.K.
Thanks for your answer and to Julien to submit the patch (I just have to wait 'til it will be integrated in one of the next versions of LO to test it, sorry ... :( ).
Have a nice evening
Thomas.
Comment 9 Alex Thurgood 2013-04-08 18:16:11 UTC
Hi all,

I am seeing the following error when I click on 
"Commandes en majuscules, les traduire également dans la langue du document"

which in English, is something like

"Commands in capitals, also translate them into the language of the document"



com.sun.star.uno.RuntimeExceptionError during invoking function __translate__ in module file:///Applications/LibreOffice.app/Contents/share/Scripts/python/LibreLogo/LibreLogo.py (<class 'TypeError'>: 'NoneType' object is not subscriptable
  /Applications/LibreOffice.app/Contents/share/Scripts/python/LibreLogo/LibreLogo.py:337 in function __translate__() [lq = '\'' + lang['LEFTSTRING'].replace("|", "")]
  /Applications/LibreOffice.app/Contents/program/pythonscript.py:830 in function invoke() [ret = self.func( *args )]
)


Is this related to the previous messages here (localisation problem ?)


Alex
Comment 10 Julien Nabet 2013-04-08 21:24:32 UTC
On pc Debian x86-64 with master sources updated today, it worked with English UI.

As Alex noticed, it fails at least with French UI. I opened the bug 63282 (see https://bugs.freedesktop.org/show_bug.cgi?id=63282) for this.

Does anybody has 4.0.2 (in any env) with English by default UI to test this?
Comment 11 László Németh 2013-04-12 00:25:59 UTC
I cannot reproduce this problem in LibreOffice 4.0.2 with English UI. French Logo programs in French documents work well. I will check with a LibreOffice with French UI, too, and report the result. Thanks for the bug reports!
Comment 12 Ken DiPietro 2013-04-15 22:17:05 UTC
Created attachment 78044 [details]
Screenshot of LibreLogo extension installation error message

I can confirm that this bug exists with Linux Mint 14 AMD64 and Libre Office Version 4.0.2.2 (Build ID: 400m0(Build:2)). This is a clean installation with all updates completed.
Comment 13 Julien Nabet 2014-10-14 18:19:14 UTC
On pc Debian x86-64 with LO Debian package 4.3.2.2, I don't reproduce this anymore with French and German UI.

I put it as WFM.

Thackert: don't hesitate to reopen this tracker if you reproduce this with last stable LO version (4.3.2)

Ken Di Pietro: what you described is a different problem. If you reproduce this with last stable LO version, please submit a new bug by using this link:
https://www.libreoffice.org/get-help/bug/