mirror of
https://github.com/pablorevilla-meshtastic/meshview.git
synced 2026-06-12 10:15:02 +02:00
e25ff22127
Configure Ruff as the code formatter and linter with pre-commit hooks. Applied automatic formatting fixes across the entire codebase including: - Import sorting and organization - Code style consistency (spacing, line breaks, indentation) - String quote normalization - Removal of trailing whitespace and unnecessary blank lines
17 lines
600 B
Python
17 lines
600 B
Python
import argparse
|
|
import configparser
|
|
|
|
# Parse command-line arguments
|
|
parser = argparse.ArgumentParser(description="MeshView Configuration Loader")
|
|
parser.add_argument(
|
|
"--config", type=str, default="config.ini", help="Path to config.ini file (default: config.ini)"
|
|
)
|
|
args = parser.parse_args()
|
|
|
|
# Initialize config parser
|
|
config_parser = configparser.ConfigParser()
|
|
if not config_parser.read(args.config):
|
|
raise FileNotFoundError(f"Config file '{args.config}' not found! Ensure the file exists.")
|
|
|
|
CONFIG = {section: dict(config_parser.items(section)) for section in config_parser.sections()}
|