Compute the format for an object. Identical to parent's method but we pass extra parameters to the method. Unlike other _repr_*_ `_repr_mimebundle_` should allow extra kwargs, in particular `include` and `exclude`.
(self, obj, include=None, exclude=None)
| 948 | |
| 949 | @catch_format_error |
| 950 | def __call__(self, obj, include=None, exclude=None): |
| 951 | """Compute the format for an object. |
| 952 | |
| 953 | Identical to parent's method but we pass extra parameters to the method. |
| 954 | |
| 955 | Unlike other _repr_*_ `_repr_mimebundle_` should allow extra kwargs, in |
| 956 | particular `include` and `exclude`. |
| 957 | """ |
| 958 | if self.enabled: |
| 959 | # lookup registered printer |
| 960 | try: |
| 961 | printer = self.lookup(obj) |
| 962 | except KeyError: |
| 963 | pass |
| 964 | else: |
| 965 | return printer(obj) |
| 966 | # Finally look for special method names |
| 967 | method = get_real_method(obj, self.print_method) |
| 968 | |
| 969 | if method is not None: |
| 970 | return method(include=include, exclude=exclude) |
| 971 | return None |
| 972 | else: |
| 973 | return None |
| 974 | |
| 975 | |
| 976 | FormatterABC.register(BaseFormatter) |
nothing calls this directly
no test coverage detected