mirror of https://github.com/ArduPilot/ardupilot
Tools: autotest: sim_vehicle.py flake8 compliance
This commit is contained in:
parent
9eea14054e
commit
6fc18792e4
|
@ -157,7 +157,7 @@ def cygwin_pidof(proc_name):
|
|||
if cmd == proc_name:
|
||||
try:
|
||||
pid = int(line_split[0].strip())
|
||||
except:
|
||||
except Exception as e:
|
||||
pid = int(line_split[1].strip())
|
||||
if pid not in pids:
|
||||
pids.append(pid)
|
||||
|
@ -393,7 +393,7 @@ def get_user_locations_path():
|
|||
|
||||
def find_new_spawn(loc, file_path):
|
||||
(lat, lon, alt, heading) = loc.split(",")
|
||||
swarminit_filepath = os.path.join(autotest, "swarminit.txt")
|
||||
swarminit_filepath = os.path.join(find_autotest_dir(), "swarminit.txt")
|
||||
for path2 in [file_path, swarminit_filepath]:
|
||||
if os.path.isfile(path2):
|
||||
with open(path2, 'r') as swd:
|
||||
|
@ -411,6 +411,7 @@ def find_new_spawn(loc, file_path):
|
|||
loc = str(g[0])+","+str(g[1])+","+str(alt)+","+str(heading)
|
||||
return loc
|
||||
|
||||
|
||||
def find_location_by_name(autotest, locname):
|
||||
"""Search locations.txt for locname, return GPS coords"""
|
||||
locations_userpath = os.environ.get('ARDUPILOT_LOCATIONS',
|
||||
|
|
Loading…
Reference in New Issue