| 420 | |
| 421 | |
| 422 | class AngleAddr(TokenList): |
| 423 | |
| 424 | token_type = 'angle-addr' |
| 425 | |
| 426 | @property |
| 427 | def local_part(self): |
| 428 | for x in self: |
| 429 | if x.token_type == 'addr-spec': |
| 430 | return x.local_part |
| 431 | |
| 432 | @property |
| 433 | def domain(self): |
| 434 | for x in self: |
| 435 | if x.token_type == 'addr-spec': |
| 436 | return x.domain |
| 437 | |
| 438 | @property |
| 439 | def route(self): |
| 440 | for x in self: |
| 441 | if x.token_type == 'obs-route': |
| 442 | return x.domains |
| 443 | |
| 444 | @property |
| 445 | def addr_spec(self): |
| 446 | for x in self: |
| 447 | if x.token_type == 'addr-spec': |
| 448 | if x.local_part: |
| 449 | return x.addr_spec |
| 450 | else: |
| 451 | return quote_string(x.local_part) + x.addr_spec |
| 452 | else: |
| 453 | return '<>' |
| 454 | |
| 455 | |
| 456 | class ObsRoute(TokenList): |