Пример #1
0
def getNoteListCached():
	"""keeps a copy of the note list html. only building it again when notes are renamed, added, or deleted."""
	global noteListDirty, noteList

	if noteListDirty:
		noteList = ""
	
		for name,id in db.noteNameList():
			noteList += """<li onclick="loadNote('""" + str(id) + """')">""" + name + """</li>"""
		noteListDirty = False
		return noteList
	else:
		return noteList
Пример #2
0
Serving on localhost:8080

> python SimpleNoteServer.py
Serving on localhost:8000 """

import SimpleHTTPServer
import SocketServer
import logging
import cgi

import sys
import random as rnd

import DatabaseAccess as db

print db.noteNameList()

print db.getNote("10")



if len(sys.argv) > 2:
	PORT = int(sys.argv[2])
	I = sys.argv[1]
elif len(sys.argv) > 1:
	PORT = int(sys.argv[1])
	I = ""
else:
	PORT = 8000
	I = ""