# HG changeset patch # User catherine@dellzilla # Date 1266427969 18000 # Node ID 5972ae04515e3e49e398275ecb3dff30b75d588f # Parent 7cd04727f7f76eeaf9557419cf432c50541c8065 EOF is now the 'unusual' stop signal diff -r 7cd04727f7f7 -r 5972ae04515e cmd2.py --- a/cmd2.py Wed Feb 17 12:08:42 2010 -0500 +++ b/cmd2.py Wed Feb 17 12:32:49 2010 -0500 @@ -415,7 +415,8 @@ self.poutput(msg) else: print (msg) - _STOP_AND_EXIT = 2 # distinguish end of script file from actual exit + _STOP_AND_EXIT = True # distinguish end of script file from actual exit + _STOP_SCRIPT_NO_EXIT = -999 editor = os.environ.get('EDITOR') if not editor: if sys.platform[:3] == 'win': @@ -911,7 +912,7 @@ return stop def do_EOF(self, arg): - return True + return self._STOP_SCRIPT_NO_EXIT # End of script; should not exit app do_eof = do_EOF def do_quit(self, arg): @@ -1198,7 +1199,7 @@ self.stdin.close() keepstate.restore() self.lastcmd = '' - return (stop == self._STOP_AND_EXIT) and self._STOP_AND_EXIT + return stop and (stop != self._STOP_SCRIPT_NO_EXIT) do__load = do_load # avoid an unfortunate legacy use of do_load from sqlpython def do_run(self, arg):