diff --git a/IPython/__init__.py b/IPython/__init__.py index 2d6b9eb..20632fd 100644 --- a/IPython/__init__.py +++ b/IPython/__init__.py @@ -43,9 +43,9 @@ if sys.version[0:3] < '2.4': raise ImportError('Python Version 2.4 or above is required for IPython.') # Make it easy to import extensions - they are always directly on pythonpath. -# Therefore, non-IPython modules can be added to Extensions directory +# Therefore, non-IPython modules can be added to extensions directory import os -sys.path.append(os.path.dirname(__file__) + "/Extensions") +sys.path.append(os.path.join(os.path.dirname(__file__), "extensions")) # Define what gets imported with a 'from IPython import *' __all__ = ['IPython.core.ipapi','utils.generics','utils.ipstruct', diff --git a/IPython/config/userconfig/ipy_user_conf.py b/IPython/config/userconfig/ipy_user_conf.py index b21cd4c..b562e2e 100644 --- a/IPython/config/userconfig/ipy_user_conf.py +++ b/IPython/config/userconfig/ipy_user_conf.py @@ -4,7 +4,7 @@ This is a more flexible and safe way to configure ipython than *rc files (ipythonrc, ipythonrc-pysh etc.) This file is always imported on ipython startup. You can import the -ipython extensions you need here (see IPython/Extensions directory). +ipython extensions you need here (see IPython/extensions directory). Feel free to edit this file to customize your ipython experience. diff --git a/IPython/config/userconfig/ipythonrc-physics b/IPython/config/userconfig/ipythonrc-physics index c7c25a3..12d59bd 100644 --- a/IPython/config/userconfig/ipythonrc-physics +++ b/IPython/config/userconfig/ipythonrc-physics @@ -21,12 +21,12 @@ include ipythonrc # import ... # Module with alternate input syntax for PhysicalQuantity objects. -import_mod IPython.Extensions.PhysicalQInput +import_mod IPython.extensions.PhysicalQInput # from ... import * # math CANNOT be imported after PhysicalQInteractive. It will override the # functions defined there. -import_all math IPython.Extensions.PhysicalQInteractive +import_all math IPython.extensions.PhysicalQInteractive # from ... import ... import_some diff --git a/IPython/config/userconfig/ipythonrc-pysh b/IPython/config/userconfig/ipythonrc-pysh index 2c7d204..7bff119 100644 --- a/IPython/config/userconfig/ipythonrc-pysh +++ b/IPython/config/userconfig/ipythonrc-pysh @@ -25,7 +25,7 @@ include ipythonrc ############################################################################ # Load all the actual syntax extensions for shell-like operation, which live # in the InterpreterExec standard extension. -import_all IPython.Extensions.InterpreterExec +import_all IPython.extensions.InterpreterExec ############################################################################ # PROMPTS @@ -87,7 +87,7 @@ multi_line_specials 1 #fperez[IPython]16> ldir #/usr/local/home/fperez/ipython/ipython/IPython #drwxr-xr-x 2 fperez 4096 Jun 21 01:01 CVS/ -#drwxr-xr-x 3 fperez 4096 Jun 21 01:10 Extensions/ +#drwxr-xr-x 3 fperez 4096 Jun 21 01:10 extensions/ #drwxr-xr-x 3 fperez 4096 Jun 21 01:27 UserConfig/ #fperez[IPython]17> parts Hello world and goodbye diff --git a/IPython/config/userconfig/ipythonrc-tutorial b/IPython/config/userconfig/ipythonrc-tutorial index 6c97569..49c31b0 100644 --- a/IPython/config/userconfig/ipythonrc-tutorial +++ b/IPython/config/userconfig/ipythonrc-tutorial @@ -22,7 +22,7 @@ include ipythonrc # import ... # Module with alternate input syntax for pasting python input -import_mod IPython.Extensions.InterpreterPasteInput +import_mod IPython.extensions.InterpreterPasteInput # from ... import * import_all diff --git a/IPython/core/iplib.py b/IPython/core/iplib.py index 4870306..fa635c8 100644 --- a/IPython/core/iplib.py +++ b/IPython/core/iplib.py @@ -48,7 +48,7 @@ import tempfile from IPython.core import ultratb from IPython.utils import PyColorize from IPython.core import debugger, oinspect -from IPython.Extensions import pickleshare +from IPython.extensions import pickleshare from IPython.core.fakemodule import FakeModule, init_fakemod_dict from IPython.external.Itpl import ItplNS from IPython.core.logger import Logger diff --git a/IPython/core/magic.py b/IPython/core/magic.py index 13baf64..aa9fff3 100644 --- a/IPython/core/magic.py +++ b/IPython/core/magic.py @@ -3387,7 +3387,7 @@ Defaulting color scheme to 'NoColor'""" """ # XXX - Fix this to have cleaner activate/deactivate calls. - from IPython.Extensions import InterpreterPasteInput as ipaste + from IPython.extensions import InterpreterPasteInput as ipaste from IPython.utils.ipstruct import Struct # Shorthands diff --git a/IPython/core/tests/test_magic.py b/IPython/core/tests/test_magic.py index ac3b901..8b98936 100644 --- a/IPython/core/tests/test_magic.py +++ b/IPython/core/tests/test_magic.py @@ -73,7 +73,7 @@ def test_shist(): # Simple tests of ShadowHist class - test generator. import os, shutil, tempfile - from IPython.Extensions import pickleshare + from IPython.extensions import pickleshare from IPython.core.history import ShadowHist tfile = tempfile.mktemp('','tmp-ipython-') diff --git a/IPython/extensions/__init__.py b/IPython/extensions/__init__.py index abc363b..22e892d 100644 --- a/IPython/extensions/__init__.py +++ b/IPython/extensions/__init__.py @@ -6,7 +6,7 @@ PhysicalQ_Input for an example of how to do this). Any file located here can be called with an 'execfile =' option as - execfile = Extensions/filename.py + execfile = extensions/filename.py since the IPython directory itself is already part of the search path for files listed as 'execfile ='. diff --git a/IPython/extensions/ipipe.py b/IPython/extensions/ipipe.py index 22d8f61..2117c76 100644 --- a/IPython/extensions/ipipe.py +++ b/IPython/extensions/ipipe.py @@ -1217,11 +1217,11 @@ class ils(Table): Examples:: >>> ils - + >>> ils("/usr/local/lib/python2.4") - IPython.Extensions.ipipe.ils('/usr/local/lib/python2.4') + IPython.extensions.ipipe.ils('/usr/local/lib/python2.4') >>> ils("~") - IPython.Extensions.ipipe.ils('/home/fperez') + IPython.extensions.ipipe.ils('/home/fperez') # all-random """ def __init__(self, base=os.curdir, dirs=True, files=True): @@ -1259,7 +1259,7 @@ class iglob(Table): Examples:: >>> iglob("*.py") - IPython.Extensions.ipipe.iglob('*.py') + IPython.extensions.ipipe.iglob('*.py') """ def __init__(self, glob): self.glob = glob @@ -1285,11 +1285,11 @@ class iwalk(Table): List all files and directories in a directory and it's subdirectory:: >>> iwalk - + >>> iwalk("/usr/lib") - IPython.Extensions.ipipe.iwalk('/usr/lib') + IPython.extensions.ipipe.iwalk('/usr/lib') >>> iwalk("~") - IPython.Extensions.ipipe.iwalk('/home/fperez') # random + IPython.extensions.ipipe.iwalk('/home/fperez') # random """ def __init__(self, base=os.curdir, dirs=True, files=True): @@ -1394,7 +1394,7 @@ class ipwd(Table): Example:: >>> ipwd | isort("uid") - + # random """ def __iter__(self): @@ -1580,7 +1580,7 @@ class ienv(Table): Example:: >>> ienv - + """ def __iter__(self): @@ -1602,9 +1602,9 @@ class ihist(Table): Example:: >>> ihist - + >>> ihist(True) # raw mode - # random + # random """ def __init__(self, raw=True): self.raw = raw @@ -1639,7 +1639,7 @@ class ialias(Table): Example:: >>> ialias - + """ def __iter__(self): api = ipapi.get() @@ -1702,10 +1702,10 @@ class ix(Table): Examples:: >>> ix("ps x") - IPython.Extensions.ipipe.ix('ps x') + IPython.extensions.ipipe.ix('ps x') >>> ix("find .") | ifile - at 0x8509d2c> + at 0x8509d2c> # random """ def __init__(self, cmd): @@ -1928,9 +1928,9 @@ class isort(Pipe): Examples:: >>> ils | isort("size") - + >>> ils | isort("_.isdir(), _.lower()", reverse=True) - + # all-random """ diff --git a/IPython/extensions/ipy_app_completers.py b/IPython/extensions/ipy_app_completers.py index 5cca537..3a89b54 100644 --- a/IPython/extensions/ipy_app_completers.py +++ b/IPython/extensions/ipy_app_completers.py @@ -2,7 +2,7 @@ IPython extension that installs the completers related to external apps. -The actual implementations are in Extensions/ipy_completers.py +The actual implementations are in extensions/ipy_completers.py """ from IPython.core import ipapi diff --git a/IPython/extensions/ipy_completers.py b/IPython/extensions/ipy_completers.py index 58244d9..4403727 100644 --- a/IPython/extensions/ipy_completers.py +++ b/IPython/extensions/ipy_completers.py @@ -1,7 +1,7 @@ """ Implementations for various useful completers -See Extensions/ipy_stock_completers.py on examples of how to enable a completer, +See extensions/ipy_stock_completers.py on examples of how to enable a completer, but the basic idea is to do: ip.set_hook('complete_command', svn_completer, str_key = 'svn') diff --git a/IPython/extensions/ipy_constants.py b/IPython/extensions/ipy_constants.py index 59883cd..9e8ea5d 100644 --- a/IPython/extensions/ipy_constants.py +++ b/IPython/extensions/ipy_constants.py @@ -15,7 +15,7 @@ Website: physics.nist.gov/constants # inspired by maxima's physconst.mac by Cliff Yapp #from math import * # math MUST be imported BEFORE PhysicalQInteractive -from IPython.Extensions.PhysicalQInteractive import PhysicalQuantityInteractive +from IPython.extensions.PhysicalQInteractive import PhysicalQuantityInteractive # Math constants: diff --git a/IPython/extensions/ipy_pretty.py b/IPython/extensions/ipy_pretty.py index eebe48d..d2463e3 100644 --- a/IPython/extensions/ipy_pretty.py +++ b/IPython/extensions/ipy_pretty.py @@ -4,7 +4,7 @@ Register pretty-printers for types using ipy_pretty.for_type() or ipy_pretty.for_type_by_name(). For example, to use the example pretty-printer for numpy dtype objects, add the following to your ipy_user_conf.py:: - from IPython.Extensions import ipy_pretty + from IPython.extensions import ipy_pretty ipy_pretty.activate() @@ -82,7 +82,7 @@ def dtype_pprinter(obj, p, cycle): def test_pretty(): """ - In [1]: from IPython.Extensions import ipy_pretty + In [1]: from IPython.extensions import ipy_pretty In [2]: ipy_pretty.activate() diff --git a/IPython/extensions/ipy_profile_doctest.py b/IPython/extensions/ipy_profile_doctest.py index 6adb5ab..787131b 100644 --- a/IPython/extensions/ipy_profile_doctest.py +++ b/IPython/extensions/ipy_profile_doctest.py @@ -16,7 +16,7 @@ import ipy_legacy from IPython.core import ipapi -from IPython.Extensions import InterpreterPasteInput +from IPython.extensions import InterpreterPasteInput def main(): ip = ipapi.get() diff --git a/IPython/extensions/ipy_stock_completers.py b/IPython/extensions/ipy_stock_completers.py index 2ff32f5..98ce4f3 100644 --- a/IPython/extensions/ipy_stock_completers.py +++ b/IPython/extensions/ipy_stock_completers.py @@ -2,7 +2,7 @@ IPython extension that installs completers related to core ipython behaviour. -The actual implementations are in Extensions/ipy_completers.py +The actual implementations are in extensions/ipy_completers.py """ from IPython.core import ipapi diff --git a/IPython/testing/iptest.py b/IPython/testing/iptest.py index 954e638..d793ca2 100644 --- a/IPython/testing/iptest.py +++ b/IPython/testing/iptest.py @@ -64,11 +64,11 @@ EXCLUDE = [pjoin('IPython', 'external'), pjoin('IPython', 'frontend', 'process', 'winprocess.py'), pjoin('IPython_doctest_plugin'), pjoin('IPython', 'Gnuplot'), - pjoin('IPython', 'Extensions', 'ipy_'), - pjoin('IPython', 'Extensions', 'clearcmd'), - pjoin('IPython', 'Extensions', 'PhysicalQInteractive'), - pjoin('IPython', 'Extensions', 'scitedirector'), - pjoin('IPython', 'Extensions', 'numeric_formats'), + pjoin('IPython', 'extensions', 'ipy_'), + pjoin('IPython', 'extensions', 'clearcmd'), + pjoin('IPython', 'extensions', 'PhysicalQInteractive'), + pjoin('IPython', 'extensions', 'scitedirector'), + pjoin('IPython', 'extensions', 'numeric_formats'), pjoin('IPython', 'testing', 'attic'), pjoin('IPython', 'testing', 'tutils'), pjoin('IPython', 'testing', 'tools'), @@ -76,7 +76,7 @@ EXCLUDE = [pjoin('IPython', 'external'), ] if not have_wx: - EXCLUDE.append(pjoin('IPython', 'Extensions', 'igrid')) + EXCLUDE.append(pjoin('IPython', 'extensions', 'igrid')) EXCLUDE.append(pjoin('IPython', 'gui')) EXCLUDE.append(pjoin('IPython', 'frontend', 'wx')) @@ -84,7 +84,7 @@ if not have_objc: EXCLUDE.append(pjoin('IPython', 'frontend', 'cocoa')) if not have_curses: - EXCLUDE.append(pjoin('IPython', 'Extensions', 'ibrowse')) + EXCLUDE.append(pjoin('IPython', 'extensions', 'ibrowse')) if not sys.platform == 'win32': EXCLUDE.append(pjoin('IPython', 'platutils_win32')) @@ -223,7 +223,7 @@ def make_runners(): top_mod.append('platutils_dummy.py') # These are tested by nose, so skip IPython.kernel - top_pack = ['config','Extensions','frontend', + top_pack = ['config','extensions','frontend', 'testing','tests','tools','userconfig'] if have_wx: diff --git a/MANIFEST.in b/MANIFEST.in index 90e8d95..749ecd9 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -18,7 +18,7 @@ graft IPython/scripts graft IPython/testing graft IPython/utils -recursive-include IPython/Extensions igrid_help* +recursive-include IPython/extensions igrid_help* graft docs exclude docs/\#* diff --git a/docs/autogen_api.py b/docs/autogen_api.py index c7c54de..f369e09 100755 --- a/docs/autogen_api.py +++ b/docs/autogen_api.py @@ -17,7 +17,7 @@ if __name__ == '__main__': docwriter = ApiDocWriter(package,rst_extension='.txt') docwriter.package_skip_patterns += [r'\.fixes$', r'\.externals$', - r'\.Extensions', + r'\.extensions', r'\.kernel.config', r'\.attic', ] diff --git a/docs/source/development/reorg.txt b/docs/source/development/reorg.txt index b302158..8b7f16f 100644 --- a/docs/source/development/reorg.txt +++ b/docs/source/development/reorg.txt @@ -25,7 +25,7 @@ IPython currently has the following sub-packages: * :mod:`IPython.config` -* :mod:`IPython.Extensions` +* :mod:`IPython.extensions` * :mod:`IPython.external` @@ -97,7 +97,7 @@ added for iplib, ipapi and Shell. The follow things still need to be done:: * When running python setup.py sdist, the Sphinx API docs fail to build because of something going on with IPython.core.fakemodule -* :file:`Extensions`. This needs to be gone through separately. Minimally, +* :file:`extensions`. This needs to be gone through separately. Minimally, the package should be renamed to :file:`extensions` and the PYTHONPATH setting in __init__.py needs to be updated. diff --git a/docs/source/interactive/extension_api.txt b/docs/source/interactive/extension_api.txt index ecef5e3..779829b 100644 --- a/docs/source/interactive/extension_api.txt +++ b/docs/source/interactive/extension_api.txt @@ -15,7 +15,7 @@ and get richer functionality - for example, you can import an extension and call functions in it to configure it for your purposes. For an example extension (the 'sh' profile), see -IPython/Extensions/ipy_profile_sh.py. +IPython/extensions/ipy_profile_sh.py. For the last word on what's available, see the source code of IPython/ipapi.py. @@ -202,7 +202,7 @@ Provided extensions You can see the list of available extensions (and profiles) by doing ``import ipy_``. Some extensions don't have the ``ipy_`` prefix in -module name, so you may need to see the contents of IPython/Extensions +module name, so you may need to see the contents of IPython/extensions folder to see what's available. You can see a brief documentation of an extension by looking at the diff --git a/docs/source/interactive/reference.txt b/docs/source/interactive/reference.txt index 023a5ec..2478756 100644 --- a/docs/source/interactive/reference.txt +++ b/docs/source/interactive/reference.txt @@ -1351,7 +1351,7 @@ In a nutshell, you can redefine the way IPython processes the user input line to accept new, special extensions to the syntax without needing to change any of IPython's own code. -In the IPython/Extensions directory you will find some examples +In the IPython/extensions directory you will find some examples supplied, which we will briefly describe now. These can be used 'as is' (and both provide very useful functionality), or you can use them as a starting point for writing your own extensions. @@ -1369,14 +1369,14 @@ copying, carefully removing the leading extraneous characters. This extension identifies those starting characters and removes them from the input automatically, so that one can paste multi-line examples directly into IPython, saving a lot of time. Please look at the file -InterpreterPasteInput.py in the IPython/Extensions directory for details +InterpreterPasteInput.py in the IPython/extensions directory for details on how this is done. IPython comes with a special profile enabling this feature, called tutorial. Simply start IPython via 'ipython -p tutorial' and the feature will be available. In a normal IPython session you can activate the feature by importing the corresponding module with: -In [1]: import IPython.Extensions.InterpreterPasteInput +In [1]: import IPython.extensions.InterpreterPasteInput The following is a 'screenshot' of how things work when this extension is on, copying an example from the standard tutorial:: @@ -1431,8 +1431,8 @@ The physics profile supplied with IPython (enabled via 'ipython -p physics') uses these extensions, which you can also activate with: from math import * # math MUST be imported BEFORE PhysicalQInteractive -from IPython.Extensions.PhysicalQInteractive import * -import IPython.Extensions.PhysicalQInput +from IPython.extensions.PhysicalQInteractive import * +import IPython.extensions.PhysicalQInput Threading support diff --git a/docs/source/interactive/shell.txt b/docs/source/interactive/shell.txt index 91465ac..e3df967 100644 --- a/docs/source/interactive/shell.txt +++ b/docs/source/interactive/shell.txt @@ -251,12 +251,12 @@ First, capture output of "hg status":: [Q:/ipython]|28> out = !hg status == - ['M IPython\\Extensions\\ipy_kitcfg.py', - 'M IPython\\Extensions\\ipy_rehashdir.py', + ['M IPython\\extensions\\ipy_kitcfg.py', + 'M IPython\\extensions\\ipy_rehashdir.py', ... '? build\\lib\\IPython\\Debugger.py', - '? build\\lib\\IPython\\Extensions\\InterpreterExec.py', - '? build\\lib\\IPython\\Extensions\\InterpreterPasteInput.py', + '? build\\lib\\IPython\\extensions\\InterpreterExec.py', + '? build\\lib\\IPython\\extensions\\InterpreterPasteInput.py', ... (lines starting with ? are not under version control). diff --git a/setupbase.py b/setupbase.py index 0d3d394..972cafc 100644 --- a/setupbase.py +++ b/setupbase.py @@ -107,7 +107,7 @@ def find_packages(): add_package(packages, 'config.userconfig') add_package(packages, 'core', tests=True) add_package(packages, 'deathrow', tests=True) - add_package(packages , 'Extensions') + add_package(packages , 'extensions') add_package(packages, 'external') add_package(packages, 'frontend', tests=True) # Don't include the cocoa frontend for now as it is not stable @@ -200,7 +200,7 @@ def find_data_files(): # Simple file lists can be made by hand manpages = filter(isfile, glob(pjoin('docs','man','*.1.gz'))) - igridhelpfiles = filter(isfile, glob(pjoin('IPython','Extensions','igrid_help.*'))) + igridhelpfiles = filter(isfile, glob(pjoin('IPython','extensions','igrid_help.*'))) # For nested structures, use the utility above example_files = make_dir_struct( diff --git a/setupexe.py b/setupexe.py index ef38539..1b2d7c6 100644 --- a/setupexe.py +++ b/setupexe.py @@ -64,7 +64,7 @@ egg_extra_kwds = {} setup(name = name, options = { 'py2exe': { - 'packages' : ['IPython', 'IPython.Extensions', 'IPython.external', + 'packages' : ['IPython', 'IPython.extensions', 'IPython.external', 'pyreadline'], 'excludes' : ["Tkconstants","Tkinter","tcl",'IPython.igrid','wx', 'wxPython','igrid', 'PyQt4', 'zope', 'Zope', 'Zope2',