From c852fa224a4452851f61cc03da49baf4f741144d 2012-02-07 00:32:34 From: Bradley M. Froehle Date: 2012-02-07 00:32:34 Subject: [PATCH] Add "something_to_run" flag which is set to True if there is a module, file, or code to run. --- diff --git a/IPython/frontend/terminal/ipapp.py b/IPython/frontend/terminal/ipapp.py index 6f1f694..e13fbfc 100755 --- a/IPython/frontend/terminal/ipapp.py +++ b/IPython/frontend/terminal/ipapp.py @@ -265,6 +265,8 @@ class TerminalIPythonApp(BaseIPythonApplication, InteractiveShellApp): self.interact = True def _file_to_run_changed(self, name, old, new): + if new: + self.something_to_run = True if new and not self.force_interact: self.interact = False _code_to_run_changed = _file_to_run_changed @@ -272,7 +274,7 @@ class TerminalIPythonApp(BaseIPythonApplication, InteractiveShellApp): # internal, not-configurable interact=Bool(True) - + something_to_run=Bool(False) def parse_command_line(self, argv=None): """override to allow old '-pylab' flag with deprecation warning""" @@ -307,7 +309,7 @@ class TerminalIPythonApp(BaseIPythonApplication, InteractiveShellApp): if not self.ignore_old_config: check_for_old_config(self.ipython_dir) # print self.extra_args - if self.extra_args and not self.module_to_run: + if self.extra_args and not self.something_to_run: self.file_to_run = self.extra_args[0] # create the shell self.init_shell()