Skip to content

Instantly share code, notes, and snippets.

@sudhirj
Created June 25, 2011 17:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sudhirj/1046676 to your computer and use it in GitHub Desktop.
Save sudhirj/1046676 to your computer and use it in GitHub Desktop.
The REPL made by Tipfy for a GAE project and SDK.
#!/opt/local/Library/Frameworks/Python.framework/Versions/2.5/Resources/Python.app/Contents/MacOS/Python
import os
join = os.path.join
base = os.path.dirname(os.path.abspath(os.path.realpath(__file__)))
base = os.path.dirname(base)
import sys
sys.path[0:0] = [
join(base, 'app'),
join(base, 'app/lib'),
join(base, 'app/lib/dist'),
join(base, 'eggs/appfy.recipe.gae-0.9.3-py2.5.egg'),
join(base, 'var/parts/google_appengine'),
join(base, 'var/parts/google_appengine/lib/protorpc'),
]
_interactive = True
if len(sys.argv) > 1:
_options, _args = __import__("getopt").getopt(sys.argv[1:], 'ic:m:')
_interactive = False
for (_opt, _val) in _options:
if _opt == '-i':
_interactive = True
elif _opt == '-c':
exec _val
elif _opt == '-m':
sys.argv[1:] = _args
_args = []
__import__("runpy").run_module(
_val, {}, "__main__", alter_sys=True)
if _args:
sys.argv[:] = _args
__file__ = _args[0]
del _options, _args
execfile(__file__)
if _interactive:
del _interactive
__import__("code").interact(banner="", local=globals())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment