The log Module

class moments.log.Log(filename=None)[source]

Log is an in memory buffer (StringIO) that holds a text format for a list of entries / moments.

The goal for this format is to be easy to create and update in a text editor

For each entry:

will create a Moment (with or without timestamp)
from_entries(entries, omits=[], include_path=False)[source]

take a collection of entries and put together a log buffer

omit tags allow us to omit a certain tag on export/extract if omit tag is given, do not print the tag for any of the entries.

from_file(filename=None)[source]

if the file exists, read in its contents

otherwise set our filename and stay empty

to_entries(add_tags=[], add_time=False, moments_only=False)[source]

convert log to a list of entry objects (essentially what a log is)

if moments_only is true, only Moments will be created

if add_time is false, and moments_only is true, upon reaching an Entry only (... ) (no timestamp) that information will be added to the previous Moment (this is useful when parsing data that was not originally intended to be used as part of a moment... it may contain lines that start with ‘‘)

to_file(filename=None)[source]

save our content to the file

This Page