Skip to content

Commit

Permalink
Simplify argument parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
ty-porter committed May 22, 2024
1 parent f645d26 commit 9ccdab5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,10 @@ def main(matrix, config_base):
logger = logging.getLogger("mlbled")
if config.debug:
logger.setLevel(logging.DEBUG)
RGBMatrixDriver.logger.setLevel(logging.DEBUG)
else:
logger.setLevel(logging.WARNING)
RGBMatrixDriver.logger.setLevel(logging.INFO)

# Print some basic info on startup
debug.info("%s - v%s (%sx%s)", SCRIPT_NAME, SCRIPT_VERSION, matrix.width, matrix.height)
Expand Down
4 changes: 2 additions & 2 deletions utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def split_string(string, num_chars):
return [(string[i : i + num_chars]).strip() for i in range(0, len(string), num_chars)] # noqa: E203

def scoreboard_args():
sb_parser = argparse.ArgumentParser(add_help=False)
sb_parser = RGBMatrixArguments()
sb_parser.add_argument(
"--config",
action="store",
Expand All @@ -23,7 +23,7 @@ def scoreboard_args():
type=str,
)

return RGBMatrixArguments(parents=[sb_parser]).parse_args()
return sb_parser.parse_args()

def deep_update(source, overrides):
"""Update a nested dictionary or similar mapping.
Expand Down

0 comments on commit 9ccdab5

Please sign in to comment.