##// END OF EJS Templates
Renaming Extensions=>extensions in code and imports.
Brian Granger -
Show More
@@ -43,9 +43,9 b" if sys.version[0:3] < '2.4':"
43 43 raise ImportError('Python Version 2.4 or above is required for IPython.')
44 44
45 45 # Make it easy to import extensions - they are always directly on pythonpath.
46 # Therefore, non-IPython modules can be added to Extensions directory
46 # Therefore, non-IPython modules can be added to extensions directory
47 47 import os
48 sys.path.append(os.path.dirname(__file__) + "/Extensions")
48 sys.path.append(os.path.join(os.path.dirname(__file__), "extensions"))
49 49
50 50 # Define what gets imported with a 'from IPython import *'
51 51 __all__ = ['IPython.core.ipapi','utils.generics','utils.ipstruct',
@@ -4,7 +4,7 b' This is a more flexible and safe way to configure ipython than *rc files'
4 4 (ipythonrc, ipythonrc-pysh etc.)
5 5
6 6 This file is always imported on ipython startup. You can import the
7 ipython extensions you need here (see IPython/Extensions directory).
7 ipython extensions you need here (see IPython/extensions directory).
8 8
9 9 Feel free to edit this file to customize your ipython experience.
10 10
@@ -21,12 +21,12 b' include ipythonrc'
21 21
22 22 # import ...
23 23 # Module with alternate input syntax for PhysicalQuantity objects.
24 import_mod IPython.Extensions.PhysicalQInput
24 import_mod IPython.extensions.PhysicalQInput
25 25
26 26 # from ... import *
27 27 # math CANNOT be imported after PhysicalQInteractive. It will override the
28 28 # functions defined there.
29 import_all math IPython.Extensions.PhysicalQInteractive
29 import_all math IPython.extensions.PhysicalQInteractive
30 30
31 31 # from ... import ...
32 32 import_some
@@ -25,7 +25,7 b' include ipythonrc'
25 25 ############################################################################
26 26 # Load all the actual syntax extensions for shell-like operation, which live
27 27 # in the InterpreterExec standard extension.
28 import_all IPython.Extensions.InterpreterExec
28 import_all IPython.extensions.InterpreterExec
29 29
30 30 ############################################################################
31 31 # PROMPTS
@@ -87,7 +87,7 b' multi_line_specials 1'
87 87 #fperez[IPython]16> ldir
88 88 #/usr/local/home/fperez/ipython/ipython/IPython
89 89 #drwxr-xr-x 2 fperez 4096 Jun 21 01:01 CVS/
90 #drwxr-xr-x 3 fperez 4096 Jun 21 01:10 Extensions/
90 #drwxr-xr-x 3 fperez 4096 Jun 21 01:10 extensions/
91 91 #drwxr-xr-x 3 fperez 4096 Jun 21 01:27 UserConfig/
92 92
93 93 #fperez[IPython]17> parts Hello world and goodbye
@@ -22,7 +22,7 b' include ipythonrc'
22 22
23 23 # import ...
24 24 # Module with alternate input syntax for pasting python input
25 import_mod IPython.Extensions.InterpreterPasteInput
25 import_mod IPython.extensions.InterpreterPasteInput
26 26
27 27 # from ... import *
28 28 import_all
@@ -48,7 +48,7 b' import tempfile'
48 48 from IPython.core import ultratb
49 49 from IPython.utils import PyColorize
50 50 from IPython.core import debugger, oinspect
51 from IPython.Extensions import pickleshare
51 from IPython.extensions import pickleshare
52 52 from IPython.core.fakemodule import FakeModule, init_fakemod_dict
53 53 from IPython.external.Itpl import ItplNS
54 54 from IPython.core.logger import Logger
@@ -3387,7 +3387,7 b' Defaulting color scheme to \'NoColor\'"""'
3387 3387 """
3388 3388
3389 3389 # XXX - Fix this to have cleaner activate/deactivate calls.
3390 from IPython.Extensions import InterpreterPasteInput as ipaste
3390 from IPython.extensions import InterpreterPasteInput as ipaste
3391 3391 from IPython.utils.ipstruct import Struct
3392 3392
3393 3393 # Shorthands
@@ -73,7 +73,7 b' def test_shist():'
73 73 # Simple tests of ShadowHist class - test generator.
74 74 import os, shutil, tempfile
75 75
76 from IPython.Extensions import pickleshare
76 from IPython.extensions import pickleshare
77 77 from IPython.core.history import ShadowHist
78 78
79 79 tfile = tempfile.mktemp('','tmp-ipython-')
@@ -6,7 +6,7 b' PhysicalQ_Input for an example of how to do this).'
6 6
7 7 Any file located here can be called with an 'execfile =' option as
8 8
9 execfile = Extensions/filename.py
9 execfile = extensions/filename.py
10 10
11 11 since the IPython directory itself is already part of the search path for
12 12 files listed as 'execfile ='.
@@ -1217,11 +1217,11 b' class ils(Table):'
1217 1217 Examples::
1218 1218
1219 1219 >>> ils
1220 <class 'IPython.Extensions.ipipe.ils'>
1220 <class 'IPython.extensions.ipipe.ils'>
1221 1221 >>> ils("/usr/local/lib/python2.4")
1222 IPython.Extensions.ipipe.ils('/usr/local/lib/python2.4')
1222 IPython.extensions.ipipe.ils('/usr/local/lib/python2.4')
1223 1223 >>> ils("~")
1224 IPython.Extensions.ipipe.ils('/home/fperez')
1224 IPython.extensions.ipipe.ils('/home/fperez')
1225 1225 # all-random
1226 1226 """
1227 1227 def __init__(self, base=os.curdir, dirs=True, files=True):
@@ -1259,7 +1259,7 b' class iglob(Table):'
1259 1259 Examples::
1260 1260
1261 1261 >>> iglob("*.py")
1262 IPython.Extensions.ipipe.iglob('*.py')
1262 IPython.extensions.ipipe.iglob('*.py')
1263 1263 """
1264 1264 def __init__(self, glob):
1265 1265 self.glob = glob
@@ -1285,11 +1285,11 b' class iwalk(Table):'
1285 1285 List all files and directories in a directory and it's subdirectory::
1286 1286
1287 1287 >>> iwalk
1288 <class 'IPython.Extensions.ipipe.iwalk'>
1288 <class 'IPython.extensions.ipipe.iwalk'>
1289 1289 >>> iwalk("/usr/lib")
1290 IPython.Extensions.ipipe.iwalk('/usr/lib')
1290 IPython.extensions.ipipe.iwalk('/usr/lib')
1291 1291 >>> iwalk("~")
1292 IPython.Extensions.ipipe.iwalk('/home/fperez') # random
1292 IPython.extensions.ipipe.iwalk('/home/fperez') # random
1293 1293
1294 1294 """
1295 1295 def __init__(self, base=os.curdir, dirs=True, files=True):
@@ -1394,7 +1394,7 b' class ipwd(Table):'
1394 1394 Example::
1395 1395
1396 1396 >>> ipwd | isort("uid")
1397 <IPython.Extensions.ipipe.isort key='uid' reverse=False at 0x849efec>
1397 <IPython.extensions.ipipe.isort key='uid' reverse=False at 0x849efec>
1398 1398 # random
1399 1399 """
1400 1400 def __iter__(self):
@@ -1580,7 +1580,7 b' class ienv(Table):'
1580 1580 Example::
1581 1581
1582 1582 >>> ienv
1583 <class 'IPython.Extensions.ipipe.ienv'>
1583 <class 'IPython.extensions.ipipe.ienv'>
1584 1584 """
1585 1585
1586 1586 def __iter__(self):
@@ -1602,9 +1602,9 b' class ihist(Table):'
1602 1602 Example::
1603 1603
1604 1604 >>> ihist
1605 <class 'IPython.Extensions.ipipe.ihist'>
1605 <class 'IPython.extensions.ipipe.ihist'>
1606 1606 >>> ihist(True) # raw mode
1607 <IPython.Extensions.ipipe.ihist object at 0x849602c> # random
1607 <IPython.extensions.ipipe.ihist object at 0x849602c> # random
1608 1608 """
1609 1609 def __init__(self, raw=True):
1610 1610 self.raw = raw
@@ -1639,7 +1639,7 b' class ialias(Table):'
1639 1639 Example::
1640 1640
1641 1641 >>> ialias
1642 <class 'IPython.Extensions.ipipe.ialias'>
1642 <class 'IPython.extensions.ipipe.ialias'>
1643 1643 """
1644 1644 def __iter__(self):
1645 1645 api = ipapi.get()
@@ -1702,10 +1702,10 b' class ix(Table):'
1702 1702 Examples::
1703 1703
1704 1704 >>> ix("ps x")
1705 IPython.Extensions.ipipe.ix('ps x')
1705 IPython.extensions.ipipe.ix('ps x')
1706 1706
1707 1707 >>> ix("find .") | ifile
1708 <IPython.Extensions.ipipe.ieval expr=<class 'IPython.Extensions.ipipe.ifile'> at 0x8509d2c>
1708 <IPython.extensions.ipipe.ieval expr=<class 'IPython.extensions.ipipe.ifile'> at 0x8509d2c>
1709 1709 # random
1710 1710 """
1711 1711 def __init__(self, cmd):
@@ -1928,9 +1928,9 b' class isort(Pipe):'
1928 1928 Examples::
1929 1929
1930 1930 >>> ils | isort("size")
1931 <IPython.Extensions.ipipe.isort key='size' reverse=False at 0x849ec2c>
1931 <IPython.extensions.ipipe.isort key='size' reverse=False at 0x849ec2c>
1932 1932 >>> ils | isort("_.isdir(), _.lower()", reverse=True)
1933 <IPython.Extensions.ipipe.isort key='_.isdir(), _.lower()' reverse=True at 0x849eacc>
1933 <IPython.extensions.ipipe.isort key='_.isdir(), _.lower()' reverse=True at 0x849eacc>
1934 1934 # all-random
1935 1935 """
1936 1936
@@ -2,7 +2,7 b''
2 2
3 3 IPython extension that installs the completers related to external apps.
4 4
5 The actual implementations are in Extensions/ipy_completers.py
5 The actual implementations are in extensions/ipy_completers.py
6 6
7 7 """
8 8 from IPython.core import ipapi
@@ -1,7 +1,7 b''
1 1
2 2 """ Implementations for various useful completers
3 3
4 See Extensions/ipy_stock_completers.py on examples of how to enable a completer,
4 See extensions/ipy_stock_completers.py on examples of how to enable a completer,
5 5 but the basic idea is to do:
6 6
7 7 ip.set_hook('complete_command', svn_completer, str_key = 'svn')
@@ -15,7 +15,7 b' Website: physics.nist.gov/constants'
15 15 # inspired by maxima's physconst.mac by Cliff Yapp
16 16
17 17 #from math import * # math MUST be imported BEFORE PhysicalQInteractive
18 from IPython.Extensions.PhysicalQInteractive import PhysicalQuantityInteractive
18 from IPython.extensions.PhysicalQInteractive import PhysicalQuantityInteractive
19 19
20 20 # Math constants:
21 21
@@ -4,7 +4,7 b' Register pretty-printers for types using ipy_pretty.for_type() or'
4 4 ipy_pretty.for_type_by_name(). For example, to use the example pretty-printer
5 5 for numpy dtype objects, add the following to your ipy_user_conf.py::
6 6
7 from IPython.Extensions import ipy_pretty
7 from IPython.extensions import ipy_pretty
8 8
9 9 ipy_pretty.activate()
10 10
@@ -82,7 +82,7 b' def dtype_pprinter(obj, p, cycle):'
82 82
83 83 def test_pretty():
84 84 """
85 In [1]: from IPython.Extensions import ipy_pretty
85 In [1]: from IPython.extensions import ipy_pretty
86 86
87 87 In [2]: ipy_pretty.activate()
88 88
@@ -16,7 +16,7 b' import ipy_legacy'
16 16
17 17 from IPython.core import ipapi
18 18
19 from IPython.Extensions import InterpreterPasteInput
19 from IPython.extensions import InterpreterPasteInput
20 20
21 21 def main():
22 22 ip = ipapi.get()
@@ -2,7 +2,7 b''
2 2
3 3 IPython extension that installs completers related to core ipython behaviour.
4 4
5 The actual implementations are in Extensions/ipy_completers.py
5 The actual implementations are in extensions/ipy_completers.py
6 6
7 7 """
8 8 from IPython.core import ipapi
@@ -64,11 +64,11 b" EXCLUDE = [pjoin('IPython', 'external'),"
64 64 pjoin('IPython', 'frontend', 'process', 'winprocess.py'),
65 65 pjoin('IPython_doctest_plugin'),
66 66 pjoin('IPython', 'Gnuplot'),
67 pjoin('IPython', 'Extensions', 'ipy_'),
68 pjoin('IPython', 'Extensions', 'clearcmd'),
69 pjoin('IPython', 'Extensions', 'PhysicalQInteractive'),
70 pjoin('IPython', 'Extensions', 'scitedirector'),
71 pjoin('IPython', 'Extensions', 'numeric_formats'),
67 pjoin('IPython', 'extensions', 'ipy_'),
68 pjoin('IPython', 'extensions', 'clearcmd'),
69 pjoin('IPython', 'extensions', 'PhysicalQInteractive'),
70 pjoin('IPython', 'extensions', 'scitedirector'),
71 pjoin('IPython', 'extensions', 'numeric_formats'),
72 72 pjoin('IPython', 'testing', 'attic'),
73 73 pjoin('IPython', 'testing', 'tutils'),
74 74 pjoin('IPython', 'testing', 'tools'),
@@ -76,7 +76,7 b" EXCLUDE = [pjoin('IPython', 'external'),"
76 76 ]
77 77
78 78 if not have_wx:
79 EXCLUDE.append(pjoin('IPython', 'Extensions', 'igrid'))
79 EXCLUDE.append(pjoin('IPython', 'extensions', 'igrid'))
80 80 EXCLUDE.append(pjoin('IPython', 'gui'))
81 81 EXCLUDE.append(pjoin('IPython', 'frontend', 'wx'))
82 82
@@ -84,7 +84,7 b' if not have_objc:'
84 84 EXCLUDE.append(pjoin('IPython', 'frontend', 'cocoa'))
85 85
86 86 if not have_curses:
87 EXCLUDE.append(pjoin('IPython', 'Extensions', 'ibrowse'))
87 EXCLUDE.append(pjoin('IPython', 'extensions', 'ibrowse'))
88 88
89 89 if not sys.platform == 'win32':
90 90 EXCLUDE.append(pjoin('IPython', 'platutils_win32'))
@@ -223,7 +223,7 b' def make_runners():'
223 223 top_mod.append('platutils_dummy.py')
224 224
225 225 # These are tested by nose, so skip IPython.kernel
226 top_pack = ['config','Extensions','frontend',
226 top_pack = ['config','extensions','frontend',
227 227 'testing','tests','tools','userconfig']
228 228
229 229 if have_wx:
@@ -18,7 +18,7 b' graft IPython/scripts'
18 18 graft IPython/testing
19 19 graft IPython/utils
20 20
21 recursive-include IPython/Extensions igrid_help*
21 recursive-include IPython/extensions igrid_help*
22 22
23 23 graft docs
24 24 exclude docs/\#*
@@ -17,7 +17,7 b" if __name__ == '__main__':"
17 17 docwriter = ApiDocWriter(package,rst_extension='.txt')
18 18 docwriter.package_skip_patterns += [r'\.fixes$',
19 19 r'\.externals$',
20 r'\.Extensions',
20 r'\.extensions',
21 21 r'\.kernel.config',
22 22 r'\.attic',
23 23 ]
@@ -25,7 +25,7 b' IPython currently has the following sub-packages:'
25 25
26 26 * :mod:`IPython.config`
27 27
28 * :mod:`IPython.Extensions`
28 * :mod:`IPython.extensions`
29 29
30 30 * :mod:`IPython.external`
31 31
@@ -97,7 +97,7 b' added for iplib, ipapi and Shell. The follow things still need to be done::'
97 97 * When running python setup.py sdist, the Sphinx API docs fail to build
98 98 because of something going on with IPython.core.fakemodule
99 99
100 * :file:`Extensions`. This needs to be gone through separately. Minimally,
100 * :file:`extensions`. This needs to be gone through separately. Minimally,
101 101 the package should be renamed to :file:`extensions` and the PYTHONPATH
102 102 setting in __init__.py needs to be updated.
103 103
@@ -15,7 +15,7 b' and get richer functionality - for example, you can import an'
15 15 extension and call functions in it to configure it for your purposes.
16 16
17 17 For an example extension (the 'sh' profile), see
18 IPython/Extensions/ipy_profile_sh.py.
18 IPython/extensions/ipy_profile_sh.py.
19 19
20 20 For the last word on what's available, see the source code of
21 21 IPython/ipapi.py.
@@ -202,7 +202,7 b' Provided extensions'
202 202
203 203 You can see the list of available extensions (and profiles) by doing
204 204 ``import ipy_<TAB>``. Some extensions don't have the ``ipy_`` prefix in
205 module name, so you may need to see the contents of IPython/Extensions
205 module name, so you may need to see the contents of IPython/extensions
206 206 folder to see what's available.
207 207
208 208 You can see a brief documentation of an extension by looking at the
@@ -1351,7 +1351,7 b' In a nutshell, you can redefine the way IPython processes the user input'
1351 1351 line to accept new, special extensions to the syntax without needing to
1352 1352 change any of IPython's own code.
1353 1353
1354 In the IPython/Extensions directory you will find some examples
1354 In the IPython/extensions directory you will find some examples
1355 1355 supplied, which we will briefly describe now. These can be used 'as is'
1356 1356 (and both provide very useful functionality), or you can use them as a
1357 1357 starting point for writing your own extensions.
@@ -1369,14 +1369,14 b' copying, carefully removing the leading extraneous characters.'
1369 1369 This extension identifies those starting characters and removes them
1370 1370 from the input automatically, so that one can paste multi-line examples
1371 1371 directly into IPython, saving a lot of time. Please look at the file
1372 InterpreterPasteInput.py in the IPython/Extensions directory for details
1372 InterpreterPasteInput.py in the IPython/extensions directory for details
1373 1373 on how this is done.
1374 1374
1375 1375 IPython comes with a special profile enabling this feature, called
1376 1376 tutorial. Simply start IPython via 'ipython -p tutorial' and the feature
1377 1377 will be available. In a normal IPython session you can activate the
1378 1378 feature by importing the corresponding module with:
1379 In [1]: import IPython.Extensions.InterpreterPasteInput
1379 In [1]: import IPython.extensions.InterpreterPasteInput
1380 1380
1381 1381 The following is a 'screenshot' of how things work when this extension
1382 1382 is on, copying an example from the standard tutorial::
@@ -1431,8 +1431,8 b" The physics profile supplied with IPython (enabled via 'ipython -p"
1431 1431 physics') uses these extensions, which you can also activate with:
1432 1432
1433 1433 from math import * # math MUST be imported BEFORE PhysicalQInteractive
1434 from IPython.Extensions.PhysicalQInteractive import *
1435 import IPython.Extensions.PhysicalQInput
1434 from IPython.extensions.PhysicalQInteractive import *
1435 import IPython.extensions.PhysicalQInput
1436 1436
1437 1437
1438 1438 Threading support
@@ -251,12 +251,12 b' First, capture output of "hg status"::'
251 251
252 252 [Q:/ipython]|28> out = !hg status
253 253 ==
254 ['M IPython\\Extensions\\ipy_kitcfg.py',
255 'M IPython\\Extensions\\ipy_rehashdir.py',
254 ['M IPython\\extensions\\ipy_kitcfg.py',
255 'M IPython\\extensions\\ipy_rehashdir.py',
256 256 ...
257 257 '? build\\lib\\IPython\\Debugger.py',
258 '? build\\lib\\IPython\\Extensions\\InterpreterExec.py',
259 '? build\\lib\\IPython\\Extensions\\InterpreterPasteInput.py',
258 '? build\\lib\\IPython\\extensions\\InterpreterExec.py',
259 '? build\\lib\\IPython\\extensions\\InterpreterPasteInput.py',
260 260 ...
261 261
262 262 (lines starting with ? are not under version control).
@@ -107,7 +107,7 b' def find_packages():'
107 107 add_package(packages, 'config.userconfig')
108 108 add_package(packages, 'core', tests=True)
109 109 add_package(packages, 'deathrow', tests=True)
110 add_package(packages , 'Extensions')
110 add_package(packages , 'extensions')
111 111 add_package(packages, 'external')
112 112 add_package(packages, 'frontend', tests=True)
113 113 # Don't include the cocoa frontend for now as it is not stable
@@ -200,7 +200,7 b' def find_data_files():'
200 200
201 201 # Simple file lists can be made by hand
202 202 manpages = filter(isfile, glob(pjoin('docs','man','*.1.gz')))
203 igridhelpfiles = filter(isfile, glob(pjoin('IPython','Extensions','igrid_help.*')))
203 igridhelpfiles = filter(isfile, glob(pjoin('IPython','extensions','igrid_help.*')))
204 204
205 205 # For nested structures, use the utility above
206 206 example_files = make_dir_struct(
@@ -64,7 +64,7 b' egg_extra_kwds = {}'
64 64 setup(name = name,
65 65 options = {
66 66 'py2exe': {
67 'packages' : ['IPython', 'IPython.Extensions', 'IPython.external',
67 'packages' : ['IPython', 'IPython.extensions', 'IPython.external',
68 68 'pyreadline'],
69 69 'excludes' : ["Tkconstants","Tkinter","tcl",'IPython.igrid','wx',
70 70 'wxPython','igrid', 'PyQt4', 'zope', 'Zope', 'Zope2',
General Comments 0
You need to be logged in to leave comments. Login now