[Solved] Opening template extremely slow (few min.)

Creating a macro - Writing a Script - Using the API

[Solved] Opening template extremely slow (few min.)

Postby Bastien » Tue May 28, 2019 4:52 pm

Hello,
I'm a bit confused, all my clients are complaining about a macro that doesn't work anymore. I've tested and they're right. Any idea why these lines doesn't work anymore ?

Code: Select all   Expand viewCollapse view
def transcription2calc(*args):
    path = 'file:///home/bastien/Bureau/toto.ott'
    args = (PropertyValue('Hidden', 0, False, 0),)
    desktop = XSCRIPTCONTEXT.getDesktop()
    desktop.loadComponentFromURL(path, "_default", 0, args)


I precise that I can no more open a template file .ott.

Clients that haven't upgraded their ubuntu session haven't this bug. I have this bug on Ubuntu 19.04 and LO 6.2.3

EDIT: I just realize that 10 mins later it has open the template (wich BTW contains only the string 'toto')
Last edited by Hagar Delest on Wed May 29, 2019 9:33 pm, edited 4 times in total.
Reason: tagged solved
LibreOffice 6.2.3.2 on Ubuntu 19.04
Bastien
 
Posts: 48
Joined: Mon May 12, 2014 2:45 pm

Re: loadComponentFromURL or opening template extremely slow

Postby RoryOF » Tue May 28, 2019 6:26 pm

My notes indicate that /Tools /Options /Macros /Organise Macros /OpenOffice Basic /OpenOffice Macros : ImportWizard is a set of macros that converst from older OO formats to the more modern ones.

I cannot offer any help with this, other than to indicate that this set of macros exists; I do not know how effective they are.
Apache OpenOffice 4.1.7 on Xubuntu 18.04.3 (mostly 64 bit version) and very infrequently on Win2K/XP
User avatar
RoryOF
Moderator
 
Posts: 29871
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: loadComponentFromURL or opening template extremely slow

Postby Bastien » Tue May 28, 2019 6:47 pm

Hopefully I found a solution, quite radical.
Code: Select all   Expand viewCollapse view
apt --purge libreoffice*
apt --clean
apt --autoclean
apt --autoremove


and a complete reinstall did the trick!
Last edited by Bastien on Tue May 28, 2019 7:09 pm, edited 1 time in total.
LibreOffice 6.2.3.2 on Ubuntu 19.04
Bastien
 
Posts: 48
Joined: Mon May 12, 2014 2:45 pm

Re: [Solved Opening template extremely slow (few min.)

Postby RoryOF » Tue May 28, 2019 7:05 pm

Check the version of Python it is using.
Apache OpenOffice 4.1.7 on Xubuntu 18.04.3 (mostly 64 bit version) and very infrequently on Win2K/XP
User avatar
RoryOF
Moderator
 
Posts: 29871
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: Opening template extremely slow (few min.)

Postby Bastien » Tue May 28, 2019 7:11 pm

Error, it is slow again after one first normal opening. Now it keeps beeing slow (more than 5 minutes) to open a very small file.

How do you check the python it uses?
LibreOffice 6.2.3.2 on Ubuntu 19.04
Bastien
 
Posts: 48
Joined: Mon May 12, 2014 2:45 pm

Re: Opening template extremely slow (few min.)

Postby RoryOF » Tue May 28, 2019 7:19 pm

This macro, which I found with a quick search, claims to show the OO Python version; tyhere may be (probably are) other methods

Code: Select all   Expand viewCollapse view
# Print Python Version used for the LibreOffice pyUNO scripting framework

def PrintPythonVersion( ):
    """Print the version of python"""

    import sys

#get the doc from the scripting context which is made available to all scripts
    model = XSCRIPTCONTEXT.getDocument()
#get the XText interface
    text = model.Text
#create an XTextRange at the end of the document
    tRange = text.End
#and set the string   
    tRange.String = "python version:\n " + sys.version
    return None

Apache OpenOffice 4.1.7 on Xubuntu 18.04.3 (mostly 64 bit version) and very infrequently on Win2K/XP
User avatar
RoryOF
Moderator
 
Posts: 29871
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: Opening template extremely slow (few min.)

Postby Bastien » Tue May 28, 2019 7:35 pm

I got the :

python version:
3.7.3 (default, Apr 3 2019, 05:39:12)
[GCC 8.3.0]

which works fine on an other machine.

The DEBUG output hangs on :

Tue May 28 19:39:05 2019 [DEBUG] PythonScript.invoke (0,)
Tue May 28 19:41:58 2019 [DEBUG] PythonScript.invoke ret = None

What does it mean?
LibreOffice 6.2.3.2 on Ubuntu 19.04
Bastien
 
Posts: 48
Joined: Mon May 12, 2014 2:45 pm

Re: Opening template extremely slow (few min.)

Postby Bastien » Tue May 28, 2019 8:31 pm

Anyway, this problem is not related to the python script above. Libreoffice hangs on opening a simple template, whatever template it is. I really have no clue to debug this.
LibreOffice 6.2.3.2 on Ubuntu 19.04
Bastien
 
Posts: 48
Joined: Mon May 12, 2014 2:45 pm

Re: Opening template extremely slow (few min.)

Postby Bastien » Wed May 29, 2019 6:16 pm

Just reinstall every thing and it works but I didn't find the reason of this failure.
LibreOffice 6.2.3.2 on Ubuntu 19.04
Bastien
 
Posts: 48
Joined: Mon May 12, 2014 2:45 pm


Return to Macros and UNO API

Who is online

Users browsing this forum: No registered users and 4 guests