MCPcopy Create free account
hub / github.com/dedsec1121fk/DedSec / add_note_interactive

Function add_note_interactive

Scripts/Developer Base/Smart Notes.py:799–824  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

797
798# CLI fallback add
799def add_note_interactive():
800 notes = load_notes()
801 print('\n=== Add Note ===')
802 name = input('Note name: ').strip()
803 if not name:
804 print('Canceled: empty name')
805 return
806 if name in notes:
807 if input('Overwrite existing? (y/N): ').lower() not in ('y'):
808 print('Canceled')
809 return
810 print('Starting editor. Terminate with a line containing only .save')
811 try:
812 lines = []
813 while True:
814 ln = input()
815 if ln.strip() == '.save':
816 break
817 lines.append(ln)
818 new = '\n'.join(lines)
819 except KeyboardInterrupt:
820 print('\nCanceled')
821 return
822 notes[name] = new
823 save_notes(notes)
824 print('Saved.')
825
826# Help
827def print_help():

Callers 1

Smart Notes.pyFile · 0.70

Calls 4

printFunction · 0.85
inputFunction · 0.85
load_notesFunction · 0.70
save_notesFunction · 0.70

Tested by

no test coverage detected