mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-06 05:01:14 -07:00
Bump dnspython from 2.2.1 to 2.3.0 (#1975)
* Bump dnspython from 2.2.1 to 2.3.0 Bumps [dnspython](https://github.com/rthalley/dnspython) from 2.2.1 to 2.3.0. - [Release notes](https://github.com/rthalley/dnspython/releases) - [Changelog](https://github.com/rthalley/dnspython/blob/master/doc/whatsnew.rst) - [Commits](https://github.com/rthalley/dnspython/compare/v2.2.1...v2.3.0) --- updated-dependencies: - dependency-name: dnspython dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * Update dnspython==2.3.0 --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: JonnyWong16 <9099342+JonnyWong16@users.noreply.github.com> [skip ci]
This commit is contained in:
parent
6910079330
commit
32c06a8b72
137 changed files with 7699 additions and 4277 deletions
|
@ -20,6 +20,7 @@
|
|||
import dns.enum
|
||||
import dns.exception
|
||||
|
||||
|
||||
class Opcode(dns.enum.IntEnum):
|
||||
#: Query
|
||||
QUERY = 0
|
||||
|
@ -45,7 +46,7 @@ class UnknownOpcode(dns.exception.DNSException):
|
|||
"""An DNS opcode is unknown."""
|
||||
|
||||
|
||||
def from_text(text):
|
||||
def from_text(text: str) -> Opcode:
|
||||
"""Convert text into an opcode.
|
||||
|
||||
*text*, a ``str``, the textual opcode
|
||||
|
@ -58,7 +59,7 @@ def from_text(text):
|
|||
return Opcode.from_text(text)
|
||||
|
||||
|
||||
def from_flags(flags):
|
||||
def from_flags(flags: int) -> Opcode:
|
||||
"""Extract an opcode from DNS message flags.
|
||||
|
||||
*flags*, an ``int``, the DNS flags.
|
||||
|
@ -66,10 +67,10 @@ def from_flags(flags):
|
|||
Returns an ``int``.
|
||||
"""
|
||||
|
||||
return (flags & 0x7800) >> 11
|
||||
return Opcode((flags & 0x7800) >> 11)
|
||||
|
||||
|
||||
def to_flags(value):
|
||||
def to_flags(value: Opcode) -> int:
|
||||
"""Convert an opcode to a value suitable for ORing into DNS message
|
||||
flags.
|
||||
|
||||
|
@ -81,7 +82,7 @@ def to_flags(value):
|
|||
return (value << 11) & 0x7800
|
||||
|
||||
|
||||
def to_text(value):
|
||||
def to_text(value: Opcode) -> str:
|
||||
"""Convert an opcode to text.
|
||||
|
||||
*value*, an ``int`` the opcode value,
|
||||
|
@ -94,7 +95,7 @@ def to_text(value):
|
|||
return Opcode.to_text(value)
|
||||
|
||||
|
||||
def is_update(flags):
|
||||
def is_update(flags: int) -> bool:
|
||||
"""Is the opcode in flags UPDATE?
|
||||
|
||||
*flags*, an ``int``, the DNS message flags.
|
||||
|
@ -104,6 +105,7 @@ def is_update(flags):
|
|||
|
||||
return from_flags(flags) == Opcode.UPDATE
|
||||
|
||||
|
||||
### BEGIN generated Opcode constants
|
||||
|
||||
QUERY = Opcode.QUERY
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue