##// END OF EJS Templates
Implement a proper -i command line option
vivainio -
Show More
@@ -476,7 +476,6 b' class DebugTools:'
476 self.debugmode = False
476 self.debugmode = False
477 self.hotnames = set()
477 self.hotnames = set()
478
478
479
480 def hotname(self, name_to_catch):
479 def hotname(self, name_to_catch):
481 self.hotnames.add(name_to_catch)
480 self.hotnames.add(name_to_catch)
482
481
@@ -6,7 +6,7 b' Requires Python 2.3 or newer.'
6
6
7 This file contains all the classes and helper functions specific to IPython.
7 This file contains all the classes and helper functions specific to IPython.
8
8
9 $Id: iplib.py 2652 2007-08-22 17:25:24Z vivainio $
9 $Id: iplib.py 2674 2007-08-26 12:34:05Z vivainio $
10 """
10 """
11
11
12 #*****************************************************************************
12 #*****************************************************************************
@@ -698,6 +698,7 b' class InteractiveShell(object,Magic):'
698 # Load user aliases
698 # Load user aliases
699 for alias in rc.alias:
699 for alias in rc.alias:
700 self.magic_alias(alias)
700 self.magic_alias(alias)
701
701 self.hooks.late_startup_hook()
702 self.hooks.late_startup_hook()
702
703
703 batchrun = False
704 batchrun = False
@@ -708,7 +709,8 b' class InteractiveShell(object,Magic):'
708 continue
709 continue
709 self.api.runlines(batchfile.text())
710 self.api.runlines(batchfile.text())
710 batchrun = True
711 batchrun = True
711 if batchrun:
712 # without -i option, exit after running the batch file
713 if batchrun and not self.rc.interact:
712 self.exit_now = True
714 self.exit_now = True
713
715
714 def add_builtins(self):
716 def add_builtins(self):
@@ -1522,7 +1524,8 b' want to merge them back into the new files.""" % locals()'
1522
1524
1523 #sys.argv = ['-c']
1525 #sys.argv = ['-c']
1524 self.push(self.prefilter(self.rc.c, False))
1526 self.push(self.prefilter(self.rc.c, False))
1525 self.exit_now = True
1527 if not self.rc.interact:
1528 self.exit_now = True
1526
1529
1527 def embed_mainloop(self,header='',local_ns=None,global_ns=None,stack_depth=0):
1530 def embed_mainloop(self,header='',local_ns=None,global_ns=None,stack_depth=0):
1528 """Embeds IPython into a running python program.
1531 """Embeds IPython into a running python program.
@@ -1621,7 +1624,7 b' want to merge them back into the new files.""" % locals()'
1621
1624
1622 # Mark activity in the builtins
1625 # Mark activity in the builtins
1623 __builtin__.__dict__['__IPYTHON__active'] += 1
1626 __builtin__.__dict__['__IPYTHON__active'] += 1
1624
1627
1625 if self.has_readline:
1628 if self.has_readline:
1626 self.readline_startup_hook(self.pre_readline)
1629 self.readline_startup_hook(self.pre_readline)
1627 # exit_now is set by a call to %Exit or %Quit
1630 # exit_now is set by a call to %Exit or %Quit
@@ -6,7 +6,7 b' Requires Python 2.1 or better.'
6
6
7 This file contains the main make_IPython() starter function.
7 This file contains the main make_IPython() starter function.
8
8
9 $Id: ipmaker.py 2672 2007-08-26 09:15:26Z vivainio $"""
9 $Id: ipmaker.py 2674 2007-08-26 12:34:05Z vivainio $"""
10
10
11 #*****************************************************************************
11 #*****************************************************************************
12 # Copyright (C) 2001-2006 Fernando Perez. <fperez@colorado.edu>
12 # Copyright (C) 2001-2006 Fernando Perez. <fperez@colorado.edu>
@@ -176,7 +176,7 b" object? -> Details about 'object'. ?object also works, ?? prints more."
176
176
177 # The "ignore" option is a kludge so that Emacs buffers don't crash, since
177 # The "ignore" option is a kludge so that Emacs buffers don't crash, since
178 # the 'C-c !' command in emacs automatically appends a -i option at the end.
178 # the 'C-c !' command in emacs automatically appends a -i option at the end.
179 cmdline_only = ('help ignore|i ipythondir=s Version upgrade '
179 cmdline_only = ('help interact|i ipythondir=s Version upgrade '
180 'gthread! qthread! q4thread! wthread! pylab! tk!')
180 'gthread! qthread! q4thread! wthread! pylab! tk!')
181
181
182 # Build the actual name list to be used by DPyGetOpt
182 # Build the actual name list to be used by DPyGetOpt
@@ -199,7 +199,7 b" object? -> Details about 'object'. ?object also works, ?? prints more."
199 deep_reload = 0,
199 deep_reload = 0,
200 editor = '0',
200 editor = '0',
201 help = 0,
201 help = 0,
202 ignore = 0,
202 interact = 0,
203 ipythondir = ipythondir_def,
203 ipythondir = ipythondir_def,
204 log = 0,
204 log = 0,
205 logfile = '',
205 logfile = '',
@@ -1,7 +1,12 b''
1 2007-08-26 Ville Vainio <vivainio@gmail.com>
1 2007-08-26 Ville Vainio <vivainio@gmail.com>
2
2
3 * ipmaker.py: Command line args have the highest priority again
3 * ipmaker.py: Command line args have the highest priority again
4
5 * iplib.py, ipmaker.py: -i command line argument now behaves as in
6 normal python, i.e. leaves the IPython session running after -c
7 command or running a batch file from command line.
4
8
9 *
5 2007-08-22 Ville Vainio <vivainio@gmail.com>
10 2007-08-22 Ville Vainio <vivainio@gmail.com>
6
11
7 * iplib.py: no extra empty (last) line in raw hist w/ multiline
12 * iplib.py: no extra empty (last) line in raw hist w/ multiline
General Comments 0
You need to be logged in to leave comments. Login now