def GET(self, dir): dir = dir.rstrip('/').lstrip('/') (out, ret) = git.type(dir) if ret == 128: web.webapi.notfound() elif out == 'blob': print self.file_feed(dir) elif out == 'tree': print self.dir_feed(dir) else: web.webapi.notfound()
def GET(self, file): file = file.rstrip('/') (out, ret) = git.type(file) if ret == 128: web.webapi.notfound() elif out == 'blob': (fout, fret) = git.show(file) (templ, dict) = get_dict(fout) templ = tenv.get_template(templ) print templ.render(dict) elif out == 'tree': print dirify(file, git.ls(file)[0]) else: web.webapi.notfound()