2011-05-15 13:19:32 -04:00
|
|
|
# Bryan Schumaker (5 / 15 / 2011)
|
|
|
|
|
|
|
|
import root
|
2011-05-15 13:49:02 -04:00
|
|
|
import rpc
|
2011-05-15 13:19:32 -04:00
|
|
|
|
|
|
|
docs = {}
|
|
|
|
docs.update(root.docs)
|
2011-05-15 13:49:02 -04:00
|
|
|
docs.update(rpc.docs)
|
2011-05-15 13:19:32 -04:00
|
|
|
|
|
|
|
types = {
|
2011-05-15 13:49:02 -04:00
|
|
|
"html":"text/html",
|
2011-05-15 13:19:32 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
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]
|