import os import sys import glob sys.path.append(os.path.join(os.path.split(__file__)[0],'..')) from gluon.html import CODE def main(path): models = glob.glob(os.path.join(path,'models','*.py')) controllers = glob.glob(os.path.join(path,'controllers','*.py')) views = glob.glob(os.path.join(path,'views','*.html')) modules = glob.glob(os.path.join(path,'modules','*.py')) models.sort() controllers.sort() views.sort() modules.sort() print '' print '

Models

' for filename in models: print '

%s

' % filename[len(path):] print CODE(open(filename).read(),language='web2py').xml() print '

Layout Views

' for filename in views: print '

%s

' % filename[len(path):] print CODE(open(filename).read(),language='html').xml() print '

Controllers and Views

' for filename in controllers: print '

%s

' % filename[len(path):] print CODE(open(filename).read(),language='web2py') views = glob.glob(os.path.join(path,'views','*','*.html')) views.sort() for filename in views: print '

%s

' % filename[len(path):] print CODE(open(filename).read(),language='html').xml() print '

Modules

' for filename in modules: print '

%s

' % filename[len(path):] print CODE(open(filename).read(),language='python').xml() print '' if __name__=='__main__': main(sys.argv[1])