/
usr
/
lib
/
python3.9
/
site-packages
/
dns
/
/usr/lib/python3.9/site-packages/dns
mkdir
upload
Name
Size
Mode
Actions
dnssecalgs/
-
0755
rm
quic/
-
0755
rm
rdtypes/
-
0755
rm
__pycache__/
-
0755
rm
asyncbackend.py
2796
0644
edit
dl
rm
asyncquery.py
26850
0644
edit
dl
rm
asyncresolver.py
17852
0644
edit
dl
rm
dnssec.py
40693
0644
edit
dl
rm
dnssectypes.py
1799
0644
edit
dl
rm
e164.py
3978
0644
edit
dl
rm
edns.py
15263
0644
edit
dl
rm
entropy.py
4242
0644
edit
dl
rm
enum.py
3691
0644
edit
dl
rm
exception.py
5957
0644
edit
dl
rm
flags.py
2750
0644
edit
dl
rm
grange.py
2148
0644
edit
dl
rm
immutable.py
2017
0644
edit
dl
rm
inet.py
5772
0644
edit
dl
rm
ipv4.py
2552
0644
edit
dl
rm
ipv6.py
6600
0644
edit
dl
rm
message.py
65993
0644
edit
dl
rm
name.py
42672
0644
edit
dl
rm
namedict.py
4000
0644
edit
dl
rm
nameserver.py
9909
0644
edit
dl
rm
node.py
12663
0644
edit
dl
rm
opcode.py
2730
0644
edit
dl
rm
query.py
54832
0644
edit
dl
rm
rcode.py
4156
0644
edit
dl
rm
rdata.py
29456
0644
edit
dl
rm
rdataclass.py
2984
0644
edit
dl
rm
rdataset.py
16756
0644
edit
dl
rm
rdatatype.py
7339
0644
edit
dl
rm
renderer.py
11254
0644
edit
dl
rm
resolver.py
73552
0644
edit
dl
rm
reversename.py
3828
0644
edit
dl
rm
rrset.py
9170
0644
edit
dl
rm
serial.py
3606
0644
edit
dl
rm
set.py
9088
0644
edit
dl
rm
tokenizer.py
23583
0644
edit
dl
rm
transaction.py
22636
0644
edit
dl
rm
tsig.py
11413
0644
edit
dl
rm
tsigkeyring.py
2633
0644
edit
dl
rm
ttl.py
2979
0644
edit
dl
rm
update.py
12243
0644
edit
dl
rm
version.py
1926
0644
edit
dl
rm
versioned.py
11765
0644
edit
dl
rm
win32util.py
9107
0644
edit
dl
rm
wire.py
2830
0644
edit
dl
rm
xfr.py
13273
0644
edit
dl
rm
zone.py
52086
0644
edit
dl
rm
zonefile.py
27929
0644
edit
dl
rm
zonetypes.py
690
0644
edit
dl
rm
_asyncbackend.py
2360
0644
edit
dl
rm
_asyncio_backend.py
8971
0644
edit
dl
rm
_ddr.py
5247
0644
edit
dl
rm
_features.py
2384
0644
edit
dl
rm
_immutable_ctx.py
2459
0644
edit
dl
rm
__init__.py
1663
0644
edit
dl
rm
Edit:
/usr/lib/python3.9/site-packages/dns/grange.py
(2148B)
# Copyright (C) Dnspython Contributors, see LICENSE for text of ISC license # Copyright (C) 2012-2017 Nominum, Inc. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose with or without fee is hereby granted, # provided that the above copyright notice and this permission notice # appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" AND NOMINUM DISCLAIMS ALL WARRANTIES # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NOMINUM BE LIABLE FOR # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT # OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. """DNS GENERATE range conversion.""" from typing import Tuple import dns def from_text(text: str) -> Tuple[int, int, int]: """Convert the text form of a range in a ``$GENERATE`` statement to an integer. *text*, a ``str``, the textual range in ``$GENERATE`` form. Returns a tuple of three ``int`` values ``(start, stop, step)``. """ start = -1 stop = -1 step = 1 cur = "" state = 0 # state 0 1 2 # x - y / z if text and text[0] == "-": raise dns.exception.SyntaxError("Start cannot be a negative number") for c in text: if c == "-" and state == 0: start = int(cur) cur = "" state = 1 elif c == "/": stop = int(cur) cur = "" state = 2 elif c.isdigit(): cur += c else: raise dns.exception.SyntaxError("Could not parse %s" % (c)) if state == 0: raise dns.exception.SyntaxError("no stop value specified") elif state == 1: stop = int(cur) else: assert state == 2 step = int(cur) assert step >= 1 assert start >= 0 if start > stop: raise dns.exception.SyntaxError("start must be <= stop") return (start, stop, step)
Save
cmd:
run