X7ROOT File Manager
Current Path:
/lib/python3.6/site-packages/dns
lib
/
python3.6
/
site-packages
/
dns
/
📁
..
📄
__init__.py
(1.3 KB)
📁
__pycache__
📄
_compat.py
(1.28 KB)
📄
dnssec.py
(14.44 KB)
📄
e164.py
(3.07 KB)
📄
edns.py
(4.28 KB)
📄
entropy.py
(4.36 KB)
📄
exception.py
(4.52 KB)
📄
flags.py
(2.6 KB)
📄
grange.py
(1.93 KB)
📄
hash.py
(1.07 KB)
📄
inet.py
(3.17 KB)
📄
ipv4.py
(1.98 KB)
📄
ipv6.py
(5.17 KB)
📄
message.py
(42.12 KB)
📄
name.py
(28.74 KB)
📄
namedict.py
(3.59 KB)
📄
node.py
(5.91 KB)
📄
opcode.py
(2.48 KB)
📄
query.py
(19.18 KB)
📄
rcode.py
(3.03 KB)
📄
rdata.py
(14.65 KB)
📄
rdataclass.py
(3.18 KB)
📄
rdataset.py
(11.29 KB)
📄
rdatatype.py
(5.21 KB)
📁
rdtypes
📄
renderer.py
(11.64 KB)
📄
resolver.py
(50.88 KB)
📄
reversename.py
(3.23 KB)
📄
rrset.py
(5.85 KB)
📄
set.py
(7.53 KB)
📄
tokenizer.py
(17.88 KB)
📄
tsig.py
(7.54 KB)
📄
tsigkeyring.py
(1.7 KB)
📄
ttl.py
(2.23 KB)
📄
update.py
(9.78 KB)
📄
version.py
(1.23 KB)
📄
wiredata.py
(3.64 KB)
📄
zone.py
(39.09 KB)
Editing: _compat.py
import sys import decimal from decimal import Context if sys.version_info > (3,): long = int xrange = range else: long = long # pylint: disable=long-builtin xrange = xrange # pylint: disable=xrange-builtin # unicode / binary types if sys.version_info > (3,): text_type = str binary_type = bytes string_types = (str,) unichr = chr def maybe_decode(x): return x.decode() def maybe_encode(x): return x.encode() else: text_type = unicode # pylint: disable=unicode-builtin, undefined-variable binary_type = str string_types = ( basestring, # pylint: disable=basestring-builtin, undefined-variable ) unichr = unichr # pylint: disable=unichr-builtin def maybe_decode(x): return x def maybe_encode(x): return x def round_py2_compat(what): """ Python 2 and Python 3 use different rounding strategies in round(). This function ensures that results are python2/3 compatible and backward compatible with previous py2 releases :param what: float :return: rounded long """ d = Context( prec=len(str(long(what))), # round to integer with max precision rounding=decimal.ROUND_HALF_UP ).create_decimal(str(what)) # str(): python 2.6 compat return long(d)
Upload File
Create Folder