from sys import exit from .misc import (EXIT_BAD_ARGS) from .log import (get_logger) logger = get_logger(__name__) class GS(object): """ Class to keep the global settings. Is a static class, just a placeholder for some global variables. """ pcb_file = None sch_file = None out_dir = None filter_file = None debug_enabled = False @staticmethod def check_pcb(): if not GS.pcb_file: logger.error('No PCB file found (*.kicad_pcb), use -b to specify one.') exit(EXIT_BAD_ARGS) @staticmethod def check_sch(): if not GS.sch_file: logger.error('No SCH file found (*.sch), use -e to specify one.') exit(EXIT_BAD_ARGS)