From e53fc305cf0c58c953db8c30a8bb8c0bede1ee6f Mon Sep 17 00:00:00 2001 From: Joel Bender Date: Thu, 11 Apr 2019 10:36:45 -0400 Subject: [PATCH] back to old school formatting --- py25/bacpypes/apdu.py | 6 +++--- py25/bacpypes/appservice.py | 2 +- py25/bacpypes/service/object.py | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/py25/bacpypes/apdu.py b/py25/bacpypes/apdu.py index 118b4ab..f67fab2 100755 --- a/py25/bacpypes/apdu.py +++ b/py25/bacpypes/apdu.py @@ -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 diff --git a/py25/bacpypes/appservice.py b/py25/bacpypes/appservice.py index 1ce2fab..89691b9 100755 --- a/py25/bacpypes/appservice.py +++ b/py25/bacpypes/appservice.py @@ -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") diff --git a/py25/bacpypes/service/object.py b/py25/bacpypes/service/object.py index a7fe647..fc63173 100755 --- a/py25/bacpypes/service/object.py +++ b/py25/bacpypes/service/object.py @@ -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