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