On Tue, Sep 25, 2018 at 8:19 AM Israel Hands <[email protected]> wrote:
> I have a list of items in a node and I write this code to read a line at a
> time and display the line in the log window. I would like the display to
> pause for a couple of seconds before going on to the next line -
>
> @language python
> import time
> p.moveToNext()
> for lines in g.splitlines(p.b):
> g.es(lines)
> time.sleep(2)
>
>
> However when I run this on my Mac 10.12.3 with python 2.7 and Leo 5.8b2 -
> the routine seems to add up all the pauses and then splurge out the output
> at one go?
>
Sounds like a platform-specific issue. You script works on Windows.
All output eventually goes to LeoQtLog.put, which ends this way:
w.repaint() # Slow, but essential.
I suspect the Mac version of repaint is being "clever", which is neither
helpful nor correct. You might try this script, but please use rev e9a020b
in devel. It properly inits the logWidget ivar, something that was always
promised, but never done until now:
@language python
import time
w = c.frame.log.logWidget
for lines in g.splitlines(p.b):
g.es(lines.rstrip())
time.sleep(1)
w.update()
Edward
--
You received this message because you are subscribed to the Google Groups
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.