Compute the format for an object.
(self, obj)
| 968 | |
| 969 | @catch_format_error |
| 970 | def __call__(self, obj): |
| 971 | """Compute the format for an object.""" |
| 972 | if self.enabled: |
| 973 | # lookup registered printer |
| 974 | try: |
| 975 | printer = self.lookup(obj) |
| 976 | except KeyError: |
| 977 | pass |
| 978 | else: |
| 979 | printer(obj) |
| 980 | return True |
| 981 | # Finally look for special method names |
| 982 | method = get_real_method(obj, self.print_method) |
| 983 | if method is not None: |
| 984 | method() |
| 985 | return True |
| 986 | |
| 987 | |
| 988 | class MimeBundleFormatter(BaseFormatter): |
nothing calls this directly
no test coverage detected