##// END OF EJS Templates
Merge pull request #2728 from Carreau/shifttab...
Merge pull request #2728 from Carreau/shifttab also bind shift tab for tooltip + config This does not change the curent behavior, only add the shift+tab shortcut. Note that the shift tab shortcut has a slightly different behavior. You can select part of a line and pressing shift-tab will show you the tooltip only for the selection. This is disabled for multiline selection to still allow to unindent block of code, Keep in mind that the real real shortcut for indent unindent is Ctrl+] or [ . Select/tab is not really supported by codemirror. Finally the "tooltip_on_tab" behavior is globally configurable via IPython.config so that it could be easily switched to false. It can be overridden via js console for test purpose. IPython.config.tooltip_on_tab = true | false Take effect immediately, only on current notebook. or globally via custom.js var user_conf = {tooltip_on_tab:false | true}; $.extend(IPython.config, user_conf)

File last commit:

r2267:928c921b
r8971:99339d10 merge
Show More
ipy_legacy.py
62 lines | 1.9 KiB | text/x-python | PythonLexer
vivainio
crlf cleanup
r680 """ Legacy stuff
Various stuff that are there for historical / familiarity reasons.
This is automatically imported by default profile, though not other profiles
(e.g. 'sh' profile).
Stuff that is considered obsolete / redundant is gradually moved here.
"""
Brian Granger
ipapi.py => core/ipapi.py and imports updated.
r2027 from IPython.core import ipapi
ip = ipapi.get()
vivainio
crlf cleanup
r680
import os,sys
Brian Granger
genutils.py => utils/genutils.py and updated imports and tests.
r2023 from IPython.utils.genutils import *
vivainio
crlf cleanup
r680
# use rehashx
def magic_rehash(self, parameter_s = ''):
"""Update the alias table with all entries in $PATH.
This version does no checks on execute permissions or whether the
contents of $PATH are truly files (instead of directories or something
else). For such a safer (but slower) version, use %rehashx."""
# This function (and rehashx) manipulate the alias_table directly
# rather than calling magic_alias, for speed reasons. A rehash on a
# typical Linux box involves several thousand entries, so efficiency
# here is a top concern.
path = filter(os.path.isdir,os.environ.get('PATH','').split(os.pathsep))
alias_table = self.shell.alias_table
for pdir in path:
for ff in os.listdir(pdir):
# each entry in the alias table must be (N,name), where
# N is the number of positional arguments of the alias.
alias_table[ff] = (0,ff)
# Make sure the alias table doesn't contain keywords or builtins
self.shell.alias_table_validate()
# Call again init_auto_alias() so we get 'rm -i' and other modified
# aliases since %rehash will probably clobber them
self.shell.init_auto_alias()
Brian Granger
Continuing a massive refactor of everything.
r2205 ip.define_magic("rehash", magic_rehash)
vivainio
crlf cleanup
r680
# Exit
def magic_Quit(self, parameter_s=''):
"""Exit IPython without confirmation (like %Exit)."""
Gael Varoquaux
Add demo app. Add callback for exit to the ipython0 code.
r1391 self.shell.ask_exit()
vivainio
crlf cleanup
r680
Brian Granger
Continuing a massive refactor of everything.
r2205 ip.define_magic("Quit", magic_Quit)
vivainio
crlf cleanup
r680
# make it autocallable fn if you really need it
def magic_p(self, parameter_s=''):
"""Just a short alias for Python's 'print'."""
exec 'print ' + parameter_s in self.shell.user_ns
Brian Granger
Continuing a massive refactor of everything.
r2205 ip.define_magic("p", magic_p)