[Git][NTPsec/ntpsec][master] 5 commits: waf: pep8 fixes pythonize-header
Gary E. Miller
gitlab at mg.gitlab.com
Sat May 6 20:43:07 UTC 2017
Gary E. Miller pushed to branch master at NTPsec / ntpsec
Commits:
fa95bdc5 by Gary E. Miller at 2017-05-06T13:22:32-07:00
waf: pep8 fixes pythonize-header
- - - - -
e8fed58c by Gary E. Miller at 2017-05-06T13:24:44-07:00
waf: fix minor pep8 nits.
- - - - -
ebb1f2d2 by Gary E. Miller at 2017-05-06T13:30:01-07:00
waf: minor pep8 fixes in wscript's.
- - - - -
206042b6 by Gary E. Miller at 2017-05-06T13:37:36-07:00
waf: several minor pep8 fixes in wscript's.
- - - - -
ed969508 by Gary E. Miller at 2017-05-06T13:41:08-07:00
ntpviz: minor pep8 tweaks
- - - - -
9 changed files:
- docs/wscript
- ntpclients/ntpviz
- ntpd/wscript
- pylib/wscript
- tests/wscript
- wafhelpers/check_cap.py
- wafhelpers/check_pthread.py
- wafhelpers/pythonize-header
- wscript
Changes:
=====================================
docs/wscript
=====================================
--- a/docs/wscript
+++ b/docs/wscript
@@ -35,6 +35,6 @@ def build(ctx):
)
# Install HTML
- ctx.install_files('${HTMLDIR}', extra
- + [x.change_ext(".html").name for x in doc_source])
+ ctx.install_files('${HTMLDIR}', extra +
+ [x.change_ext(".html").name for x in doc_source])
ctx.install_files('${HTMLDIR}', image_source, relative_trick=True)
=====================================
ntpclients/ntpviz
=====================================
--- a/ntpclients/ntpviz
+++ b/ntpclients/ntpviz
@@ -497,8 +497,8 @@ file.</p>
"""
- ret = {'html': VizStats.table_head + stats.table
- + stats_f.table + VizStats.table_tail + exp,
+ ret = {'html': VizStats.table_head + stats.table +
+ stats_f.table + VizStats.table_tail + exp,
'plot': plot_template + plot_data + plot_data,
'stats': [stats, stats_f],
'title': "Local Clock Time/Frequency Offsets"}
@@ -589,8 +589,8 @@ file, and field 3 from the temp log .</p>
"""
- ret = {'html': VizStats.table_head + stats_f.table
- + table + VizStats.table_tail + exp,
+ ret = {'html': VizStats.table_head + stats_f.table +
+ table + VizStats.table_tail + exp,
'plot': plot_template + plot_data + plot_data_t,
'stats': stats,
'title': "Local Frequency/Temp"}
@@ -732,8 +732,8 @@ than 20. 1 denotes the highest possible confidence level. 2 to 5 is good.
Greater than 20 means there will be significant inaccuracy and error.</p>
"""
- ret = {'html': VizStats.table_head + stats.table
- + stats_tdop.table + VizStats.table_tail + exp,
+ ret = {'html': VizStats.table_head + stats.table +
+ stats_tdop.table + VizStats.table_tail + exp,
'stats': [stats, stats_tdop],
'title': "Local GPS",
'plot': plot_template + plot_data + plot_data}
@@ -790,8 +790,8 @@ line at 0ppm. Expected values of 99%-1% percentiles: 0.4ppm</p>
<p>The Frequency Offset comes from field 4 of the loopstats log file.</p>
"""
- ret = {'html': VizStats.table_head + stats.table
- + VizStats.table_tail + exp,
+ ret = {'html': VizStats.table_head + stats.table +
+ VizStats.table_tail + exp,
'plot': plot_template + plot_data,
'stats': [stats],
'title': "Local Clock Frequency Offset"}
@@ -857,8 +857,8 @@ plot \
%(p1)s title "1st percentile"
""" % out
- ret = {'html': VizStats.table_head + stats.table
- + VizStats.table_tail + exp,
+ ret = {'html': VizStats.table_head + stats.table +
+ VizStats.table_tail + exp,
'plot': plot_template + plot_data,
'stats': [stats],
'title': title}
@@ -1189,8 +1189,8 @@ plot \
<p>The Local Clock Offset is field 3 from the loopstats log file.</p>
"""
# don't return stats, it's just a dupe
- ret = {'html': VizStats.table_head + stats.table
- + VizStats.table_tail + exp,
+ ret = {'html': VizStats.table_head + stats.table +
+ VizStats.table_tail + exp,
'plot': plot_template + "".join(histogram_data) + "e\n",
'stats': [],
'title': "Local Clock Time Offset Histogram"}
=====================================
ntpd/wscript
=====================================
--- a/ntpd/wscript
+++ b/ntpd/wscript
@@ -19,7 +19,8 @@ def build(ctx):
ctx(
cwd=srcnode,
- rule='VCS_EXTRA=`cat ${SRC[0]}` wafhelpers/autorevision.sh -o ${TGT[1].abspath()} -e VERSION -t h >${TGT[0].abspath()}',
+ rule='VCS_EXTRA=`cat ${SRC[0]}` wafhelpers/autorevision.sh '
+ '-o ${TGT[1].abspath()} -e VERSION -t h >${TGT[0].abspath()}',
source=["../VERSION", '../wafhelpers/autorevision.sh'],
target=[target3, target4],
)
=====================================
pylib/wscript
=====================================
--- a/pylib/wscript
+++ b/pylib/wscript
@@ -35,7 +35,8 @@ def build(ctx):
ctx(
before=['pyc', 'pyo'],
cwd=srcnode,
- rule='VCS_EXTRA=`cat ${SRC[0]}` ../wafhelpers/autorevision.sh -o ${TGT[1].abspath()} -e VERSION -t python >${TGT[0].name}',
+ rule='VCS_EXTRA=`cat ${SRC[0]}` ../wafhelpers/autorevision.sh '
+ '-o ${TGT[1].abspath()} -e VERSION -t python >${TGT[0].name}',
source=["../VERSION", '../wafhelpers/autorevision.sh'],
target=[target3, target4],
)
=====================================
tests/wscript
=====================================
--- a/tests/wscript
+++ b/tests/wscript
@@ -7,7 +7,7 @@ def build(ctx):
"unity/unity_fixture.c",
]
- unity_config = ["UNITY_INCLUDE_DOUBLE","UNITY_SUPPORT_64"]
+ unity_config = ["UNITY_INCLUDE_DOUBLE", "UNITY_SUPPORT_64"]
ctx(
defines=unity_config,
@@ -77,7 +77,7 @@ def build(ctx):
includes=["%s/tests/unity/" % srcnode,
"%s/tests/libparse/" % srcnode,
"%s/tests/common/" % srcnode
- ] + ctx.env.PLATFORM_INCLUDES,
+ ] + ctx.env.PLATFORM_INCLUDES,
install_path=None,
lib=["parse"],
libpath=["libparse"],
@@ -87,7 +87,7 @@ def build(ctx):
)
ntpd_source = [
-# "ntpd/filegen.c",
+ # "ntpd/filegen.c",
"ntpd/leapsec.c",
"ntpd/restrict.c",
] + common_source
=====================================
wafhelpers/check_cap.py
=====================================
--- a/wafhelpers/check_cap.py
+++ b/wafhelpers/check_cap.py
@@ -12,8 +12,8 @@ def check_cap(ctx):
ctx.check_cc(header_name="sys/capability.h", mandatory=False)
ctx.check_cc(lib="cap", comment="Capability library", mandatory=False)
- if ((ctx.get_define("HAVE_SYS_CAPABILITY_H")
- and ctx.get_define("HAVE_SYS_PRCTL_H") and ctx.env.LIB_CAP)):
+ if ((ctx.get_define("HAVE_SYS_CAPABILITY_H") and
+ ctx.get_define("HAVE_SYS_PRCTL_H") and ctx.env.LIB_CAP)):
ctx.define("HAVE_LINUX_CAPABILITY", 1)
else:
pprint("RED", "Warning libcap and headers not installed")
=====================================
wafhelpers/check_pthread.py
=====================================
--- a/wafhelpers/check_pthread.py
+++ b/wafhelpers/check_pthread.py
@@ -21,8 +21,8 @@ def check_pthread_header_lib(ctx):
ctx.check_cc(lib="thr", mandatory=False,
comment="thr library, required by some operating systems.")
- if ((ctx.get_define("HAVE_PTHREAD_H")
- and (ctx.env.LIB_PTHREAD or ctx.env.LIB_THR))):
+ if ((ctx.get_define("HAVE_PTHREAD_H") and
+ (ctx.env.LIB_PTHREAD or ctx.env.LIB_THR))):
ctx.env.PTHREAD_HEADER_LIB = True
=====================================
wafhelpers/pythonize-header
=====================================
--- a/wafhelpers/pythonize-header
+++ b/wafhelpers/pythonize-header
@@ -12,28 +12,30 @@ Yes, SWIG can do something like this. But it's heavyweight and would introduce
another dependency.
"""
-import sys, re
+import re
+import sys
patterns = (
(re.compile(r"/\*(.*)\*/"), r"#\1"),
(re.compile(r"^/\*"), r"#"),
(re.compile(r"^ *\*/"), r"#"),
(re.compile(r"^ \*"), r"#"),
- (re.compile(r"^#define\s+([A-Za-z0-9_]+[ \t]+)(.*)"), r"\1= \2"),
+ (re.compile(r"^#define\s+([A-Za-z0-9_]+[ \t]+)(.*)"), r"\1= \2"),
(re.compile(r"^#define\s+([A-Za-z0-9_]+)\(([a-z_, ]*)\)"),
- r"def \1(\2): return"),
+ r"def \1(\2): return"),
)
skipstarters = ("struct", "union", "typedef struct", "typedef union")
skippers = (
- re.compile(r"^#include"),
- re.compile(r"^typedef.*;\s*$"),
- re.compile(r"^extern.*;\d*$"),
+ re.compile(r"^#include"),
+ re.compile(r"^typedef.*;\s*$"),
+ re.compile(r"^extern.*;\d*$"),
)
impossibles = ("sizeof", "offsetof")
+
def pythonize(rfp, wfp):
"Pythonize a specified C header file."
wfp.write("# This file was generated by pythonize-header;\n")
=====================================
wscript
=====================================
--- a/wscript
+++ b/wscript
@@ -205,8 +205,8 @@ def configure(ctx):
ctx.env.DISABLE_MANPAGE = True
from waflib.Utils import subprocess
- if ((os.path.exists(".git")
- and ctx.find_program("git", var="BIN_GIT", mandatory=False))):
+ if ((os.path.exists(".git") and
+ ctx.find_program("git", var="BIN_GIT", mandatory=False))):
ctx.start_msg("DEVEL: Getting revision")
cmd = ["git", "log", "-1", "--format=%H"]
p = subprocess.Popen(cmd, stdin=subprocess.PIPE,
@@ -693,8 +693,8 @@ int main(int argc, char **argv) {
# Sanity check...
print("Compilation check failed but include exists %s" % hdr)
- if ((ctx.get_define("HAVE_TIMEPPS_H")
- or ctx.get_define("HAVE_SYS_TIMEPPS_H"))):
+ if ((ctx.get_define("HAVE_TIMEPPS_H") or
+ ctx.get_define("HAVE_SYS_TIMEPPS_H"))):
ctx.define("HAVE_PPSAPI", 1, comment="Enable the PPS API")
# Check for Solaris capabilities
@@ -772,8 +772,8 @@ int main(int argc, char **argv) {
# file /usr/include/sys/timex.h for the particular
# architecture to be in place."
#
- if ((ctx.get_define("HAVE_SYS_TIMEX_H")
- and not ctx.options.disable_kernel_pll)):
+ if ((ctx.get_define("HAVE_SYS_TIMEX_H") and
+ not ctx.options.disable_kernel_pll)):
ctx.define("HAVE_KERNEL_PLL", 1,
comment="Whether phase-locked loop for timing "
"exists and is enabled")
@@ -971,15 +971,16 @@ def afterparty(ctx):
# Also, they need to be able to see the Python extension
# module built in libntp.
if ctx.cmd == 'clean' or ctx.cmd == 'distclean':
- ctx.exec_command("rm -f wafhelpers/*.pyc pylib/__pycache__/*.pyc wafhelpers/__pycache__/*.pyc ntpd/version.h")
+ ctx.exec_command("rm -f wafhelpers/*.pyc pylib/__pycache__/*.pyc "
+ "wafhelpers/__pycache__/*.pyc ntpd/version.h")
for x in ("ntpclients",):
# List used to be longer...
path_build = ctx.bldnode.make_node("pylib")
path_source = ctx.srcnode.make_node(x + "/ntp")
relpath = "../" + path_build.path_from(ctx.srcnode)
if ctx.cmd in ('install', 'build'):
- if ((not path_source.exists()
- or os.readlink(path_source.abspath()) != relpath)):
+ if ((not path_source.exists() or
+ os.readlink(path_source.abspath()) != relpath)):
try:
os.remove(path_source.abspath())
except OSError:
@@ -1098,12 +1099,14 @@ def build(ctx):
def systemdenable(ctx):
"Enable boot time start with systemd. Must run as root."
- ctx.exec_command("cp etc/ntpd.service etc/ntp-wait.service /usr/lib/systemd/system/")
+ ctx.exec_command("cp etc/ntpd.service etc/ntp-wait.service "
+ "/usr/lib/systemd/system/")
def systemddisable(ctx):
"Disable boot time start with systemd. Must run as root."
- ctx.exec_command("rm -f /usr/lib/systemd/system/ntpd.service /usr/lib/systemd/system/ntp-wait.service")
+ ctx.exec_command("rm -f /usr/lib/systemd/system/ntpd.service "
+ "/usr/lib/systemd/system/ntp-wait.service")
#
# Miscellaneous utility productions
@@ -1124,8 +1127,8 @@ def loccount(ctx):
def cxfreeze(ctx):
"Create standalone binaries from Python scripts."
- ctx.exec_command("for prog in " + " ".join(python_scripts)
- + "; do cxfreeze $prog; done")
+ ctx.exec_command("for prog in " + " ".join(python_scripts) +
+ "; do cxfreeze $prog; done")
def linkcheck(ctx):
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/compare/c0b9c4546e42e68bb385a2e7f27809ad46f1bcd2...ed969508a7c2ca4108ab0107882cd20a2a5d2998
---
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/compare/c0b9c4546e42e68bb385a2e7f27809ad46f1bcd2...ed969508a7c2ca4108ab0107882cd20a2a5d2998
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/20170506/65c79d8e/attachment.html>
More information about the vc
mailing list