Better printout.
This commit is contained in:
parent
e39f6a7b99
commit
fc1ba21048
|
|
@ -41,11 +41,11 @@ class Arduino:
|
||||||
if code == 0:
|
if code == 0:
|
||||||
return True
|
return True
|
||||||
if code == 1:
|
if code == 1:
|
||||||
print("Operation failed.")
|
print('Operation failed.')
|
||||||
if code == 2:
|
if code == 2:
|
||||||
print("File not found")
|
print('File not found')
|
||||||
if code == 3:
|
if code == 3:
|
||||||
print("Invalid argument")
|
print('Invalid argument')
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def verify(sketch, board):
|
def verify(sketch, board):
|
||||||
|
|
@ -54,7 +54,7 @@ class Arduino:
|
||||||
'--verify', sketch,
|
'--verify', sketch,
|
||||||
'--board', board,
|
'--board', board,
|
||||||
#'--verbose-build',
|
#'--verbose-build',
|
||||||
]))
|
], stdout = open(os.devnull, 'wb')))
|
||||||
|
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
@ -101,14 +101,22 @@ class ArduinoMidiLibrary:
|
||||||
# Validate examples
|
# Validate examples
|
||||||
print('Validation for Arduino %s' % boardName)
|
print('Validation for Arduino %s' % boardName)
|
||||||
for example in self.getInstalledExamples():
|
for example in self.getInstalledExamples():
|
||||||
Arduino.verify(example, boardId)
|
if not Arduino.verify(example, boardId):
|
||||||
|
print('{0:40} {1}'.format(os.path.basename(example), 'FAILED'))
|
||||||
|
return False
|
||||||
|
else:
|
||||||
|
print('{0:40} {1}'.format(os.path.basename(example), 'PASSED'))
|
||||||
|
return True
|
||||||
|
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
lib = ArduinoMidiLibrary()
|
lib = ArduinoMidiLibrary()
|
||||||
lib.install()
|
lib.install()
|
||||||
lib.validate()
|
if lib.validate():
|
||||||
|
print('Validation passed')
|
||||||
|
else:
|
||||||
|
print('Validation failed')
|
||||||
|
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue