changeset: 97175:2ae12789dcb8 branch: 3.4 parent: 97171:6703ac68bf49 user: Terry Jan Reedy date: Fri Jul 31 22:34:37 2015 -0400 files: Lib/idlelib/PyShell.py Lib/idlelib/ScriptBinding.py Misc/ACKS description: Issue #21192: Idle Editor. When a file is run, put its name in the restart bar. Do not print false prompts. Original patch by Adnan Umer. diff -r 6703ac68bf49 -r 2ae12789dcb8 Lib/idlelib/PyShell.py --- a/Lib/idlelib/PyShell.py Fri Jul 31 23:36:00 2015 +0200 +++ b/Lib/idlelib/PyShell.py Fri Jul 31 22:34:37 2015 -0400 @@ -469,7 +469,7 @@ self.poll_subprocess() return self.rpcclt - def restart_subprocess(self, with_cwd=False): + def restart_subprocess(self, with_cwd=False, filename=''): if self.restarting: return self.rpcclt self.restarting = True @@ -497,14 +497,13 @@ console.stop_readline() # annotate restart in shell window and mark it console.text.delete("iomark", "end-1c") - if was_executing: - console.write('\n') - console.showprompt() - halfbar = ((int(console.width) - 16) // 2) * '=' - console.write(halfbar + ' RESTART ' + halfbar) + tag = 'RUN ' + filename if filename else 'RESTART Shell' + halfbar = ((int(console.width) -len(tag) - 4) // 2) * '=' + console.write("\n{0} {1} {0}".format(halfbar, tag)) console.text.mark_set("restart", "end-1c") console.text.mark_gravity("restart", "left") - console.showprompt() + if not filename: + console.showprompt() # restart subprocess debugger if debug: # Restarted debugger connects to current instance of debug GUI diff -r 6703ac68bf49 -r 2ae12789dcb8 Lib/idlelib/ScriptBinding.py --- a/Lib/idlelib/ScriptBinding.py Fri Jul 31 23:36:00 2015 +0200 +++ b/Lib/idlelib/ScriptBinding.py Fri Jul 31 22:34:37 2015 -0400 @@ -142,7 +142,7 @@ return 'break' interp = self.shell.interp if PyShell.use_subprocess: - interp.restart_subprocess(with_cwd=False) + interp.restart_subprocess(with_cwd=False, filename=code.co_filename) dirname = os.path.dirname(filename) # XXX Too often this discards arguments the user just set... interp.runcommand("""if 1: diff -r 6703ac68bf49 -r 2ae12789dcb8 Misc/ACKS --- a/Misc/ACKS Fri Jul 31 23:36:00 2015 +0200 +++ b/Misc/ACKS Fri Jul 31 22:34:37 2015 -0400 @@ -1403,6 +1403,7 @@ Doobee R. Tzeck Eren Türkay Lionel Ulmer +Adnan Umer Roger Upole Daniel Urban Michael Urman