Commit ed409cb9 authored by Matt Selsky's avatar Matt Selsky
Browse files

PEP8 cleanup

libntp/wscript:40:1: E101 indentation contains mixed spaces and tabs
libntp/wscript:40:1: W191 indentation contains tabs
libntp/wscript:41:1: E101 indentation contains mixed spaces and tabs
pylib/util.py:473:1: E302 expected 2 blank lines, found 1
pylib/util.py:489:39: W291 trailing whitespace
pylib/util.py:1059:5: E303 too many blank lines (2)
tests/pylib/test_agentx.py:94:1: W293 blank line contains whitespace
tests/pylib/test_agentx.py:1851:1: W293 blank line contains whitespace
wafhelpers/pythonize-header:30:32: E261 at least two spaces before inline comment
wscript:236:5: E265 block comment should start with '# '
parent 460fc0f5
Pipeline #10899999 passed with stages
in 9 minutes and 16 seconds
......@@ -37,7 +37,7 @@ def build(ctx):
"prettydate.c",
"statestr.c",
"systime.c",
"timespecops.c",
"timespecops.c",
"timetoa.c",
]
......
......@@ -470,6 +470,7 @@ def f8dot3(f):
# A hack to avoid repeatedly hammering on DNS when ntpmon runs.
canonicalization_cache = {}
def canonicalize_dns(inhost, family=socket.AF_UNSPEC):
"Canonicalize a hostname or numeric IP address."
TTL = 300
......@@ -486,7 +487,7 @@ def canonicalize_dns(inhost, family=socket.AF_UNSPEC):
ai = socket.getaddrinfo(hostname, None, family, 0, 0,
socket.AI_CANONNAME)
except socket.gaierror as e:
return "DNSFAIL:%s" % hostname
return "DNSFAIL:%s" % hostname
(family, socktype, proto, canonname, sockaddr) = ai[0]
try:
name = socket.getnameinfo(sockaddr, socket.NI_NAMEREQD)
......@@ -1055,7 +1056,6 @@ class MRUSummary:
header = " lstint avgint rstr r m v count rport remote address"
def summary(self, entry):
width = ntp.util.termsize().width - 1
last = ntp.ntpc.lfptofloat(entry.last)
......
......@@ -91,7 +91,7 @@ class TestNtpclientsNtpsnmpd(unittest.TestCase):
# PDU tests
#
def test_AgentXPDU(self):
# Test basic, without context
test = ntp.agentx.AgentXPDU(0, True, 1, 2, 3, context=extraData)
self.assertEqual(repr(test),
......@@ -1848,7 +1848,7 @@ class TestNtpclientsNtpsnmpd(unittest.TestCase):
"end": {"subids": (1, 2), "include": False}},
{"start": {"subids": (2, 3), "include": False},
"end": {"subids": (3, 4), "include": False}}))
def test_decode_searchrange_list_nullterm(self):
dec = ntp.agentx.decode_searchrange_list_nullterm
......
......@@ -27,7 +27,7 @@ patterns = (
skipstarters = ("struct", "union", "typedef struct", "typedef union")
skipender = re.compile("^}.*;") # Has to allow a structure attribute
skipender = re.compile("^}.*;") # Has to allow a structure attribute
skippers = (
re.compile(r"^#include"),
......
......@@ -233,7 +233,7 @@ def configure(ctx):
# We require some things that C99 doesn't enable, like pthreads.
# These flags get propagated to both the host and main parts of the build.
#
#_POSIX_C_SOURCE
# _POSIX_C_SOURCE
# If ==1, like _POSIX_SOURCE;
# if >=2 add IEEE Std 1003.2;
# if >=199309L, add IEEE Std 1003.1b-1993;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment