ocarina/libsaria/server/pages/__init__.py

27 lines
397 B
Python
Raw Normal View History

# Bryan Schumaker (5 / 15 / 2011)
import root
docs = {}
docs.update(root.docs)
types = {
"html":"text/html"
}
def lookup(file):
doc = docs
print doc, file, doc.get(file[0], None)
for cmp in file:
doc = doc.get(cmp, None)
if doc == None:
break
return doc
def has_file(file):
return lookup(file) != None
def page_text(file):
func, type = lookup(file)
return func(), types[type]