From 42f253b6b18c1dc89d3677fe9416beb068fbf657 2006-11-26 20:37:01 From: vivainio Date: 2006-11-26 20:37:01 Subject: [PATCH] remove ipconfig and %config --- diff --git a/IPython/Magic.py b/IPython/Magic.py index 7c4b794..75f9bfa 100644 --- a/IPython/Magic.py +++ b/IPython/Magic.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- """Magic functions for InteractiveShell. -$Id: Magic.py 1933 2006-11-26 19:53:32Z vivainio $""" +$Id: Magic.py 1934 2006-11-26 20:37:01Z vivainio $""" #***************************************************************************** # Copyright (C) 2001 Janko Hauser and @@ -1028,54 +1028,6 @@ Currently the magic system has the following functions:\n""" for i in self.magic_who_ls(): del(user_ns[i]) - def magic_config(self,parameter_s=''): - """Handle IPython's internal configuration. - - If called without arguments, it will print IPython's complete internal - configuration. - - If called with one argument, it will print the value of that key in - the configuration. - - If called with more than one argument, the first is interpreted as a - key and the rest as a Python expression which gets eval()'d. - - Examples: - - In [1]: s='A Python string' - - In [2]: !echo $s - A Python string - - In [3]: config system_verbose True - - In [4]: !echo $s - IPython system call: echo A Python string - A Python string - - In [5]: %config system_header 'sys> ' - - In [6]: !echo $s - sys> echo A Python string - A Python string - - # Notice the extra quotes to protect the string after interpolation: - In [7]: header = "'sys2> '" - - In [8]: %config system_header $header - - In [9]: !echo $s - sys2> echo A Python string - A Python string - """ - - args = parameter_s.split(None,1) - key = args[0] - if len(args)==1: - self.shell.ipconfig(key) - else: - self.shell.ipconfig(key,eval(args[1])) - def magic_logstart(self,parameter_s=''): """Start logging anywhere in a session. diff --git a/IPython/iplib.py b/IPython/iplib.py index 59698f4..080b80d 100644 --- a/IPython/iplib.py +++ b/IPython/iplib.py @@ -6,7 +6,7 @@ Requires Python 2.3 or newer. This file contains all the classes and helper functions specific to IPython. -$Id: iplib.py 1885 2006-11-08 01:07:28Z fperez $ +$Id: iplib.py 1934 2006-11-26 20:37:01Z vivainio $ """ #***************************************************************************** @@ -728,7 +728,6 @@ class InteractiveShell(object,Magic): ipmagic = self.ipmagic, ipalias = self.ipalias, ipsystem = self.ipsystem, - ipconfig = self.ipconfig, _ip = self.api ) for biname,bival in builtins_new.items(): @@ -964,29 +963,6 @@ class InteractiveShell(object,Magic): else: error("Alias `%s` not found." % alias_name) - def ipconfig(self,key=None,value=None): - """Manipulate the IPython config. - - This provides a python interface to - If called with no arguments, it prints the internal IPython config - - Optional arguments: - - - key(None): if given, what key of the rc structure to return. - - - value(None): if given, set the key to this value.""" - - if key is None: - page('Current configuration structure:\n'+ - pformat(self.rc.dict())) - else: - if value is None: - print '%s -> %s' % (key,self.rc[key]) - else: - if key not in self.rc: - raise KeyError(str(key)) - self.rc[key] = value - def ipsystem(self,arg_s): """Make a system call, using IPython."""