mirror of
https://gitlab.nic.cz/knot/knot-dns.git
synced 2026-02-03 18:49:28 -05:00
22 lines
480 B
Python
22 lines
480 B
Python
#!/usr/bin/env python3
|
|
|
|
from yaml.scanner import Scanner
|
|
|
|
class KnotScanner(Scanner):
|
|
|
|
def __init__(self):
|
|
Scanner.__init__(self)
|
|
|
|
# Public methods.
|
|
|
|
def check_value(self):
|
|
# IPv6
|
|
if self.peek(1) == ':':
|
|
return False
|
|
return super().check_value()
|
|
|
|
def check_plain(self):
|
|
# IPv6 is also plain text
|
|
if self.peek() == ':' and self.peek(1) == ':':
|
|
return True
|
|
return super().check_plain()
|