##// END OF EJS Templates
added 'quiet' option
vivainio -
Show More
@@ -1,7 +1,7 b''
1 1 # -*- coding: utf-8 -*-
2 2 """Magic functions for InteractiveShell.
3 3
4 $Id: Magic.py 1351 2006-06-05 13:43:18Z vivainio $"""
4 $Id: Magic.py 1355 2006-06-07 16:56:50Z vivainio $"""
5 5
6 6 #*****************************************************************************
7 7 # Copyright (C) 2001 Janko Hauser <jhauser@zscout.de> and
@@ -973,9 +973,9 b' Currently the magic system has the following functions:\\n"""'
973 973
974 974 Input/Output history are left around in case you need them."""
975 975
976 ans = raw_input(
977 "Once deleted, variables cannot be recovered. Proceed (y/n)? ")
978 if not ans.lower() == 'y':
976 ans = self.shell.ask_yes_no(
977 "Once deleted, variables cannot be recovered. Proceed (y/[n])? ")
978 if not ans:
979 979 print 'Nothing done.'
980 980 return
981 981 user_ns = self.shell.user_ns
@@ -6,7 +6,7 b' Requires Python 2.3 or newer.'
6 6
7 7 This file contains all the classes and helper functions specific to IPython.
8 8
9 $Id: iplib.py 1350 2006-06-04 14:06:06Z fperez $
9 $Id: iplib.py 1355 2006-06-07 16:56:50Z vivainio $
10 10 """
11 11
12 12 #*****************************************************************************
@@ -1231,6 +1231,11 b' want to merge them back into the new files.""" % locals()'
1231 1231 # Configure auto-indent for all platforms
1232 1232 self.set_autoindent(self.rc.autoindent)
1233 1233
1234 def ask_yes_no(self,prompt,default=True):
1235 if self.rc.quiet:
1236 return True
1237 return ask_yes_no(prompt,default)
1238
1234 1239 def _should_recompile(self,e):
1235 1240 """Utility routine for edit_syntax_error"""
1236 1241
@@ -1241,7 +1246,7 b' want to merge them back into the new files.""" % locals()'
1241 1246 return False
1242 1247 try:
1243 1248 if (self.rc.autoedit_syntax and
1244 not ask_yes_no('Return to editor to correct syntax error? '
1249 not self.ask_yes_no('Return to editor to correct syntax error? '
1245 1250 '[Y/n] ','y')):
1246 1251 return False
1247 1252 except EOFError:
@@ -2207,7 +2212,7 b' want to merge them back into the new files.""" % locals()'
2207 2212 This method sets the exit_now attribute."""
2208 2213
2209 2214 if self.rc.confirm_exit:
2210 if ask_yes_no('Do you really want to exit ([y]/n)?','y'):
2215 if self.ask_yes_no('Do you really want to exit ([y]/n)?','y'):
2211 2216 self.exit_now = True
2212 2217 else:
2213 2218 self.exit_now = True
@@ -6,7 +6,7 b' Requires Python 2.1 or better.'
6 6
7 7 This file contains the main make_IPython() starter function.
8 8
9 $Id: ipmaker.py 1347 2006-06-04 00:42:44Z fperez $"""
9 $Id: ipmaker.py 1355 2006-06-07 16:56:50Z vivainio $"""
10 10
11 11 #*****************************************************************************
12 12 # Copyright (C) 2001-2006 Fernando Perez. <fperez@colorado.edu>
@@ -208,6 +208,7 b" object? -> Details about 'object'. ?object also works, ?? prints more."
208 208 prompt_in2 = ' .\\D.: ',
209 209 prompt_out = 'Out[\\#]: ',
210 210 prompts_pad_left = 1,
211 quiet = 0,
211 212 quick = 0,
212 213 readline = 1,
213 214 readline_merge_completions = 1,
@@ -1,3 +1,9 b''
1 2006-06-07 Ville Vainio <vivainio@gmail.com>
2
3 * iplib.py,Magic.py, ipmaker.py (magic_rehashx):
4 Confirmation prompts can be supressed by 'quiet' option.
5 _ip.options.quiet = 1 means "assume yes for all yes/no queries".
6
1 7 2006-06-06 Fernando Perez <Fernando.Perez@colorado.edu>
2 8
3 9 * IPython/Release.py (version): Made 0.7.2 final for release.
@@ -6,10 +12,10 b''
6 12 2006-06-05 Ville Vainio <vivainio@gmail.com>
7 13
8 14 * Magic.py (magic_rehashx): Honor no_alias list earlier in
9 %rehashx, to avoid clobbering builtins in ipy_profile_sh.py
15 %rehashx, to avoid clobbering builtins in ipy_profile_sh.py
10 16
11 * upgrade_dir.py: try import 'path' module a bit harder
12 (for %upgrade)A
17 * upgrade_dir.py: try import 'path' module a bit harder
18 (for %upgrade)
13 19
14 20 2006-06-03 Fernando Perez <Fernando.Perez@colorado.edu>
15 21
General Comments 0
You need to be logged in to leave comments. Login now