mirror of
https://github.com/mnaberez/py65.git
synced 2024-09-28 00:54:54 +00:00
Fix MPU status display from wrapping unexpectedly on some terminals.
The unexpected wrapping was caused by passing a multiline string to Cmd.prompt. Cmd in turn passes the prompt string to raw_input(), which expects only a single line.
This commit is contained in:
parent
8f284a8e58
commit
ea56153573
@ -8,6 +8,9 @@
|
|||||||
|
|
||||||
- Reformatted source code to comply with PEP8.
|
- Reformatted source code to comply with PEP8.
|
||||||
|
|
||||||
|
- Fixed a bug where the MPU status display would wrap unexpectedly
|
||||||
|
on some terminals.
|
||||||
|
|
||||||
0.13 (2012-11-15)
|
0.13 (2012-11-15)
|
||||||
|
|
||||||
- Fixed a bug where negative numbers could be entered
|
- Fixed a bug where negative numbers could be entered
|
||||||
|
@ -43,9 +43,10 @@ class Monitor(cmd.Cmd):
|
|||||||
argv = sys.argv
|
argv = sys.argv
|
||||||
self._reset(self.mpu_type)
|
self._reset(self.mpu_type)
|
||||||
self._width = 78
|
self._width = 78
|
||||||
self._update_prompt()
|
self.prompt = "."
|
||||||
self._add_shortcuts()
|
self._add_shortcuts()
|
||||||
cmd.Cmd.__init__(self, completekey, stdin, stdout)
|
cmd.Cmd.__init__(self, completekey, stdin, stdout)
|
||||||
|
self._output_mpu_status()
|
||||||
self._parse_args(argv)
|
self._parse_args(argv)
|
||||||
|
|
||||||
def _parse_args(self, argv):
|
def _parse_args(self, argv):
|
||||||
@ -109,7 +110,7 @@ class Monitor(cmd.Cmd):
|
|||||||
error = 'Error: %s, %s: file: %s line: %s' % (t, v, file, line)
|
error = 'Error: %s, %s: file: %s line: %s' % (t, v, file, line)
|
||||||
self._output(error)
|
self._output(error)
|
||||||
|
|
||||||
self._update_prompt()
|
self._output_mpu_status()
|
||||||
return result
|
return result
|
||||||
|
|
||||||
def _reset(self, mpu_type):
|
def _reset(self, mpu_type):
|
||||||
@ -211,8 +212,8 @@ class Monitor(cmd.Cmd):
|
|||||||
|
|
||||||
self._mpu.memory = m
|
self._mpu.memory = m
|
||||||
|
|
||||||
def _update_prompt(self):
|
def _output_mpu_status(self):
|
||||||
self.prompt = "\n%s\n." % repr(self._mpu)
|
self._output("\n" + repr(self._mpu))
|
||||||
|
|
||||||
def _output(self, stuff):
|
def _output(self, stuff):
|
||||||
if stuff is not None:
|
if stuff is not None:
|
||||||
|
Loading…
Reference in New Issue
Block a user