mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-15 04:03:33 +08:00
Tools: use Python 3, improve import checks
In more detail: - Change shebang to Python 3. - Suggest installation using pip3 as user.
This commit is contained in:
@@ -8,6 +8,7 @@ import codecs
|
||||
import re
|
||||
import colorsys
|
||||
import json
|
||||
import sys
|
||||
|
||||
|
||||
parser = argparse.ArgumentParser(
|
||||
@@ -609,11 +610,13 @@ if args.output == 'json':
|
||||
elif args.output == 'graphviz':
|
||||
try:
|
||||
from graphviz import Digraph
|
||||
except:
|
||||
print("Failed to import graphviz.")
|
||||
print("You may need to install it with 'pip install graphviz'")
|
||||
except ImportError as e:
|
||||
print("Failed to import graphviz: " + e)
|
||||
print("")
|
||||
raise
|
||||
print("You may need to install it with:")
|
||||
print(" pip3 install --user graphviz")
|
||||
print("")
|
||||
sys.exit(1)
|
||||
output_graphviz = OutputGraphviz(graph)
|
||||
engine='fdp' # use neato or fdp
|
||||
output_graphviz.write(args.file+'.fv', engine=engine)
|
||||
|
||||
Reference in New Issue
Block a user