Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
exec_init(manage_dict, _vars)
exec_init_script(manage_dict, _vars)
atexit_functions = [
import_module(func_name)
for func_name in manage_dict["shell"].get("exit_hooks", [])
]
atexit_functions += exit_hooks or []
for atexit_function in atexit_functions:
atexit.register(atexit_function)
if console == "ptpython":
try:
from ptpython.repl import embed
embed({}, _vars)
except ImportError:
click.echo("ptpython is not installed!")
return
if console == "bpython":
try:
from bpython import embed
embed(locals_=_vars, banner=banner_msg)
except ImportError:
click.echo("bpython is not installed!")
return
try:
if console == "ipython":
from IPython import start_ipython
from flask.globals import _app_ctx_stack
from ptpython.repl import embed
app = _app_ctx_stack.top.app
ctx = {}
# Support the regular Python interpreter startup script if someone
# is using it.
startup = os.environ.get('PYTHONSTARTUP')
if startup and os.path.isfile(startup):
with open(startup, 'r') as f:
eval(compile(f.read(), startup, 'exec'), ctx)
ctx.update(app.make_shell_context())
embed(globals=ctx)
def ptpython(cls, local_vars):
from ptpython.repl import embed
embed({}, local_vars)
"""
try:
game = PGZeroGame(mod)
if repl:
import asyncio
from ptpython.repl import embed
loop = asyncio.get_event_loop()
# Make sure the game runs
# NB. if the game exits, the REPL will keep running, which allows
# inspecting final state
game_task = loop.create_task(game.run_as_coroutine())
# Wait for the REPL to exit
loop.run_until_complete(embed(
globals=vars(mod),
return_asyncio_coroutine=True,
patch_stdout=True,
title="Pygame Zero REPL",
configure=configure_repl,
))
# Ask game loop to shut down (if it has not) and wait for it
if game.running:
pygame.event.post(pygame.event.Event(pygame.QUIT))
loop.run_until_complete(game_task)
else:
game.run()
finally:
storage.Storage.save_all()
def main():
embed(globals(), locals(), vi_mode=False)
def ptpython(self, local_vars):
from ptpython.repl import embed
embed({}, local_vars)
def run():
from .app import app
parser = argparse.ArgumentParser(description='Nekoyume shell')
args = parser.parse_args()
app.app_context().push()
embed(globals(), locals())
def main():
embed(globals(), locals(), configure=configure)