functions useful for extracting moments from a group of log files based on the tags we want to extract
take two lists return the differences
NOTE THAT ORDER MATTERS! if 1 is a superset of 2, there will be a difference but if 2 is a superset of 1, there won’t be a difference
i.e. larger set first! larger = set1, smaller = set2
take another journal, return a new journal with the entries that are only in the other journal not in ourself
NOTE: we may have entries in journal that are not in other... those will not be returned. this can be called in the opposite direction if those are wanted
remove any entries tagged with a/all tag in tag_list
saving journal (with missing entries) left to caller (if desired)
rather than go through all files for every extraction it is nice to go through all extractions during each file
save extractions for each file rather than accumulating until end
will make it trickier for trial runs can print actions or make temp logs
accept a list of extractions where each extraction consists of a set of tags to look for (using extract_type) and a destination where matching entries should be extracted to
ignores is a list of tags to leave out of the found entries (good for filtering tags generated from the original file path)
this duplicates the logic for scanning all files from extract_tag it feels more readable to separate the two
*2009.08.29 13:20:46 now part of the moments module itself
not to be confused with the Journal.extract method these functions are higher level operations that utilize Journal.extract
also: # take a list of tags, # and the directory or file that you want to use as the source of the tags # go through all files, and remove those tags # saving them in a new separate file (or specified existing file)
# adapted from pose.controllers.tags.extract
apply filters to the journal’s entries in place #normalize/filter all of the data first... #as the system changes, so do the paths
adapted from medialist.from_journal
could consider adding this as a method to entry or data
IF SEARCH IS NOT TRUE, IGNORES MUST BE AN EXACT MATCH
take a list of items take a list of itmes to ignore return a new list of items based on first, original, with ignores removed
walk the path, looking for moment logs for each log scan entries for each entry apply filter
aka find_and_replace
apply all updates in updates list to all items in items list
updates consist of a list of lists where the sub lists contain: (search_string, replace_string)
create a flat version of the journal without timestamps (or tags?)
only keep the first line of each journal entry useful for playlists
look for all entries in the journal that have all tags in tag_list
take another journal, return a new journal with only the entries that are in common to both
*2011.08.30 09:09:19 imported from filter_logs that might not be the main functionality of this module
take a list of tags leave out any that are a timestamp
make sure no item appears twice in list i.e. filter for any duplicates
Maps a unicode character code (the key) to a replacement code (either a character code or a unicode string).
look for all entries in the journal that have any tags in tag_list