ocarina/libsaria/server/pages/__init__.py

28 lines
390 B
Python
Raw Normal View History

# Bryan Schumaker (5 / 15 / 2011)
import root
import rpc
docs = {}
docs.update(root.docs)
docs.update(rpc.docs)
types = {
"html":"text/html",
}
def lookup(file):
doc = docs
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]