diff --git a/IPython/Extensions/ipy_profile_sh.py b/IPython/Extensions/ipy_profile_sh.py index a0ae5ab..19dd11b 100644 --- a/IPython/Extensions/ipy_profile_sh.py +++ b/IPython/Extensions/ipy_profile_sh.py @@ -62,11 +62,11 @@ def main(): o.prompt_in2= r'\C_Green|\C_LightGreen\D\C_Green> ' o.prompt_out= '<\#> ' - from IPython import Release + from IPython.core import release import sys # Non-chatty banner - o.banner = "IPython %s [on Py %s]\n" % (Release.version,sys.version.split(None,1)[0]) + o.banner = "IPython %s [on Py %s]\n" % (release.version,sys.version.split(None,1)[0]) ip.IP.default_option('cd','-q') diff --git a/IPython/Extensions/ipy_profile_zope.py b/IPython/Extensions/ipy_profile_zope.py index 462e38d..5049de0 100644 --- a/IPython/Extensions/ipy_profile_zope.py +++ b/IPython/Extensions/ipy_profile_zope.py @@ -18,7 +18,7 @@ Authors # the file COPYING, distributed as part of this software. from IPython.core import ipapi -from IPython import Release +from IPython.core import release from types import StringType import sys import os @@ -299,7 +299,7 @@ def main(): # # I like my banner minimal. - o.banner = "ZOPE Py %s IPy %s\n" % (sys.version.split('\n')[0],Release.version) + o.banner = "ZOPE Py %s IPy %s\n" % (sys.version.split('\n')[0],release.version) print textwrap.dedent("""\ ZOPE mode iPython shell. diff --git a/IPython/__init__.py b/IPython/__init__.py index 40d73bf..9b144f9 100644 --- a/IPython/__init__.py +++ b/IPython/__init__.py @@ -48,7 +48,8 @@ import os sys.path.append(os.path.dirname(__file__) + "/Extensions") # Define what gets imported with a 'from IPython import *' -__all__ = ['IPython.core.ipapi','utils.generics','utils.ipstruct','Release','Shell'] +__all__ = ['IPython.core.ipapi','utils.generics','utils.ipstruct', + 'core.release','Shell'] # Load __all__ in IPython namespace so that a simple 'import IPython' gives # access to them via IPython. @@ -60,13 +61,13 @@ for name in __all__: import Shell # Release data -from IPython import Release # do it explicitly so pydoc can see it - pydoc bug +from IPython.core import release # do it explicitly so pydoc can see it - pydoc bug __author__ = '%s <%s>\n%s <%s>\n%s <%s>' % \ - ( Release.authors['Fernando'] + Release.authors['Janko'] + \ - Release.authors['Nathan'] ) -__license__ = Release.license -__version__ = Release.version -__revision__ = Release.revision + ( release.authors['Fernando'] + release.authors['Janko'] + \ + release.authors['Nathan'] ) +__license__ = release.license +__version__ = release.version +__revision__ = release.revision # Namespace cleanup del name,glob,loc diff --git a/IPython/core/crashhandler.py b/IPython/core/crashhandler.py index ec399b8..0cec89e 100644 --- a/IPython/core/crashhandler.py +++ b/IPython/core/crashhandler.py @@ -24,7 +24,7 @@ import sys from pprint import pformat # Our own -from IPython import Release +from IPython.core import release from IPython import ultraTB from IPython.external.Itpl import itpl @@ -166,8 +166,8 @@ $self.bug_tracker rpt_add = report.append rpt_add('*'*75+'\n\n'+'IPython post-mortem report\n\n') - rpt_add('IPython version: %s \n\n' % Release.version) - rpt_add('BZR revision : %s \n\n' % Release.revision) + rpt_add('IPython version: %s \n\n' % release.version) + rpt_add('BZR revision : %s \n\n' % release.revision) rpt_add('Platform info : os.name -> %s, sys.platform -> %s' % (os.name,sys.platform) ) rpt_add(sec_sep+'Current user configuration structure:\n\n') @@ -195,7 +195,7 @@ class IPythonCrashHandler(CrashHandler): # Set argument defaults app_name = 'IPython' bug_tracker = 'https://bugs.launchpad.net/ipython/+filebug' - contact_name,contact_email = Release.authors[AUTHOR_CONTACT][:2] + contact_name,contact_email = release.authors[AUTHOR_CONTACT][:2] crash_report_fname = 'IPython_crash_report.txt' # Call parent constructor CrashHandler.__init__(self,IP,app_name,contact_name,contact_email, @@ -210,8 +210,8 @@ class IPythonCrashHandler(CrashHandler): rpt_add = report.append rpt_add('*'*75+'\n\n'+'IPython post-mortem report\n\n') - rpt_add('IPython version: %s \n\n' % Release.version) - rpt_add('BZR revision : %s \n\n' % Release.revision) + rpt_add('IPython version: %s \n\n' % release.version) + rpt_add('BZR revision : %s \n\n' % release.revision) rpt_add('Platform info : os.name -> %s, sys.platform -> %s' % (os.name,sys.platform) ) rpt_add(sec_sep+'Current user configuration structure:\n\n') diff --git a/IPython/core/ipmaker.py b/IPython/core/ipmaker.py index 02a9aa6..ffbc233 100644 --- a/IPython/core/ipmaker.py +++ b/IPython/core/ipmaker.py @@ -45,7 +45,7 @@ from pprint import pprint # Our own from IPython.utils import DPyGetOpt -from IPython import Release +from IPython.core import release from IPython.utils.ipstruct import Struct from IPython.core.outputtrap import OutputTrap from IPython.config.configloader import ConfigLoader @@ -114,7 +114,7 @@ def make_IPython(argv=None,user_ns=None,user_global_ns=None,debug=1, 'for more information.\n' % (sys.version.split('\n')[0],), "IPython %s -- An enhanced Interactive Python." - % (Release.version,), + % (release.version,), """\ ? -> Introduction and overview of IPython's features. %quickref -> Quick reference. @@ -323,7 +323,7 @@ object? -> Details about 'object'. ?object also works, ?? prints more. sys.exit() if opts_all.Version: - print Release.version + print release.version sys.exit() if opts_all.magic_docstrings: diff --git a/IPython/core/prompts.py b/IPython/core/prompts.py index 31346ed..1487d2d 100644 --- a/IPython/core/prompts.py +++ b/IPython/core/prompts.py @@ -21,7 +21,7 @@ import time # IPython's own from IPython.utils import coloransi -from IPython import Release +from IPython.core import release from IPython.external.Itpl import ItplNS from IPython.core.ipapi import TryNext from IPython.utils.ipstruct import Struct @@ -170,7 +170,7 @@ prompt_specials_color = { # Carriage return r'\r': '\r', # Release version - r'\v': Release.version, + r'\v': release.version, # Root symbol ($ or #) r'\$': ROOT_SYMBOL, } diff --git a/IPython/Release.py b/IPython/core/release.py similarity index 100% rename from IPython/Release.py rename to IPython/core/release.py diff --git a/IPython/core/tests/test_imports.py b/IPython/core/tests/test_imports.py index 2662d51..7221512 100644 --- a/IPython/core/tests/test_imports.py +++ b/IPython/core/tests/test_imports.py @@ -51,3 +51,6 @@ def test_import_prefilter(): def test_import_prompts(): from IPython.core import prompts + +def test_import_release(): + from IPython.core import release \ No newline at end of file diff --git a/IPython/kernel/core/prompts.py b/IPython/kernel/core/prompts.py index 4e9e68a..efd6aec 100644 --- a/IPython/kernel/core/prompts.py +++ b/IPython/kernel/core/prompts.py @@ -28,7 +28,7 @@ import sys from IPython.external.Itpl import ItplNS from IPython.utils import coloransi -from IPython import Release +from IPython.core import release from IPython.core.ipapi import TryNext from IPython.utils.genutils import * import IPython.utils.generics @@ -153,7 +153,7 @@ prompt_specials_color = { # Carriage return r'\r': '\r', # Release version - r'\v': Release.version, + r'\v': release.version, # Root symbol ($ or #) r'\$': ROOT_SYMBOL, } diff --git a/IPython/testing/iptest.py b/IPython/testing/iptest.py index e82876f..a536831 100644 --- a/IPython/testing/iptest.py +++ b/IPython/testing/iptest.py @@ -205,7 +205,7 @@ def make_runners(): 'iplib.py', 'ipmaker.py', 'ipstruct.py', 'Itpl.py', 'logger.py', 'macro.py', 'magic.py', 'oinspect.py', 'outputtrap.py', 'platutils.py', 'prefilter.py', 'prompts.py', - 'PyColorize.py', 'Release.py', 'rlineimpl.py', 'shadowns.py', + 'PyColorize.py', 'release.py', 'rlineimpl.py', 'shadowns.py', 'shellglobals.py', 'strdispatch.py', 'twshell.py', 'ultraTB.py', 'upgrade_dir.py', 'usage.py', 'wildcard.py', # See note above for why this is skipped