|
@ -155,7 +155,7 @@ def input_board(): |
|
|
# Choose the board |
|
|
# Choose the board |
|
|
try: |
|
|
try: |
|
|
index = int(input("Choose the board you want to flash (empty if none of these): ")) |
|
|
index = int(input("Choose the board you want to flash (empty if none of these): ")) |
|
|
except: |
|
|
|
|
|
|
|
|
except ValueError: |
|
|
index = 0 |
|
|
index = 0 |
|
|
if index < 0 or len(devices) < index: |
|
|
if index < 0 or len(devices) < index: |
|
|
print("Board number must be between 1 and %s\n" % str(len(devices))) |
|
|
print("Board number must be between 1 and %s\n" % str(len(devices))) |
|
@ -175,7 +175,7 @@ def input_board(): |
|
|
print() |
|
|
print() |
|
|
try: |
|
|
try: |
|
|
index = int(input("Choose the board type you want to flash: ")) |
|
|
index = int(input("Choose the board type you want to flash: ")) |
|
|
except: |
|
|
|
|
|
|
|
|
except ValueError: |
|
|
index = 0 |
|
|
index = 0 |
|
|
if index < 1 or len(boards) < index: |
|
|
if index < 1 or len(boards) < index: |
|
|
print("Board number must be between 1 and %s\n" % str(len(boards))) |
|
|
print("Board number must be between 1 and %s\n" % str(len(boards))) |
|
@ -186,17 +186,13 @@ def input_board(): |
|
|
if board.get('size', 0) == 0: |
|
|
if board.get('size', 0) == 0: |
|
|
try: |
|
|
try: |
|
|
board['size'] = int(input("Board memory size (1 for 1M, 4 for 4M): ")) |
|
|
board['size'] = int(input("Board memory size (1 for 1M, 4 for 4M): ")) |
|
|
except: |
|
|
|
|
|
|
|
|
except ValueError: |
|
|
print("Wrong memory size") |
|
|
print("Wrong memory size") |
|
|
return None |
|
|
return None |
|
|
|
|
|
|
|
|
# Choose IP of none before |
|
|
# Choose IP of none before |
|
|
if len(board.get('ip', '')) == 0: |
|
|
if len(board.get('ip', '')) == 0: |
|
|
try: |
|
|
|
|
|
board['ip'] = input("IP of the device to flash (empty for 192.168.4.1): ") or "192.168.4.1" |
|
|
|
|
|
except: |
|
|
|
|
|
print("Wrong IP") |
|
|
|
|
|
return None |
|
|
|
|
|
|
|
|
board['ip'] = input("IP of the device to flash (empty for 192.168.4.1): ") or "192.168.4.1" |
|
|
|
|
|
|
|
|
return board |
|
|
return board |
|
|
|
|
|
|
|
|