mirror of
https://github.com/g4klx/MMDVMHost.git
synced 2026-01-07 00:50:01 +01:00
Add proper exit code and success message
This commit is contained in:
parent
2b80ca7732
commit
6f3b581123
|
|
@ -85,23 +85,26 @@ def transferFile(ser, filename, fSize):
|
|||
if "\x05" in r:
|
||||
continue
|
||||
else:
|
||||
print
|
||||
return False
|
||||
break
|
||||
print
|
||||
return True
|
||||
|
||||
def upload(ser, filename, checkModel=None):
|
||||
if not getBaudrate(ser, os.path.getsize(filename), checkModel):
|
||||
print 'could not find baudrate'
|
||||
print 'Could not find baudrate'
|
||||
exit(1)
|
||||
|
||||
if not setDownloadBaudrate(ser, os.path.getsize(filename), 115200):
|
||||
print 'could not set download baudrate'
|
||||
print 'Could not set download baudrate'
|
||||
exit(1)
|
||||
|
||||
if not transferFile(ser, filename, os.path.getsize(filename)):
|
||||
print 'could not transfer file'
|
||||
print 'Could not transfer file'
|
||||
exit(1)
|
||||
|
||||
print 'File transferred successfully'
|
||||
exit(0)
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
|
|
|||
Loading…
Reference in a new issue