[Git][NTPsec/ntpsec][master] PEP8 cleanup
Matt Selsky
gitlab at mg.gitlab.com
Wed Aug 16 03:37:09 UTC 2017
Matt Selsky pushed to branch master at NTPsec / ntpsec
Commits:
ed409cb9 by Matt Selsky at 2017-08-15T23:23:07-04:00
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 '# '
- - - - -
5 changed files:
- libntp/wscript
- pylib/util.py
- tests/pylib/test_agentx.py
- wafhelpers/pythonize-header
- wscript
Changes:
=====================================
libntp/wscript
=====================================
--- a/libntp/wscript
+++ b/libntp/wscript
@@ -37,7 +37,7 @@ def build(ctx):
"prettydate.c",
"statestr.c",
"systime.c",
- "timespecops.c",
+ "timespecops.c",
"timetoa.c",
]
=====================================
pylib/util.py
=====================================
--- a/pylib/util.py
+++ b/pylib/util.py
@@ -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)
=====================================
tests/pylib/test_agentx.py
=====================================
--- a/tests/pylib/test_agentx.py
+++ b/tests/pylib/test_agentx.py
@@ -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
=====================================
wafhelpers/pythonize-header
=====================================
--- a/wafhelpers/pythonize-header
+++ b/wafhelpers/pythonize-header
@@ -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"),
=====================================
wscript
=====================================
--- a/wscript
+++ b/wscript
@@ -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;
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/ed409cb9ee9e0c0e92c279c7111b20cc2866a0c2
---
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/ed409cb9ee9e0c0e92c279c7111b20cc2866a0c2
You're receiving this email because of your account on gitlab.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ntpsec.org/pipermail/vc/attachments/20170816/57bd3b7e/attachment.html>
More information about the vc
mailing list