mirror of
https://gitee.com/xiaohuolufeihua/bizhang_-obav.git
synced 2026-05-21 01:12:11 +00:00
px_uploader.py remove special pyserial checks that fail on some platforms
This commit is contained in:
@@ -56,7 +56,6 @@ from __future__ import print_function
|
|||||||
import sys
|
import sys
|
||||||
import argparse
|
import argparse
|
||||||
import binascii
|
import binascii
|
||||||
import serial
|
|
||||||
import socket
|
import socket
|
||||||
import struct
|
import struct
|
||||||
import json
|
import json
|
||||||
@@ -68,6 +67,16 @@ import os
|
|||||||
|
|
||||||
from sys import platform as _platform
|
from sys import platform as _platform
|
||||||
|
|
||||||
|
try:
|
||||||
|
import serial
|
||||||
|
except ImportError as e:
|
||||||
|
print("Failed to import serial: " + str(e))
|
||||||
|
print("")
|
||||||
|
print("You may need to install it using:")
|
||||||
|
print(" pip3 install --user pyserial")
|
||||||
|
print("")
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
# Detect python version
|
# Detect python version
|
||||||
if sys.version_info[0] < 3:
|
if sys.version_info[0] < 3:
|
||||||
runningPython3 = False
|
runningPython3 = False
|
||||||
@@ -726,29 +735,6 @@ def main():
|
|||||||
print("WARNING: You should uninstall ModemManager as it conflicts with any non-modem serial device (like Pixhawk)")
|
print("WARNING: You should uninstall ModemManager as it conflicts with any non-modem serial device (like Pixhawk)")
|
||||||
print("==========================================================================================================")
|
print("==========================================================================================================")
|
||||||
|
|
||||||
# We need to check for pyserial because the import itself doesn't
|
|
||||||
# seem to fail, at least not on macOS.
|
|
||||||
pyserial_installed = False
|
|
||||||
try:
|
|
||||||
if serial.__version__:
|
|
||||||
pyserial_installed = True
|
|
||||||
except:
|
|
||||||
pass
|
|
||||||
|
|
||||||
try:
|
|
||||||
if serial.VERSION:
|
|
||||||
pyserial_installed = True
|
|
||||||
except:
|
|
||||||
pass
|
|
||||||
|
|
||||||
if not pyserial_installed:
|
|
||||||
print("Error: pyserial not installed!")
|
|
||||||
print("")
|
|
||||||
print("You may need to install it using:")
|
|
||||||
print(" pip3 install --user pyserial")
|
|
||||||
print("")
|
|
||||||
sys.exit(1)
|
|
||||||
|
|
||||||
# Load the firmware file
|
# Load the firmware file
|
||||||
fw = firmware(args.firmware)
|
fw = firmware(args.firmware)
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ pygments
|
|||||||
wheel>=0.31.1
|
wheel>=0.31.1
|
||||||
pymavlink
|
pymavlink
|
||||||
pyros-genmsg
|
pyros-genmsg
|
||||||
pyserial>=3.0
|
pyserial
|
||||||
pyulog>=0.5.0
|
pyulog>=0.5.0
|
||||||
pyyaml
|
pyyaml
|
||||||
requests
|
requests
|
||||||
|
|||||||
Reference in New Issue
Block a user