Permalink
Browse files

Add "something_to_run" flag which is set to True if there is a module…

…, file, or code to run.
  • Loading branch information...
1 parent b0e96c4 commit c852fa224a4452851f61cc03da49baf4f741144d @bfroehle committed Feb 7, 2012
Showing with 4 additions and 2 deletions.
  1. +4 −2 IPython/frontend/terminal/ipapp.py
View
6 IPython/frontend/terminal/ipapp.py
@@ -265,14 +265,16 @@ def _force_interact_changed(self, name, old, new):
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
_module_to_run_changed = _file_to_run_changed
# 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 @@ def initialize(self, argv=None):
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()

0 comments on commit c852fa2

Please sign in to comment.