Use semantic versioning
and more standard constant names
This commit is contained in:
parent
21944596fb
commit
bde3263cfa
10
dnseval.py
10
dnseval.py
@ -38,15 +38,17 @@ from statistics import stdev
|
|||||||
import dns.rdatatype
|
import dns.rdatatype
|
||||||
import dns.resolver
|
import dns.resolver
|
||||||
|
|
||||||
__VERSION__ = 1.6
|
__author__ = 'Babak Farrokhi (babak@farrokhi.net)'
|
||||||
__PROGNAME__ = os.path.basename(sys.argv[0])
|
__license__ = 'BSD'
|
||||||
|
__version__ = "1.6.0"
|
||||||
|
__progname__ = os.path.basename(sys.argv[0])
|
||||||
shutdown = False
|
shutdown = False
|
||||||
|
|
||||||
resolvers = dns.resolver.get_default_resolver().nameservers
|
resolvers = dns.resolver.get_default_resolver().nameservers
|
||||||
|
|
||||||
|
|
||||||
def usage():
|
def usage():
|
||||||
print("""%s version %1.1f
|
print("""%s version %s
|
||||||
|
|
||||||
usage: %s [-h] [-f server-list] [-c count] [-t type] [-w wait] hostname
|
usage: %s [-h] [-f server-list] [-c count] [-t type] [-w wait] hostname
|
||||||
-h --help show this help
|
-h --help show this help
|
||||||
@ -57,7 +59,7 @@ usage: %s [-h] [-f server-list] [-c count] [-t type] [-w wait] hostname
|
|||||||
-T --tcp Use TCP instead of UDP
|
-T --tcp Use TCP instead of UDP
|
||||||
-e --edns Disable EDNS0 (Default: Enabled)
|
-e --edns Disable EDNS0 (Default: Enabled)
|
||||||
-v --verbose Print actual dns response
|
-v --verbose Print actual dns response
|
||||||
""" % (__PROGNAME__, __VERSION__, __PROGNAME__))
|
""" % (__progname__, __version__, __progname__))
|
||||||
sys.exit()
|
sys.exit()
|
||||||
|
|
||||||
|
|
||||||
|
12
dnsping.py
12
dnsping.py
@ -38,13 +38,15 @@ import dns.flags
|
|||||||
import dns.rdatatype
|
import dns.rdatatype
|
||||||
import dns.resolver
|
import dns.resolver
|
||||||
|
|
||||||
__VERSION__ = 1.6
|
__author__ = 'Babak Farrokhi (babak@farrokhi.net)'
|
||||||
__PROGNAME__ = os.path.basename(sys.argv[0])
|
__license__ = 'BSD'
|
||||||
|
__version__ = "1.6.0"
|
||||||
|
__progname__ = os.path.basename(sys.argv[0])
|
||||||
shutdown = False
|
shutdown = False
|
||||||
|
|
||||||
|
|
||||||
def usage():
|
def usage():
|
||||||
print("""%s version %1.1f
|
print("""%s version %s
|
||||||
usage: %s [-ehqv] [-s server] [-p port] [-P port] [-S address] [-c count] [-t type] [-w wait] hostname
|
usage: %s [-ehqv] [-s server] [-p port] [-P port] [-S address] [-c count] [-t type] [-w wait] hostname
|
||||||
-h --help Show this help
|
-h --help Show this help
|
||||||
-q --quiet Quiet
|
-q --quiet Quiet
|
||||||
@ -61,7 +63,7 @@ usage: %s [-ehqv] [-s server] [-p port] [-P port] [-S address] [-c count] [-t ty
|
|||||||
-i --interval Time between each request (default: 0 seconds)
|
-i --interval Time between each request (default: 0 seconds)
|
||||||
-t --type DNS request record type (default: A)
|
-t --type DNS request record type (default: A)
|
||||||
-e --edns Disable EDNS0 (default: Enabled)
|
-e --edns Disable EDNS0 (default: Enabled)
|
||||||
""" % (__PROGNAME__, __VERSION__, __PROGNAME__))
|
""" % (__progname__, __version__, __progname__))
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
|
|
||||||
|
|
||||||
@ -172,7 +174,7 @@ def main():
|
|||||||
response_time = []
|
response_time = []
|
||||||
i = 0
|
i = 0
|
||||||
|
|
||||||
print("%s DNS: %s:%d, hostname: %s, rdatatype: %s" % (__PROGNAME__, dnsserver, dst_port, hostname, dnsrecord))
|
print("%s DNS: %s:%d, hostname: %s, rdatatype: %s" % (__progname__, dnsserver, dst_port, hostname, dnsrecord))
|
||||||
|
|
||||||
for i in range(count):
|
for i in range(count):
|
||||||
if shutdown:
|
if shutdown:
|
||||||
|
@ -43,7 +43,7 @@ from cymruwhois import cymruwhois
|
|||||||
|
|
||||||
__author__ = 'Babak Farrokhi (babak@farrokhi.net)'
|
__author__ = 'Babak Farrokhi (babak@farrokhi.net)'
|
||||||
__license__ = 'BSD'
|
__license__ = 'BSD'
|
||||||
__version__ = 1.6
|
__version__ = "1.6.0"
|
||||||
_ttl = None
|
_ttl = None
|
||||||
quiet = False
|
quiet = False
|
||||||
|
|
||||||
@ -65,7 +65,7 @@ def test_import():
|
|||||||
|
|
||||||
|
|
||||||
# Constants
|
# Constants
|
||||||
__PROGNAME__ = os.path.basename(sys.argv[0])
|
__progname__ = os.path.basename(sys.argv[0])
|
||||||
WHOIS_CACHE = 'whois.cache'
|
WHOIS_CACHE = 'whois.cache'
|
||||||
|
|
||||||
|
|
||||||
@ -117,8 +117,8 @@ except IOError:
|
|||||||
|
|
||||||
|
|
||||||
def usage():
|
def usage():
|
||||||
print('%s version %1.1f\n' % (__PROGNAME__, __version__))
|
print('%s version %s\n' % (__progname__, __version__))
|
||||||
print('usage: %s [-aeqhCx] [-s server] [-p port] [-c count] [-t type] [-w wait] hostname' % __PROGNAME__)
|
print('usage: %s [-aeqhCx] [-s server] [-p port] [-c count] [-t type] [-w wait] hostname' % __progname__)
|
||||||
print(' -h --help Show this help')
|
print(' -h --help Show this help')
|
||||||
print(' -q --quiet Quiet')
|
print(' -q --quiet Quiet')
|
||||||
print(' -x --expert Print expert hints if available')
|
print(' -x --expert Print expert hints if available')
|
||||||
@ -303,7 +303,7 @@ def main():
|
|||||||
trace_path = []
|
trace_path = []
|
||||||
|
|
||||||
if not quiet:
|
if not quiet:
|
||||||
print("%s DNS: %s:%d, hostname: %s, rdatatype: %s" % (__PROGNAME__, dnsserver, dest_port, hostname, dnsrecord),
|
print("%s DNS: %s:%d, hostname: %s, rdatatype: %s" % (__progname__, dnsserver, dest_port, hostname, dnsrecord),
|
||||||
flush=True)
|
flush=True)
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user