mirror of
https://github.com/g4klx/MMDVMHost.git
synced 2026-01-08 01:19:59 +01:00
Add check for correct model number of display
This commit is contained in:
parent
b85d702224
commit
3f6a34a8b5
|
|
@ -20,6 +20,7 @@ import serial
|
|||
import time
|
||||
import sys
|
||||
import os
|
||||
import re
|
||||
|
||||
e = "\xff\xff\xff"
|
||||
|
||||
|
|
@ -116,4 +117,8 @@ if __name__ == "__main__":
|
|||
checkModel = None
|
||||
if len(sys.argv) == 4:
|
||||
checkModel = sys.argv[3]
|
||||
pattern = re.compile("^NX\d{4}[TK]\d{3}$")
|
||||
if not pattern.match(checkModel):
|
||||
print 'Invalid model name. Please give a correct one (e.g. NX3224T024)'
|
||||
exit(1)
|
||||
upload(ser, sys.argv[1], checkModel)
|
||||
|
|
|
|||
Loading…
Reference in a new issue