Added information log about what's going on and -q to supress it.

This commit is contained in:
Salvador E. Tropea 2020-03-13 14:13:40 -03:00
parent f1c85dbdba
commit f96f6c61d0
3 changed files with 11 additions and 3 deletions

View File

@ -16,8 +16,11 @@ def main():
parser = argparse.ArgumentParser(
description='Command-line Plotting for KiCad')
parser.add_argument('-v', '--verbose', action='store_true',
group = parser.add_mutually_exclusive_group()
group.add_argument('-v', '--verbose', action='store_true',
help='show debugging information')
group.add_argument('-q', '--quiet', action='store_true',
help='remove information logs')
parser.add_argument('-b', '--board-file', required=True,
help='The PCB .kicad-pcb board file')
parser.add_argument('-c', '--plot-config', required=True,
@ -27,7 +30,11 @@ def main():
args = parser.parse_args()
log_level = logging.DEBUG if args.verbose else logging.INFO
log_level = logging.INFO
if args.verbose:
log_level = logging.DEBUG
if args.quiet:
log_level = logging.WARNING
logging.basicConfig(level=log_level)
if not os.path.isfile(args.board_file):

View File

@ -401,7 +401,7 @@ class CfgYamlReader(CfgReader):
raise self.YamlError("Output needs a name")
try:
desc = o_obj['description']
desc = o_obj['comment']
except KeyError:
desc = None

View File

@ -41,6 +41,7 @@ class Plotter(object):
for op in self.cfg.outputs:
logging.debug("Processing output: {}".format(op.name))
logging.info('- %s (%s)' % (op.description,op.name))
# fresh plot controller
pc = pcbnew.PLOT_CONTROLLER(board)