Compute the format for an object.
(self, obj)
| 902 | |
| 903 | @catch_format_error |
| 904 | def __call__(self, obj): |
| 905 | """Compute the format for an object.""" |
| 906 | if self.enabled: |
| 907 | # lookup registered printer |
| 908 | try: |
| 909 | printer = self.lookup(obj) |
| 910 | except KeyError: |
| 911 | pass |
| 912 | else: |
| 913 | printer(obj) |
| 914 | return True |
| 915 | # Finally look for special method names |
| 916 | method = get_real_method(obj, self.print_method) |
| 917 | if method is not None: |
| 918 | method() |
| 919 | return True |
| 920 | |
| 921 | |
| 922 | class MimeBundleFormatter(BaseFormatter): |
nothing calls this directly
no test coverage detected