|
From: Marc J. R. S. <mro...@ce...> - 2015-08-20 11:30:06
|
Refactor displayvalue method by converting the value directly
to string and return it.
---
lib/taurus/core/tango/tangoattribute.py | 21 ++-------------------
1 file changed, 2 insertions(+), 19 deletions(-)
diff --git a/lib/taurus/core/tango/tangoattribute.py b/lib/taurus/core/tango/tangoattribute.py
index 218e347..109c744 100755
--- a/lib/taurus/core/tango/tangoattribute.py
+++ b/lib/taurus/core/tango/tangoattribute.py
@@ -301,25 +301,8 @@ class TangoAttribute(TaurusAttribute):
return tgtype == PyTango.CmdArgType.DevState
@tep14_deprecation(dbg_msg='Deprecated method')
- def displayValue(self,value):
- if value is None:
- return None
- ret = None
- try:
- if self.isScalar():
- fmt = self.getFormat()
- if self.isNumeric() and fmt is not None:
- ret = fmt % value
- else:
- ret = str(value)
- elif self.isSpectrum():
- ret = str(value)
- else:
- ret = str(value)
- except:
- # if cannot calculate value based on the format just return the value
- ret = str(value)
- return ret
+ def displayValue(self, value):
+ return str(value)
@tep14_deprecation(alt='getLabel')
def getDisplayValue(self, cache=True):
--
1.8.1.4
|