diff --git a/IPython/config/profile/cluster/ipython_config.py b/IPython/config/profile/cluster/ipython_config.py index fd795a4..a2780c2 100644 --- a/IPython/config/profile/cluster/ipython_config.py +++ b/IPython/config/profile/cluster/ipython_config.py @@ -1,24 +1,26 @@ c = get_config() +app = c.IPythonApp # This can be used at any point in a config file to load a sub config # and merge it into the current one. -load_subconfig('ipython_config.py') +import os +load_subconfig(os.path.join('..','profile_default', 'ipython_config.py')) lines = """ -from IPython.kernel.client import * +from IPython.parallel import * """ # You have to make sure that attributes that are containers already # exist before using them. Simple assigning a new list will override # all previous values. -if hasattr(c.Global, 'exec_lines'): - c.Global.exec_lines.append(lines) +if hasattr(app, 'exec_lines'): + app.exec_lines.append(lines) else: - c.Global.exec_lines = [lines] + app.exec_lines = [lines] # Load the parallelmagic extension to enable %result, %px, %autopx magics. -if hasattr(c.Global, 'extensions'): - c.Global.extensions.append('parallelmagic') +if hasattr(app, 'extensions'): + app.extensions.append('parallelmagic') else: - c.Global.extensions = ['parallelmagic'] + app.extensions = ['parallelmagic'] diff --git a/IPython/config/profile/default/ipython_config.py b/IPython/config/profile/default/ipython_config.py index 9764f31..9f51229 100644 --- a/IPython/config/profile/default/ipython_config.py +++ b/IPython/config/profile/default/ipython_config.py @@ -2,35 +2,36 @@ c = get_config() #----------------------------------------------------------------------------- -# Global options +# Application-level options #----------------------------------------------------------------------------- +app = c.IPythonApp -# c.Global.display_banner = True +# app.display_banner = True -# c.Global.classic = False +# app.classic = False -# c.Global.nosep = True +# app.nosep = True # If you still use multiple versions of IPytho on the same machine, # set this to True to suppress warnings about old configuration files -# c.Global.ignore_old_config = False +# app.ignore_old_config = False # Set this to determine the detail of what is logged at startup. # The default is 30 and possible values are 0,10,20,30,40,50. -# c.Global.log_level = 20 +# app.log_level = 20 # This should be a list of importable Python modules that have an # load_ipython_extension(ip) method. This method gets called when the extension # is loaded. You can put your extensions anywhere they can be imported # but we add the extensions subdir of the ipython directory to sys.path # during extension loading, so you can put them there as well. -# c.Global.extensions = [ +# app.extensions = [ # 'myextension' # ] # These lines are run in IPython in the user's namespace after extensions # are loaded. They can contain full IPython syntax with magics etc. -# c.Global.exec_lines = [ +# app.exec_lines = [ # 'import numpy', # 'a = 10; b = 20', # '1/0' @@ -40,7 +41,7 @@ c = get_config() # extension need to be pure Python. Files with a .ipy extension can have # custom IPython syntax (like magics, etc.). # These files need to be in the cwd, the ipython_dir or be absolute paths. -# c.Global.exec_files = [ +# app.exec_files = [ # 'mycode.py', # 'fancy.ipy' # ] diff --git a/IPython/config/profile/math/ipython_config.py b/IPython/config/profile/math/ipython_config.py index 49a0933..a7f43b3 100644 --- a/IPython/config/profile/math/ipython_config.py +++ b/IPython/config/profile/math/ipython_config.py @@ -1,8 +1,10 @@ c = get_config() +app = c.IPythonApp # This can be used at any point in a config file to load a sub config # and merge it into the current one. -load_subconfig('ipython_config.py') +import os +load_subconfig(os.path.join('..','profile_default', 'ipython_config.py')) lines = """ import cmath @@ -12,8 +14,9 @@ from math import * # You have to make sure that attributes that are containers already # exist before using them. Simple assigning a new list will override # all previous values. -if hasattr(c.Global, 'exec_lines'): - c.Global.exec_lines.append(lines) + +if hasattr(app, 'exec_lines'): + app.exec_lines.append(lines) else: - c.Global.exec_lines = [lines] + app.exec_lines = [lines] diff --git a/IPython/config/profile/pylab/ipython_config.py b/IPython/config/profile/pylab/ipython_config.py index 9885ac7..b9205d4 100644 --- a/IPython/config/profile/pylab/ipython_config.py +++ b/IPython/config/profile/pylab/ipython_config.py @@ -1,13 +1,15 @@ c = get_config() +app = c.IPythonApp # This can be used at any point in a config file to load a sub config # and merge it into the current one. -load_subconfig('ipython_config.py') +import os +load_subconfig(os.path.join('..','profile_default', 'ipython_config.py')) lines = """ import matplotlib -%gui -a wx -matplotlib.use('wxagg') +%gui qt +matplotlib.use('qtagg') matplotlib.interactive(True) from matplotlib import pyplot as plt from matplotlib.pyplot import * @@ -16,7 +18,7 @@ from matplotlib.pyplot import * # You have to make sure that attributes that are containers already # exist before using them. Simple assigning a new list will override # all previous values. -if hasattr(c.Global, 'exec_lines'): - c.Global.exec_lines.append(lines) +if hasattr(app, 'exec_lines'): + app.exec_lines.append(lines) else: - c.Global.exec_lines = [lines] \ No newline at end of file + app.exec_lines = [lines] \ No newline at end of file diff --git a/IPython/config/profile/pysh/ipython_config.py b/IPython/config/profile/pysh/ipython_config.py index ba20354..60d5c19 100644 --- a/IPython/config/profile/pysh/ipython_config.py +++ b/IPython/config/profile/pysh/ipython_config.py @@ -1,8 +1,10 @@ c = get_config() +app = c.IPythonApp # This can be used at any point in a config file to load a sub config # and merge it into the current one. -load_subconfig('ipython_config.py') +import os +load_subconfig(os.path.join('..','profile_default', 'ipython_config.py')) c.InteractiveShell.prompt_in1 = '\C_LightGreen\u@\h\C_LightBlue[\C_LightCyan\Y1\C_LightBlue]\C_Green|\#> ' c.InteractiveShell.prompt_in2 = '\C_Green|\C_LightGreen\D\C_Green> ' @@ -23,7 +25,7 @@ lines = """ # You have to make sure that attributes that are containers already # exist before using them. Simple assigning a new list will override # all previous values. -if hasattr(c.Global, 'exec_lines'): - c.Global.exec_lines.append(lines) +if hasattr(app, 'exec_lines'): + app.exec_lines.append(lines) else: - c.Global.exec_lines = [lines] \ No newline at end of file + app.exec_lines = [lines] \ No newline at end of file diff --git a/IPython/config/profile/sympy/ipython_config.py b/IPython/config/profile/sympy/ipython_config.py index e01308f..cdb3522 100644 --- a/IPython/config/profile/sympy/ipython_config.py +++ b/IPython/config/profile/sympy/ipython_config.py @@ -1,8 +1,10 @@ c = get_config() +app = c.IPythonApp # This can be used at any point in a config file to load a sub config # and merge it into the current one. -load_subconfig('ipython_config.py') +import os +load_subconfig(os.path.join('..','profile_default', 'ipython_config.py')) lines = """ from __future__ import division @@ -16,14 +18,14 @@ f, g, h = map(Function, 'fgh') # exist before using them. Simple assigning a new list will override # all previous values. -if hasattr(c.Global, 'exec_lines'): - c.Global.exec_lines.append(lines) +if hasattr(app, 'exec_lines'): + app.exec_lines.append(lines) else: - c.Global.exec_lines = [lines] + app.exec_lines = [lines] # Load the sympy_printing extension to enable nice printing of sympy expr's. -if hasattr(c.Global, 'extensions'): - c.Global.extensions.append('sympy_printing') +if hasattr(app, 'extensions'): + app.extensions.append('sympy_printing') else: - c.Global.extensions = ['sympy_printing'] + app.extensions = ['sympy_printing']