예제 #1
0
                            clearScreen()
                            iter = 1
                            notesTitles = notes.getNotesTitle()
                            for i in notesTitles:
                                print(iter, i)
                                iter += 1
                            noteNumber = int(input('Input note number'))
                            clearScreen()
                            print(
                                notes.getNoteTextByTitle(
                                    notesTitles[noteNumber - 1]))
                            input()
                            clearScreen()
                        if notesMenuChoice == 2:  # addNote
                            clearScreen()
                            noteTitle = input('Input note Title: ')
                            noteText = input('Input note text: ')
                            try:
                                notes.addNote(noteTitle, noteText)
                                print('Added!')
                                input()
                                clearScreen()
                            except Exception as e:
                                print('Error')
                                print('Try again later')
                                input()
                                clearScreen()
                # Mail Client
        if menuChoice == 3:
            pass
예제 #2
0
#!/usr/bin/env python

""" Test harness for notes """

from notes import Notes
import base62

foo = Notes()

foo.createDatabase()
print "Inserting with ID", foo.addNote("This is a test", title="First Post")
print "Inserting with ID", foo.addNote("XXX This is a another test XXX", author="Nick")

for row in foo.getAllNotes():
    print row
    print base62.fromInt(row[0])

print foo.getAllNoteIDs()

print "Check Hits"    
print foo.getNoteByID(u"aaaaaaaaaab")
print foo.getNoteByID(u"aaaaaaaaaab")
foo.deleteNoteByID("aaaaaaaaaab")
foo.deleteNoteByKey(2)
print foo.getNoteByID(u"aaaaaaaaaab")


print "\nPurging notes"
foo.purgeOldKeys()

print "\nListing notes"