Fixed: Most formats that needed layers didn't complain when ommited

This commit is contained in:
Salvador E. Tropea 2020-05-26 13:50:38 -03:00
parent 8aaa07c867
commit 103ef8b79e
2 changed files with 8 additions and 6 deletions

View File

@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed
- All pcbnew plot formats generated gerber job files
- Most formats that needed layers didn't complain when ommited
## [0.2.4] - 2020-05-19
### Changed

View File

@ -21,6 +21,12 @@ except ImportError: # pragma: no cover
sys.exit(misc.NO_YAML_MODULE)
# note - type IDs are strings form the _config_, not the internal
# strings used as enums (in plot_config)
ANY_LAYER = ['gerber', 'ps', 'svg', 'hpgl', 'pdf', 'dxf']
ANY_DRILL = ['excellon', 'gerb_drill']
class CfgReader(object):
def __init__(self):
pass
@ -147,11 +153,6 @@ class CfgYamlReader(CfgReader):
def _parse_out_opts(self, otype, options, name):
# note - type IDs are strings form the _config_, not the internal
# strings used as enums (in plot_config)
ANY_LAYER = ['gerber', 'ps', 'svg', 'hpgl', 'pdf', 'dxf']
ANY_DRILL = ['excellon', 'gerb_drill']
# mappings from YAML keys to type_option keys
MAPPINGS = [
{
@ -524,7 +525,7 @@ class CfgYamlReader(CfgReader):
try:
layers = o_obj['layers']
except KeyError:
if otype == 'pdf_pcb_print':
if otype == 'pdf_pcb_print' or otype in ANY_LAYER:
logger.error('You must specify the layers for `' + name +
'` ('+otype+')')
sys.exit(misc.EXIT_BAD_CONFIG)