From 39a2584a565db5c914d65c604e4d6a4b6c494f12 2007-08-21 18:19:20 From: vivainio Date: 2007-08-21 18:19:20 Subject: [PATCH] ipythonrc-PROF now take precedence over ipy_profile_PROF.py --- diff --git a/IPython/Magic.py b/IPython/Magic.py index f9d9fc4..a6bfd5d 100644 --- a/IPython/Magic.py +++ b/IPython/Magic.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- """Magic functions for InteractiveShell. -$Id: Magic.py 2637 2007-08-17 16:18:05Z vivainio $""" +$Id: Magic.py 2649 2007-08-21 18:19:20Z vivainio $""" #***************************************************************************** # Copyright (C) 2001 Janko Hauser and @@ -2137,7 +2137,11 @@ Currently the magic system has the following functions:\n""" if not new_scheme: print 'You must specify a color scheme.' return + # local shortcut + shell = self.shell + import IPython.rlineimpl as readline + if not readline.have_readline and sys.platform == "win32": msg = """\ Proper color support under MS Windows requires the pyreadline library. @@ -2150,9 +2154,11 @@ http://starship.python.net/crew/theller/ctypes Defaulting color scheme to 'NoColor'""" new_scheme = 'NoColor' warn(msg) - # local shortcut - shell = self.shell + # readline option is 0 + if not shell.has_readline: + new_scheme = 'NoColor' + # Set prompt colors try: shell.outputcache.set_colors(new_scheme) diff --git a/IPython/Release.py b/IPython/Release.py index 31f0df7..43b93b4 100644 --- a/IPython/Release.py +++ b/IPython/Release.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- """Release data for the IPython project. -$Id: Release.py 2607 2007-08-13 13:25:24Z fperez $""" +$Id: Release.py 2649 2007-08-21 18:19:20Z vivainio $""" #***************************************************************************** # Copyright (C) 2001-2006 Fernando Perez @@ -22,7 +22,7 @@ name = 'ipython' # because bdist_rpm does not accept dashes (an RPM) convention, and # bdist_deb does not accept underscores (a Debian convention). -revision = '2606' +revision = '2647M' version = '0.8.2.svn.r' + revision.rstrip('M') diff --git a/IPython/ipmaker.py b/IPython/ipmaker.py index 2a15caa..3d10d91 100644 --- a/IPython/ipmaker.py +++ b/IPython/ipmaker.py @@ -6,7 +6,7 @@ Requires Python 2.1 or better. This file contains the main make_IPython() starter function. -$Id: ipmaker.py 2587 2007-08-06 19:38:32Z vivainio $""" +$Id: ipmaker.py 2649 2007-08-21 18:19:20Z vivainio $""" #***************************************************************************** # Copyright (C) 2001-2006 Fernando Perez. @@ -424,12 +424,14 @@ object? -> Details about 'object'. ?object also works, ?? prints more. % (opts_all.rcfile) ) # 'profiles' are a shorthand notation for config filenames + profile_handled_by_legacy = False if opts_all.profile: try: opts_all.rcfile = filefind('ipythonrc-' + opts_all.profile + rc_suffix, opts_all.ipythondir) + profile_handled_by_legacy = True except IOError: if opts_all.debug: IP.InteractiveTB() opts.profile = '' # remove profile from options if invalid @@ -624,7 +626,8 @@ object? -> Details about 'object'. ?object also works, ?? prints more. IP.InteractiveTB() import_fail_info('ipy_system_conf') - if opts_all.profile: + # only import prof module if ipythonrc-PROF was not found + if opts_all.profile and not profile_handled_by_legacy: profmodname = 'ipy_profile_' + opts_all.profile try: __import__(profmodname)