Re: [orca-list] time...



Hi Daniel:

If you're doing this from Orca, you cannot do it in an infinite loop. If you do so, you will freeze the system as you have discovered.

An appropriate way to do this kind of thing would be to do one update at a time via a timeout (look for gobject.timeout_add calls in the Orca sources for an example).

Hope this helps,

Will

Daniel Dalton wrote:
I have put together a loop that makes the seconds and the minutes and the hour update on my braille display when it changes.
Eg. I can see the seconds changing.
However my loop freezes the system. (I know why, but what can I test for so when another key is pressed my if will be executed?)
In the time function:
while True:
     message = time.strftime("%H:%M:%S", time.localtime())
     orca.braille.displayMessage(message)
     if <The condition I am asking about>:
         break

OK, I don't have a braille display from where I am sending this email from, so sorry about indenting issues.
I have obviously imported the required modules as well.
So what condition can I check for to break out of the loop?
Apart from that it actually works.

Thanks,





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]