Commits (4)
......@@ -113,7 +113,7 @@ static PyMethodDef ntpc_methods[] = {
{"lfptofloat", ntpc_lfptofloat, METH_VARARGS,
PyDoc_STR("NTP l_fp to Python-style float time.")},
{"set_tod", ntpc_set_tod, METH_VARARGS,
PyDoc_STR("Set time to nanosecind precision.")},
PyDoc_STR("Set time to nanosecond precision.")},
{NULL, NULL, 0, NULL} /* sentinel */
};
......
......@@ -19,8 +19,9 @@ try:
from ntp.util import *
from ntp.ntpc import *
import ntp.version
except ImportError:
except ImportError as e:
sys.stderr.write("ntpq: can't find Python NTP library -- check PYTHONPATH.\n")
sys.stderr.write("%s\n" % e.message)
sys.exit(1)
# This import only works on Unixes. The intention is to enable
......@@ -976,7 +977,7 @@ usage: writevar assocID name=value,[...]
for associd in idrange:
if (associd != idrange[0]):
self.say("\n")
if not self__dolist(self.uservars,
if not self.__dolist(self.uservars,
associd, CTL_OP_READVAR, TYPE_PEER):
return
......@@ -1011,7 +1012,7 @@ usage: mrl assocIDlow assocIDhigh
for associd in idrange:
if (associd != idrange[0]):
self.say("\n")
if not self__dolist(varlist, associd, CTL_OP_READVAR, TYPE_PEER):
if not self.__dolist(varlist, associd, CTL_OP_READVAR, TYPE_PEER):
return
def help_mreadvar(self):
......
......@@ -43,8 +43,9 @@ import tempfile
try:
from ntp.statfiles import *
import ntp.util
except ImportError:
except ImportError as e:
sys.stderr.write("ntpviz: can't find Python NTP library -- check PYTHONPATH.\n")
sys.stderr.write("%s\n" % e.message)
sys.exit(1)
# overload ArgumentParser
......
......@@ -571,8 +571,7 @@ class Mode6Session:
"Ship an ntpq request packet to a server."
# Check to make sure the data will fit in one packet
if len(qdata) > CTL_MAX_DATA_LEN:
sys.stderr/write(stderr,
"***Internal error! Data too long\n",
sys.stderr.write("***Internal error! Data too large (%d)\n" %
len(qdata))
return -1
......