I wrote a script to add a datestamp to the top node of a file. It modifies
the headline and the headline icon changes to show it has changed.
However when I close the leo file there is no prompt to save the file and
the update is lost.
I'm obviously missing some important detail and look forward to a helpful
explanation of why the file is not recognised as changed.
Here is the script:
*@language pythonfrom datetime import datetimenow =
datetime.now()TIME_STAMP = (f"{now.day}/{now.month}/{now.year}
{now.hour}:{now.minute}:{now.second}")def datestamp_node(): # POSITION
c.selectPosition(c.rootPosition()) # select root node position and move
to it # MOVES TO FIRST NODE p = c.p # NODE headline p.h
= "datestamp Leo" + " " + TIME_STAMP # timestamp "datestamp Leo" node
c.setHeadString(p, p.h) # write the new headline. g.es_print(f" ====
new headline is: ", p.h) c.redraw(p) datestamp_node()*
--
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 view this discussion on the web visit
https://groups.google.com/d/msgid/leo-editor/a32d0ac8-838e-49b0-a401-7a9633ece2ebn%40googlegroups.com.