$ python some_path/remote_api_shell.py -s 1-5-3.example.appspot.com
How do I find out the version number of the app from within the shell?
(in this case: 1-5-3)
google-appe...@googlegroups.com
Seems to be more appropriate.
The key "CURRENT_VERSION_ID" is *not* available in the remote API shell:
s~example> import os
s~example> os.environ['CURRENT_VERSION_ID']
Traceback (most recent call last):
File "<console>", line 1, in <module>
File "C:\Programme\Python25\lib\os.py", line 433, in __getitem__
return self.data[key.upper()]
KeyError: 'CURRENT_VERSION_ID'
If I had the URL, then I would already be all set. It includes the
version!
Remember:
$ python some_path/remote_api_shell.py -s 1-5-3.example.appspot.com
The question is: How do I get the URL that was entered on the command
line when starting the remote shell?
Oops, sorry, I misunderstood your question :) .. Ernesto's answer may be the only one available to you then: explore sys.argv to check if a version was specified. But this won't work if you start with a custom domain instead of a version-based domain.Best Regards,-Ronoaldo--To view this discussion on the web visit https://groups.google.com/d/msg/google-appengine/-/6p7xB0dqOa4J.
You received this message because you are subscribed to the Google Groups "Google App Engine" group.
To post to this group, send email to google-a...@googlegroups.com.
To unsubscribe from this group, send email to google-appengi...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en.
Reports the app ID, not the version. For "1-5-3.example.appspot.com"
that's:
example
Thanks for the suggestion! Had that already in mind as a fall-back
solution. However, was hoping for something simpler and more reliable.
Finally, I found a solution:
parser = optparse.OptionParser()
parser.add_option('-s', '--server', dest='server')
(options, args) = parser.parse_args()
options.server.split('.')[0]