Example #1
0
 def format_note_line(self, timestamp, note_line):
     """Allows enabled plugins to modify note display"""
     note_line = Plugin.regex.sub(
         "<a href='filter:date:%s' " \
         "style='color:#A6E22E;text-decoration:none;' " \
         "title='%s'>today:</a>"
         % (timestamp_to_datestring(timestamp, False), timestamp_to_datestring(timestamp)),
         note_line)
     return note_line
Example #2
0
def migrate_notes(source, target):
    """Migrations notes from source connector to target connector"""
    notes = source.find_notes([])
    count = 1
    for timestamp, note in notes:
        print("%s/%s - [%s] %s" %
              (count, len(notes), timestamp_to_datestring(timestamp), note))
        target.save_note(timestamp, note)
        count += 1
Example #3
0
 def test_timestamp_to_datestring(self, timestamp, with_time, expectation):
     """Verifies string can be converted into a timstamp"""
     self.assertEqual(search.timestamp_to_datestring(timestamp, with_time),
                      expectation)