/opt/imh-python/lib/python3.9/site-packages/IPython/core
NameSizeModeActions
magics/-0755rm
profile/-0755rm
tests/-0755rm
__pycache__/-0755rm
alias.py100340644editdlrm
application.py189370644editdlrm
async_helpers.py42970644editdlrm
autocall.py19910644editdlrm
builtin_trap.py30090644editdlrm
compilerop.py77300644editdlrm
completer.py1178500644editdlrm
completerlib.py123650644editdlrm
crashhandler.py85080644editdlrm
debugger.py388720644editdlrm
display.py425030644editdlrm
displayhook.py129620644editdlrm
displaypub.py49440644editdlrm
display_functions.py129180644editdlrm
display_trap.py20980644editdlrm
error.py17340644editdlrm
events.py52510644editdlrm
excolors.py49280644editdlrm
extensions.py57800644editdlrm
formatters.py349810644editdlrm
getipython.py9120644editdlrm
guarded_eval.py250370644editdlrm
history.py344750644editdlrm
historyapp.py59090644editdlrm
hooks.py56630644editdlrm
inputsplitter.py290410644editdlrm
inputtransformer.py181840644editdlrm
inputtransformer2.py293930644editdlrm
interactiveshell.py1537610644editdlrm
latex_symbols.py312880644editdlrm
logger.py84410644editdlrm
macro.py17340644editdlrm
magic.py288990644editdlrm
magic_arguments.py97340644editdlrm
oinspect.py398980644editdlrm
page.py117530644editdlrm
payload.py17580644editdlrm
payloadpage.py14310644editdlrm
prefilter.py255880644editdlrm
profileapp.py106310644editdlrm
profiledir.py80290644editdlrm
prompts.py6070644editdlrm
pylabtools.py140180644editdlrm
release.py21780644editdlrm
shellapp.py178450644editdlrm
splitinput.py48360644editdlrm
ultratb.py558030644editdlrm
usage.py135420644editdlrm
__init__.py00644editdlrm
Edit: /opt/imh-python/lib/python3.9/site-packages/IPython/core/autocall.py (1991B)
# encoding: utf-8 """ Autocall capabilities for IPython.core. Authors: * Brian Granger * Fernando Perez * Thomas Kluyver Notes ----- """ #----------------------------------------------------------------------------- # Copyright (C) 2008-2011 The IPython Development Team # # Distributed under the terms of the BSD License. The full license is in # the file COPYING, distributed as part of this software. #----------------------------------------------------------------------------- #----------------------------------------------------------------------------- # Imports #----------------------------------------------------------------------------- #----------------------------------------------------------------------------- # Code #----------------------------------------------------------------------------- class IPyAutocall(object): """ Instances of this class are always autocalled This happens regardless of 'autocall' variable state. Use this to develop macro-like mechanisms. """ _ip = None rewrite = True def __init__(self, ip=None): self._ip = ip def set_ip(self, ip): """Will be used to set _ip point to current ipython instance b/f call Override this method if you don't want this to happen. """ self._ip = ip class ExitAutocall(IPyAutocall): """An autocallable object which will be added to the user namespace so that exit, exit(), quit or quit() are all valid ways to close the shell.""" rewrite = False def __call__(self): self._ip.ask_exit() class ZMQExitAutocall(ExitAutocall): """Exit IPython. Autocallable, so it needn't be explicitly called. Parameters ---------- keep_kernel : bool If True, leave the kernel alive. Otherwise, tell the kernel to exit too (default). """ def __call__(self, keep_kernel=False): self._ip.keepkernel_on_exit = keep_kernel self._ip.ask_exit()