Howdy,

In my pursuit of Leo as a file system, I'm delighted by
the simplicity and elegance of this snippet:

# run this via <ctl-b>
def stat_handler(tag, keywords):
    import time
    t = str(time.time())
    p = c.currentPosition()
    p.v.u['str_atime'] = t
    if p.isDirty():
        p.v.u['str_mtime'] = t

g.registerHandler(('unselect1'), stat_handler)

bingo! accessed and modified timestamps on nodes.

-------------------

the following doesn't disable the hook:
g.unregisterHandler(('unselect1'), stat_handler)

What am I missing?

Thanks,
Kent

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/leo-editor?hl=en.

Reply via email to