On Tue, Jul 1, 2014 at 9:02 AM, Edward K. Ream <[email protected]> wrote:
I have completed everything related to idle-time processing.
The are now 6 new commands:
enable-idle-time-tracing
disable-idle-time-tracing
toggle-idle-time-tracing
enable-idle-time-events
disable-idle-time-events
toggle-idle-time-events
More importantly, idle-time handling is now simpler and more general.
Here is a recent checkin log:
QQQQQ
Simplified and generalized idle-time handling as follows:
- Removed g.app.afterHandler: g.app.idleTimeHook does the same thing now.
- The timer callback now calls g.app.idleTimeHook() if it exists.
- g.enableIdleTimeHook now has the following signature::
def enableIdleTimeHook(idleTimeDelay=500,idleTimeHandler=None):
if no idleTimeHandler is given, g.idleTimeHookHandler is used.
Here is an script illustrating the possibilities. Do the
enable-idle-time-tracing command before executing this script::
'''A script illustrating interacting idle-time handlers.'''
class Handlers:
def h1(self):
g.trace()
g.enableIdleTimeHook(1000,self.h2)
def h2(self):
g.trace()
g.enableIdleTimeHook(500,self.h1)
h = Handlers()
QQQQQ
I think this will provide more than enough flexibility for any purpose.
Edward
------------------------------------------------------------------------------------------
Edward K. Ream: [email protected] Leo: http://leoeditor.com/
Speak the truth, but not to punish--Thich Nhat Hanh
------------------------------------------------------------------------------------------
--
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 http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.