コード例 #1
0
def _check_passthrough_duplicates_section(yaml: Dict[str, Any]) -> None:
    # Any value already in the original dictionary must
    # not be specified in passthrough at the same time.
    if "passthrough" not in yaml:
        return

    passthrough = yaml["passthrough"]
    duplicates = list(yaml.keys() & passthrough.keys())
    if duplicates:
        raise meta_errors.AmbiguousPassthroughKeyError(duplicates)
コード例 #2
0
ファイル: _snap_packaging.py プロジェクト: stefanor/snapcraft
 def _apply_passthrough(
     self,
     section: Dict[str, Any],
     passthrough: Dict[str, Any],
     original: collections.OrderedDict,
 ) -> bool:
     # Any value already in the original dictionary must
     # not be specified in passthrough at the same time.
     duplicates = list(original.keys() & passthrough.keys())
     if duplicates:
         raise meta_errors.AmbiguousPassthroughKeyError(duplicates)
     section.update(passthrough)
     return bool(passthrough)