views:

55

answers:

1

In my own App Engine App, at the browser, I wanted to mess around with new code by simulating having access to the python interpretor's >> within a browser window by embdedding this app --> http://shell.appspot.com/ .

One can get shell_20091112.tar.gz at http://code.google.com/p/google-app-engine-samples/downloads/detail?name=shell_20091112.tar.gz&can=2&q=

So I moved the key files and folder from the shell app into my own app directory. When I launch my app from the SDK I can see in the browser the shell app at

http://dwms.appspot.com/shell

in my app but after I hit 'enter' after writing something say >>a=1... then nothing happens , so assume my handler link from the form to my app is wrong? (sorry if i am getting the jargon incorrect i am very new to this sort of web dev coding).

The form I am supposed to be receiving information from is within shell.html as looks like below:

<form id="form" action="shell.do" method="get">
  <nobr>
  <textarea class="prompt" id="caret" readonly="readonly" rows="4"
            onfocus="document.getElementById('statement').focus()"
            >&gt;&gt;&gt;</textarea>
  <textarea class="prompt" name="statement" id="statement" rows="4"
            onkeypress="return shell.onPromptKeyPress(event);"></textarea>
  </nobr>
  <input type="hidden" name="session" value="{{ session }}" />
  <input type="submit" style="display: none" />
</form>

so I am thinking the problem is that my app is no responding when the server gets 'shell.do' from the client because of changes I made or didnt make or made incorrectly....

on the old shell.py that I copied off the web into my app's directory I commented out all the lines from the main() function:

#def main():
  #application = webapp.WSGIApplication(
    #[('/shell', FrontPageHandler),
     #('/shell/shell.do', StatementHandler)], debug=_DEBUG)
  #wsgiref.handlers.CGIHandler().run(application)


if __name__ == '__main__':
  #main()

and replaced the linking or plumbing information by adding those similar links to my own main.py as follows:

application = webapp.WSGIApplication(
                                     [('/', MainPage),
          ('/shell',shell.FrontPageHandler),
                                      ('shell.do', shell.StatementHandler),
                                      ('/sign', Guestbook),
          ('/zxy/.*', PNGserver) ],
                                     debug=True)


def main():
    run_wsgi_app(application)



if __name__ == "__main__":
    main()

again -- so right now the issue is that I see a shell app when I go to

http://dwms.appspot.com/shell

and type

>> a=10

but nothing happens after I enter statements into the form after >>a=10

In case it is relevant...Below you will notice that I also commented out some lines I copied from the the old shell's app handlers app.yaml into the app.yaml of my app..NOTE: After experimenting by uncommenting the below lines it made no difference in how the shell doesnt work in my app...The reason for the comments below is that I thought this might be needed for the shell to know what's is going on with all global variables in the entire app not just where the shell is running? (I might be confused about this?)

My app.yaml is below:

application: dwms
version: 1
runtime: python
api_version: 1

handlers:
- url: /stylesheets
  static_dir: stylesheets

- url: /.*
  script: main.py

- url: /static
  static_dir: static
  expiration: 1d

- url: /remote_api
  script: $PYTHON_LIB/google/appengine/ext/remote_api/handler.py

# if you're adding the shell to your own app, change this regex url to the URL
# endpoint where you want the shell to run, e.g. /shell . You'll also probably
# want to add login: admin to restrict to admins only.
#
#- url: /shell
#  script: shell.py

Sorry for the long explanation...any help is greatly appreciated!

+1  A: 

The answer to my own question is to install the following shell console, very easy, and looks very helpful:

http://con.appspot.com/console/help/about

newguy