1
0
mirror of https://github.com/JoelBender/bacpypes synced 2025-10-05 22:18:16 +08:00

back to old school formatting

This commit is contained in:
Joel Bender 2019-04-11 10:36:45 -04:00
parent 7bd978ffaa
commit e53fc305cf
3 changed files with 8 additions and 8 deletions

View File

@ -76,7 +76,7 @@ def encode_max_segments_accepted(arg):
if _max_segments_accepted_encoding[i] <= arg:
return i
raise ValueError("invalid max max segments accepted: {0}".format(arg))
raise ValueError("invalid max max segments accepted: %r" % (arg,))
def decode_max_segments_accepted(arg):
"""Decode the maximum number of segments the device will accept, Section
@ -97,12 +97,12 @@ def encode_max_apdu_length_accepted(arg):
if (arg >= _max_apdu_length_encoding[i]):
return i
raise ValueError("invalid max APDU length accepted: {0}".format(arg))
raise ValueError("invalid max APDU length accepted: %r" % (arg,))
def decode_max_apdu_length_accepted(arg):
v = _max_apdu_length_encoding[arg]
if not v:
raise ValueError("invalid max APDU length accepted: {0}".format(arg))
raise ValueError("invalid max APDU length accepted: %r" % (arg,))
return v

View File

@ -157,7 +157,7 @@ class SSM(OneShotTask, DebugContents):
# check for invalid segment number
if indx >= self.segmentCount:
raise RuntimeError("invalid segment number {0}, APDU has {1} segments".format(indx, self.segmentCount))
raise RuntimeError("invalid segment number %r, APDU has %r segments" % (indx, self.segmentCount))
if self.segmentAPDU.apduType == ConfirmedRequestPDU.pduType:
if _debug: SSM._debug(" - confirmed request context")

View File

@ -69,11 +69,11 @@ class ReadWritePropertyServices(Capability):
elif issubclass(datatype.subtype, Atomic):
value = datatype.subtype(value)
elif not isinstance(value, datatype.subtype):
raise TypeError("invalid result datatype, expecting {0} and got {1}" \
.format(datatype.subtype.__name__, type(value).__name__))
raise TypeError("invalid result datatype, expecting %r and got %r" \
% (datatype.subtype.__name__, type(value).__name__))
elif not isinstance(value, datatype):
raise TypeError("invalid result datatype, expecting {0} and got {1}" \
.format(datatype.__name__, type(value).__name__))
raise TypeError("invalid result datatype, expecting %r and got %r" \
% (datatype.__name__, type(value).__name__))
if _debug: ReadWritePropertyServices._debug(" - encodeable value: %r", value)
# this is a ReadProperty ack