heres how to view your source code online anytime anywhere

just enable Interactive Console in your GAE prod application....refer
my other post here

http://code.google.com/appengine/forum/?place=topic%2Fgoogle-appengine%2FpVxBq4jE0hQ%2Fdiscussion

then type above code into interactive console and run it interactively
to see the src online
cheers !


On Oct 26, 6:08 am, sodso <[email protected]> wrote:
> Heres a sample code to browse your source code online (not sure if it
> will traverse subdirectories, you can add that piece easily using os
> functionality
>
> import os,cgi
> from google.appengine.ext import webapp
> from google.appengine.ext.webapp.util import run_wsgi_app
>
> class code(webapp.RequestHandler):
>   def get(self):
>      self.response.headers['Content-Type'] = 'text/html;
> charset=utf-8'
>      self.response.out.write("<html><body><pre>")
>      for k, v in os.environ.items():
>           self.response.out.write(k + '>' + v + '<br />')
>      self.response.out.write("<br /><br /><br />")
>      self.response.out.write(os.getcwd())
>      self.response.out.write("<br /><br /><br />")
>      dirlist = os.listdir('./')
>      for d in dirlist:
>           if os.path.isdir(d) == False:
>                f1 = open(d, 'r')
>                self.response.out.write('<br />' + d + '<br />-------------<br 
> />')
>
>                for line in f1:
>                     self.response.out.write(cgi.escape(line))
>                f1.close()
>                self.response.out.write('<br />-------------<br />')
>      self.response.out.write("</pre></body></html>")
>
> def main():
>      run_wsgi_app(webapp.WSGIApplication([('/code', code),]))
>
> if __name__ == '__main__':
>     main()

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en.

Reply via email to