(self, proto, *args)
| 512 | 'unknown_open', req) |
| 513 | |
| 514 | def error(self, proto, *args): |
| 515 | if proto in ('http', 'https'): |
| 516 | # XXX http[s] protocols are special-cased |
| 517 | dict = self.handle_error['http'] # https is not different than http |
| 518 | proto = args[2] # YUCK! |
| 519 | meth_name = 'http_error_%s' % proto |
| 520 | http_err = 1 |
| 521 | orig_args = args |
| 522 | else: |
| 523 | dict = self.handle_error |
| 524 | meth_name = proto + '_error' |
| 525 | http_err = 0 |
| 526 | args = (dict, proto, meth_name) + args |
| 527 | result = self._call_chain(*args) |
| 528 | if result: |
| 529 | return result |
| 530 | |
| 531 | if http_err: |
| 532 | args = (dict, 'default', 'http_error_default') + orig_args |
| 533 | return self._call_chain(*args) |
| 534 | |
| 535 | # XXX probably also want an abstract factory that knows when it makes |
| 536 | # sense to skip a superclass in favor of a subclass and when it might |
no test coverage detected