Message216497
I tried to replace RESTART by doing these little changing
# PyShell.Py
class ModifiedInterpreter(InteractiveInterpreter):
def restart_subprocess(self, with_cwd=False, with_msg=True):
...
if with_msg:
halfbar = ((int(console.width) - 16) // 2) * '='
console.write(halfbar + ' RESTART ' + halfbar)
def runcode(self, code):
with_msg = True
if code.co_filename[0] != '<':
self.tkconsole.write('Executing ' + code.co_filename + '\n')
with_msg = False
if self.tkconsole.executing:
self.interp.restart_subprocess(with_msg)
# ScriptBinding.Py
class ScriptBinding:
def _run_module_event(self, event):
filename = self.getfilename()
if not filename:
return 'break'
code = self.checksyntax(filename)
if not code:
return 'break'
if not self.tabnanny(filename):
return 'break'
interp = self.shell.interp
if PyShell.use_subprocess:
interp.restart_subprocess(with_cwd=False, with_msg=False)
This works fine and replaces RESTART with Execute <filename> when file is executed in Python Shell.
Also instead of this
halfbar = ((int(console.width) - 16) // 2) * '='
console.write(halfbar + ' RESTART ' + halfbar)
my recomemdation is:
console.write('[SHELL RESTART]') |
|
Date |
User |
Action |
Args |
2014-04-16 16:50:05 | Adnan.Umer | set | recipients:
+ Adnan.Umer, terry.reedy |
2014-04-16 16:50:05 | Adnan.Umer | set | messageid: <1397667005.87.0.0595828877667.issue21192@psf.upfronthosting.co.za> |
2014-04-16 16:50:05 | Adnan.Umer | link | issue21192 messages |
2014-04-16 16:50:05 | Adnan.Umer | create | |
|