Permalink
Browse files

Merge pull request #596 from juliantaylor/irunner

Fix handling of command-line flags in irunner, plus manpage updates.
  • Loading branch information...
2 parents 4903337 + a55a9af commit 10c23676fd1d7c7c9c1587c1297e814c70d1f597 @fperez fperez committed Jul 23, 2011
Showing with 7 additions and 4 deletions.
  1. +4 −3 IPython/lib/irunner.py
  2. +3 −1 docs/man/irunner.1
View
7 IPython/lib/irunner.py
@@ -16,7 +16,7 @@
This is an extension of Ken Schutte <kschutte-AT-csail.mit.edu>'s script
contributed on the ipython-user list:
-http://scipy.net/pipermail/ipython-user/2006-May/001705.html
+http://mail.scipy.org/pipermail/ipython-user/2006-May/003539.html
NOTES:
@@ -410,7 +410,6 @@ def main():
parser = optparse.OptionParser(usage=MAIN_USAGE)
newopt = parser.add_option
- parser.set_defaults(mode='ipython')
newopt('--ipython',action='store_const',dest='mode',const='ipython',
help='IPython interactive runner (default).')
newopt('--python',action='store_const',dest='mode',const='python',
@@ -430,7 +429,9 @@ def main():
modes = {'.ipy':'ipython',
'.py':'python',
'.sage':'sage'}
- mode = modes.get(ext,opts.mode)
+ mode = modes.get(ext,"ipython")
+ if opts.mode:
+ mode = opts.mode
runners[mode]().main(args)
if __name__ == '__main__':
View
4 docs/man/irunner.1
@@ -10,6 +10,8 @@
.SH DESCRIPTION
irunner is an interface to the various interactive runners
available in IPython's \fBirunner\fP module.
+It can used to run scripts as if they where typed up
+interactively.
.PP
The already implemented runners are listed below; adding
one for a new program is a trivial task, see the source
@@ -42,7 +44,7 @@ irunner.py \-\-ipython \-\- \-\-interact script.ipy
.SH AUTHOR
\fBirunner\fP is an extension of Ken Schutte <kschutte-AT-csail.mit.edu>'s
script contributed on the ipython-user list:
-http://scipy.net/pipermail/ipython-user/2006-May/001705.html
+http://mail.scipy.org/pipermail/ipython-user/2006-May/003539.html
.PP
This manual page was written by Bernd Zeimetz <bernd@bzed.de>, for the Debian
project (but may be used by others). Modified by Fernando Perez

0 comments on commit 10c2367

Please sign in to comment.