def change_memory(current_note, row): memories = hf.check_row(current_note, row) if memories == None: return row = int(row) memory_to_remove = memories[row - 1].strip('\n') del memories[row - 1] note.write_to_note(current_note, memories) return memory_to_remove
def archive_memory(filename, row): archive_note = path.expanduser('~/.quicknote/.notes/.archive') memories = hf.check_row(filename, row) if memories == None: return row = int(row) memory_to_archive = memories[row - 1] del memories[row - 1] with open(filename, 'w') as f: for memory in memories: f.write(memory) with open(archive_note, 'a') as f: f.write(memory_to_archive) print('Archived memory \'' + memory_to_archive.strip('\n') + '\'')
def copy_memory(current_note, row, args): note = hf.parse_unary_args(args) note_path = path.expanduser('~/.quicknote/.notes/.' + note) if not path.isfile(note_path): print( 'The note you are trying to add to does not exist. Please try again.' ) return memories = hf.check_row(current_note, row) if memories == None: return row = int(row) memory_to_copy = memories[row - 1].strip('\n') append_memory(memory_to_copy, note_path) print('Copied \'' + memory_to_copy + '\' to \'' + note + '\'')