mirror of
https://github.com/mnaberez/py65.git
synced 2025-01-16 18:33:00 +00:00
Use output() instead of calling print directly
This commit is contained in:
parent
a611da2c55
commit
4ec4ae6a8f
@ -50,7 +50,7 @@ class Monitor(cmd.Cmd):
|
|||||||
options, args = getopt.getopt(argv[1:], 'hm:l:r:g:',
|
options, args = getopt.getopt(argv[1:], 'hm:l:r:g:',
|
||||||
['help', 'mpu=', 'load=', 'rom=', 'goto='])
|
['help', 'mpu=', 'load=', 'rom=', 'goto='])
|
||||||
except getopt.GetoptError, err:
|
except getopt.GetoptError, err:
|
||||||
print str(err)
|
self._output(str(err))
|
||||||
self.usage()
|
self.usage()
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
@ -68,7 +68,9 @@ class Monitor(cmd.Cmd):
|
|||||||
self.do_goto(value)
|
self.do_goto(value)
|
||||||
if opt in ('-m','--mpu'):
|
if opt in ('-m','--mpu'):
|
||||||
if self._get_mpu(value) is None:
|
if self._get_mpu(value) is None:
|
||||||
print "Fatal: no such mpu. Available MPUs:", ', '.join(self.Microprocessors.keys())
|
mpus = ', '.join(self.Microprocessors.keys())
|
||||||
|
msg = "Fatal: no such MPU. Available MPUs: " + mpus
|
||||||
|
self._output(msg)
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
self.do_mpu(value)
|
self.do_mpu(value)
|
||||||
elif opt in ("-h", "--help"):
|
elif opt in ("-h", "--help"):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user