repr() formatting cleanups

This commit is contained in:
Daniel Pavel 2013-06-26 13:40:46 +02:00
parent 0cf1f1983d
commit c25b769578
3 changed files with 6 additions and 6 deletions

View File

@ -232,7 +232,7 @@ class FeaturesArray(object):
elif ivalue == int(f):
return index
elif ivalue < int(f):
raise ValueError("%s not in list" % repr(value))
raise ValueError("%r not in list" % value)
if may_have:
reply = self.device.request(0x0000, _pack('!H', ivalue))
@ -241,7 +241,7 @@ class FeaturesArray(object):
self.features[index] = FEATURE[ivalue]
return index
raise ValueError("%s not in list" % repr(value))
raise ValueError("%r not in list" % value)
def __iter__(self):
if self._check():

View File

@ -47,9 +47,9 @@ class _ThreadedHandle(object):
def _open(self):
handle = _base.open_path(self.path)
if handle is None:
_log.error("%s failed to open new handle", repr(self))
_log.error("%r failed to open new handle", self)
else:
# _log.debug("%s opened new handle %d", repr(self), handle)
# _log.debug("%r opened new handle %d", self, handle)
self._local.handle = handle
self._handles.append(handle)
return handle
@ -59,7 +59,7 @@ class _ThreadedHandle(object):
self._local = None
handles, self._handles = self._handles, []
if _log.isEnabledFor(_DEBUG):
_log.debug("%s closing %s", repr(self), handles)
_log.debug("%r closing %s", self, handles)
for h in handles:
_base.close(h)

View File

@ -335,7 +335,7 @@ def config_device(receiver, args):
result = setting.write(value)
if result is None:
_fail("failed to set '%s' = '%s' [%s]" % (setting.name, value, repr(value)))
_fail("failed to set '%s' = '%s' [%r]" % (setting.name, value, value))
print ("%s = %s" % (setting.name, result))
#