From d0f4fbb0c9ce91ab99b5212d1ebd748efa66d7dc 2007-05-24 19:16:04 From: vivainio Date: 2007-05-24 19:16:04 Subject: [PATCH] create app_completes, move non-core completers there, install stock completers as default, ipy_signals in sh profile --- diff --git a/IPython/Extensions/ipy_app_completers.py b/IPython/Extensions/ipy_app_completers.py new file mode 100644 index 0000000..831cfd6 --- /dev/null +++ b/IPython/Extensions/ipy_app_completers.py @@ -0,0 +1,21 @@ +""" Install various IPython completers + +IPython extension that installs the completers related to external apps. + +The actual implementations are in Extensions/ipy_completers.py + +""" +import IPython.ipapi + +ip = IPython.ipapi.get() + +from ipy_completers import * + +ip.set_hook('complete_command', apt_completers, re_key = '.*apt-get') +ip.set_hook('complete_command', apt_completers, re_key = '.*yum') + +ip.set_hook('complete_command', svn_completer, str_key = 'svn') + +ip.set_hook('complete_command', hg_completer, str_key = 'hg') + +ip.set_hook('complete_command', bzr_completer, str_key = 'bzr') diff --git a/IPython/Extensions/ipy_profile_sh.py b/IPython/Extensions/ipy_profile_sh.py index 7eb4f2b..ae25a7b 100644 --- a/IPython/Extensions/ipy_profile_sh.py +++ b/IPython/Extensions/ipy_profile_sh.py @@ -32,8 +32,9 @@ def main(): # beefed up %env is handy in shell mode import envpersist import ipy_which - import ipy_stock_completers + import ipy_app_completers import ipy_rehashdir + import ipy_signals ip.ex('import os') diff --git a/IPython/Extensions/ipy_stock_completers.py b/IPython/Extensions/ipy_stock_completers.py index 339f26a..2714e0b 100755 --- a/IPython/Extensions/ipy_stock_completers.py +++ b/IPython/Extensions/ipy_stock_completers.py @@ -1,7 +1,6 @@ """ Install various IPython completers -IPython extension that installs most of the implemented -custom completers. +IPython extension that installs completers related to core ipython behaviour. The actual implementations are in Extensions/ipy_completers.py @@ -12,19 +11,7 @@ ip = IPython.ipapi.get() from ipy_completers import * -ip.set_hook('complete_command', apt_completers, re_key = '.*apt-get') -ip.set_hook('complete_command', apt_completers, re_key = '.*yum') - - ip.set_hook('complete_command', module_completer, str_key = 'import') ip.set_hook('complete_command', module_completer, str_key = 'from') - -ip.set_hook('complete_command', svn_completer, str_key = 'svn') - -ip.set_hook('complete_command', hg_completer, str_key = 'hg') - -ip.set_hook('complete_command', bzr_completer, str_key = 'bzr') - ip.set_hook('complete_command', runlistpy, str_key = '%run') - ip.set_hook('complete_command', cd_completer, str_key = '%cd') diff --git a/IPython/Extensions/ipy_system_conf.py b/IPython/Extensions/ipy_system_conf.py index e57ebc3..f7cf338 100644 --- a/IPython/Extensions/ipy_system_conf.py +++ b/IPython/Extensions/ipy_system_conf.py @@ -18,6 +18,5 @@ import sys import ext_rescapture # var = !ls and var = %magic import pspersistence # %store magic import clearcmd # %clear -# Basic readline config -o = ip.options +import ipy_stock_completers diff --git a/doc/ChangeLog b/doc/ChangeLog index 51a201f..a914fb0 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -16,6 +16,13 @@ * %hist/%history now operates in "raw" mode by default. To get the old behaviour, run '%hist -n' (native mode). + + * split ipy_stock_completers.py to ipy_stock_completers.py and + ipy_app_completers.py. Stock completers (%cd, import, %run) are now + installed as default. + + * sh profile now installs ipy_signals.py, for (hopefully) better ctrl+c + handling. 2007-05-23 Ville Vainio