Author terry.reedy
Recipients Adnan.Umer, terry.reedy
Date 2014-04-15.05:29:58
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1397539799.52.0.214939216044.issue21192@psf.upfronthosting.co.za>
In-reply-to
Content
I have not tried your patch yet, but the relevant code seems to be

class ModifiedInterpreter(InteractiveInterpreter):
    def runcode(self, code):
        if code.co_filename[0] != '<': ## your patch
            self.tkconsole.write('Executing ' + code.co_filename + '\n')
        if self.tkconsole.executing:
            self.interp.restart_subprocess()

     def restart_subprocess(self, with_cwd=False):
        if was_executing:
            console.write('\n')
            console.showprompt()
        halfbar = ((int(console.width) - 16) // 2) * '='
        console.write(halfbar + ' RESTART ' + halfbar)

The 2 problems I see with the patch are that 1) it prints prematurely and 2) it does not replace RESTART. Both should be solved by passing the title string to restart_process as a new 'title' arg (title=' RESTART ').

The halfbar expression should use len(title). I believe 16 is 9 (len(' RESTART ')) + 4 (len('>>> ')) + 3 (console.width (80) - 77). So
        halfbar = ((int(console.width) - len(title) - 7) // 2) * '='

I think the bar would be better without a prompt before it. If console.showprompt() is deleted, 7 becomes 3.
I will code this later.
History
Date User Action Args
2014-04-15 05:29:59terry.reedysetrecipients: + terry.reedy, Adnan.Umer
2014-04-15 05:29:59terry.reedysetmessageid: <1397539799.52.0.214939216044.issue21192@psf.upfronthosting.co.za>
2014-04-15 05:29:59terry.reedylinkissue21192 messages
2014-04-15 05:29:58terry.reedycreate