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:
parent
7bd978ffaa
commit
e53fc305cf
|
@ -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
|
||||
|
||||
|
|
|
@ -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")
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user