Skip to content

Commit

Permalink
build_parmaeters.py: not having a parameter file is not an error
Browse files Browse the repository at this point in the history
we're unable to generate many of these older parameter files due to problems within those trees
  • Loading branch information
peterbarker committed Jan 30, 2025
1 parent e1d1c94 commit 4cf8410
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions build_parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,17 +74,21 @@
}


def progress(str_to_print):
print(f"[build_parameters.py] {str_to_print}")


def debug(str_to_print):
"""Debug output if verbose is set."""
if args.verbose:
print("[build_parameters.py] " + str(str_to_print))
progress(str_to_print)


def error(str_to_print):
"""Show and count the errors."""
global error_count
error_count += 1
print("[build_parameters.py][error]: " + str(str_to_print))
progress("[error]: " + str(str_to_print))


def check_temp_folders():
Expand Down Expand Up @@ -116,9 +120,9 @@ def setup():
if args.single_vehicle in ALLVEHICLES:
global VEHICLES
VEHICLES = [args.single_vehicle]
print("[build_parameters.py] Running only for " + str(args.single_vehicle))
progress("Running only for " + str(args.single_vehicle))
else:
print("[build_parameters.py] Vehicle %s not recognized, running for all vehicles." % str(args.single_vehicle))
progress("Vehicle %s not recognized, running for all vehicles." % str(args.single_vehicle))

try:
# Goes to ardupilot folder and clean it and update to make sure that is the most recent one.
Expand Down Expand Up @@ -236,7 +240,7 @@ def fetch_commit_hash(version_link, board, file):
"""
fetch_link = version_link + '/' + board + '/' + file

print("Processing link...\t" + fetch_link)
progress("Processing link...\t" + fetch_link)

try:
fecth_response = ""
Expand Down Expand Up @@ -397,7 +401,10 @@ def replace_anchors(source_file, dest_file, version_tag):
os.remove("Parameters.rst")
debug("File " + filename + " generated. ")
else:
error("Parameters.rst not found to rename to %s" % filename)
# this was an error, but turns out we are missing a
# bunch of these, eg.
# [build_parameters.py][error]: Parameters.rst not found to rename to parameters-Copter-stable-V4.0.0.rst
progress("Parameters.rst not found to rename to %s" % filename)

os.chdir(BASEPATH)
except Exception as e:
Expand Down

0 comments on commit 4cf8410

Please sign in to comment.