Skip to content

Commit

Permalink
update config files to match new namespace.
Browse files Browse the repository at this point in the history
  • Loading branch information
minrk committed Jun 7, 2011
1 parent d748312 commit 4d6be30
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 38 deletions.
18 changes: 10 additions & 8 deletions 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']

19 changes: 10 additions & 9 deletions IPython/config/profile/default/ipython_config.py
Expand Up @@ -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'
Expand All @@ -40,7 +41,7 @@
# 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'
# ]
Expand Down
11 changes: 7 additions & 4 deletions 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
Expand All @@ -12,8 +14,9 @@
# 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]

14 changes: 8 additions & 6 deletions 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 *
Expand All @@ -16,7 +18,7 @@
# 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]
10 changes: 6 additions & 4 deletions 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> '
Expand All @@ -23,7 +25,7 @@
# 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]
16 changes: 9 additions & 7 deletions 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
Expand All @@ -16,14 +18,14 @@
# 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']

0 comments on commit 4d6be30

Please sign in to comment.