Process one line from the text format question section.
(self, section_number)
| 1494 | self.tok.get_eol() |
| 1495 | |
| 1496 | def _question_line(self, section_number): |
| 1497 | """Process one line from the text format question section.""" |
| 1498 | |
| 1499 | assert self.message is not None |
| 1500 | section = self.message.sections[section_number] |
| 1501 | token = self.tok.get(want_leading=True) |
| 1502 | if not token.is_whitespace(): |
| 1503 | self.last_name = self.tok.as_name( |
| 1504 | token, self.message.origin, self.relativize, self.relativize_to |
| 1505 | ) |
| 1506 | name = self.last_name |
| 1507 | if name is None: |
| 1508 | raise NoPreviousName |
| 1509 | token = self.tok.get() |
| 1510 | if not token.is_identifier(): |
| 1511 | raise dns.exception.SyntaxError |
| 1512 | # Class |
| 1513 | try: |
| 1514 | rdclass = dns.rdataclass.from_text(token.value) |
| 1515 | token = self.tok.get() |
| 1516 | if not token.is_identifier(): |
| 1517 | raise dns.exception.SyntaxError |
| 1518 | except dns.exception.SyntaxError: |
| 1519 | raise dns.exception.SyntaxError |
| 1520 | except Exception: |
| 1521 | rdclass = dns.rdataclass.IN |
| 1522 | # Type |
| 1523 | rdtype = dns.rdatatype.from_text(token.value) |
| 1524 | (rdclass, rdtype, _, _) = self.message._parse_rr_header( |
| 1525 | section_number, name, rdclass, rdtype |
| 1526 | ) |
| 1527 | self.message.find_rrset( |
| 1528 | section, name, rdclass, rdtype, create=True, force_unique=True |
| 1529 | ) |
| 1530 | self.tok.get_eol() |
| 1531 | |
| 1532 | def _rr_line(self, section_number): |
| 1533 | """Process one line from the text format answer, authority, or |
nothing calls this directly
no test coverage detected