(
self,
arg_vars, # type: Optional[Dict[str,Any]]
*options # type: OptionsBase
)
| 1872 | |
| 1873 | class Forwarder(metaclass=ABCMeta): |
| 1874 | def forward_args( |
| 1875 | self, |
| 1876 | arg_vars, # type: Optional[Dict[str,Any]] |
| 1877 | *options # type: OptionsBase |
| 1878 | ): |
| 1879 | # type: (...) -> OptionsBase[str,Any] |
| 1880 | arg_vars = copy.copy(arg_vars) if arg_vars else {} |
| 1881 | temp_options = ( |
| 1882 | copy.copy( |
| 1883 | options[0]) if ( |
| 1884 | options and options[0]) else OptionsBase()) |
| 1885 | kwargs = arg_vars.pop("kwargs", {}) |
| 1886 | temp_options.update(kwargs) |
| 1887 | temp_options.update(arg_vars) |
| 1888 | |
| 1889 | end_options = {} |
| 1890 | for k, v in temp_options.items(): |
| 1891 | map_item = self.arg_mapping().get(k, None) |
| 1892 | if not (map_item is None): |
| 1893 | for out_k, out_f in map_item.items(): |
| 1894 | converted = out_f(v) |
| 1895 | if converted is not None: |
| 1896 | end_options[out_k] = converted |
| 1897 | else: |
| 1898 | end_options[k] = v |
| 1899 | return end_options |
| 1900 | |
| 1901 | @abstractmethod |
| 1902 | def arg_mapping(self): |
nothing calls this directly
no test coverage detected