the creation date of a node can be teased from the gnx
I use the following functions:
def gnx2tuple(gnx):
"""return a tuple (year, month, day, hour, minute, second)
"""
result = gnx.split(".")
# remove the user component
who = result.pop(0)
date = result.pop(0)
#not all gnx's have decimal
if len(result) > 0:
decimal = result.pop(0)
year = date[:4]
month = date[4:6]
day = date[6:8]
hour = date[8:10]
minute = date[10:12]
second = date[12:14]
return (int(year), int(month), int(day), int(hour),
int(minute), int(second))
ef gnx2date(gnx):
"""Extract and return the date component of a gnx
ktenney.20100830091314.2633
"""
(year, month, day, hour, minute, second) = gnx2tuple(gnx)
return "%s-%s-%s" % (year, month, day)
On Wed, Nov 9, 2011 at 11:13 AM, mdb <[email protected]> wrote:
> I see in Leo documentation that is possible to add attributes to nodes
> and .leo files.
> I am thinking of adding date created & date modified attributes to
> nodes for a particular project.
>
> Has anyone done this already ? (before I re-invent the wheel)
> And I wonder if node dates have ever been considered as a base leo
> attribute.
>
> Not looking for full versioning features, but knowing when a node was
> created and then last modified can help in recalling a project's
> workflow and status.
>
> --
> 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.
>
>
--
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.