update self.config from a flag, which can be a dict or Config
(self, cfg: t.Any)
| 692 | return |
| 693 | |
| 694 | def _load_flag(self, cfg: t.Any) -> None: |
| 695 | """update self.config from a flag, which can be a dict or Config""" |
| 696 | if isinstance(cfg, (dict, Config)): |
| 697 | # don't clobber whole config sections, update |
| 698 | # each section from config: |
| 699 | for sec, c in cfg.items(): |
| 700 | self.config[sec].update(c) |
| 701 | else: |
| 702 | raise TypeError("Invalid flag: %r" % cfg) |
| 703 | |
| 704 | |
| 705 | # match --Class.trait keys for argparse |
no test coverage detected