##// END OF EJS Templates
python mybatch.ipy exits ipython immediately after...
vivainio -
Show More
@@ -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 1356 2006-06-07 23:51:05Z fperez $
9 $Id: iplib.py 1357 2006-06-08 12:15:46Z vivainio $
10 10 """
11 11
12 12 #*****************************************************************************
@@ -666,12 +666,16 b' class InteractiveShell(object,Magic):'
666 666 self.magic_alias(alias)
667 667 self.hooks.late_startup_hook()
668 668
669 batchrun = False
669 670 for batchfile in [path(arg) for arg in self.rc.args
670 671 if arg.lower().endswith('.ipy')]:
671 672 if not batchfile.isfile():
672 673 print "No such batch file:", batchfile
673 674 continue
674 675 self.api.runlines(batchfile.text())
676 batchrun = True
677 if batchrun:
678 self.exit_now = True
675 679
676 680 def add_builtins(self):
677 681 """Store ipython references into the builtin namespace.
@@ -1470,6 +1474,10 b' want to merge them back into the new files.""" % locals()'
1470 1474 close!).
1471 1475
1472 1476 """
1477
1478 if self.exit_now:
1479 # batch run -> do not interact
1480 return
1473 1481 cprt = 'Type "copyright", "credits" or "license" for more information.'
1474 1482 if banner is None:
1475 1483 self.write("Python %s on %s\n%s\n(%s)\n" %
@@ -1484,7 +1492,6 b' want to merge them back into the new files.""" % locals()'
1484 1492 __builtin__.__dict__['__IPYTHON__active'] += 1
1485 1493
1486 1494 # exit_now is set by a call to %Exit or %Quit
1487 self.exit_now = False
1488 1495 while not self.exit_now:
1489 1496 if more:
1490 1497 prompt = self.outputcache.prompt2
@@ -1,3 +1,8 b''
1 2006-06-07 Ville Vainio <vivainio@gmail.com>
2
3 * iplib.py: ipython mybatch.ipy exits ipython immediately after
4 running the batch files instead of leaving the session open.
5
1 6 2006-06-07 Fernando Perez <Fernando.Perez@colorado.edu>
2 7
3 8 * IPython/iplib.py (InteractiveShell.__init__): update BSD fix, as
General Comments 0
You need to be logged in to leave comments. Login now