Scipt "home made" take very long time to end. Scribus 1.6.1 Windows 10

Previous topic - Next topic

Ribus

Hello,

I use Scribus for many years now. I use to work on text with different languages in it, cyrillique and other. Sometime the russian words are all together in a single one 55 letters word. I want allso that iltalic words gose through the process.

To be safe with it I use a macro WORD to separate all words with ¤ in source WORD file Windows and replace a lot off characters like space in unsecable space and so on. Then I export Word.doc in html through LibreOffice.

Then import in a text frame in Scribus.
Then cleaning the frame with a script. With 1 or 2 pages it works, but with a 10 pages it is possible that script never stop.
Is it a problem between Scribus and Python version.

Thanks, for Help.
Richard

BN_Dev

Does it just stop abruptly on 10 pages, or do you notice an exponential slow-down the more pages you run the script on?  What happens on 3 pages?  Then 4?
Developer in the print industry with Quark+macOS expertise. Linux+KDE fan. Code in Qt/C/C++/Java/PHP/JS/more. FOSS advocate.

Ribus

No stop, you can wait 15 minutes or more with no end (nobody can wait so long, only for Windows start). :-\

Of course it depends of the number of pages ... but today it works well.
10.000 characters and spaces = 10 s; 40.000 = 50 s, 190.000 = 5 mn.
-------------------

I found a "solution", I made a copy of the script with the 2 first loops only :

   # Espace = u'\u0020',
   # ¤ = u'\u00A4'

replacements = (
   ('\u00A4','\u0020'),                     # ¤ en espace
   ('\u0020\u0020','\u0020'),            # deux espaces en un

It works in some seconds 5 to 25s.
Usually the original article in a frame is 30 000 characters and I have pushed a "space ¤ space" in place of space in html source (problem with russian words), then 40.000 characters.


Then I start the original script with allready the two first lines and the others. It works in some times.