The moment Module

An Moment is the foundation for a journal. It does not require a timestamp, but most moments use one.

In its most simple (text based) form, a moment consists of:

* tags
data
\n

With a timestamp:

*timestamp tags
data
\n
class moments.moment.Moment(data=u'', tags=[], created='', path=u'', now=False)[source]

Object to hold a unique Moment

#*2011.07.03 09:16:58 #by not having a separate moment and entry (no-timestamp) #we lose the ability to automatically assign a default timestamp #within the moment object itself #shouldn’t be that big of a deal, since in practice we’re often #creating moments withing the context of a journal # #if not, just pass in the timestamp on init

also adding a parameter ‘now’ to set the timestamp automatically on init default is false

as_dict()[source]

return self as a dictionary suitable for JSON use

is_equal(other, debug=False)[source]

take another entry/moment see if our contents are equal

render(include_path=False)[source]

return a textual representation of the entry

include_path assumed to be false in some places

render_data()[source]

return a textual representation of the entry data only

render_first_line(comment=False)[source]

render the date and the tags for the entry

This Page