cosmetics on datatypes.TextType

make __repr__ more nice and include in __all__

Change-Id: Iecfe6326f2d35a2210c03f7bd8c84dc2830b19ea
Reviewed-on: https://forge.frm2.tum.de/review/c/sine2020/secop/playground/+/23120
Tested-by: JenkinsCodeReview <bjoern_pedersen@frm2.tum.de>
Reviewed-by: Enrico Faulhaber <enrico.faulhaber@frm2.tum.de>
Reviewed-by: Markus Zolliker <markus.zolliker@psi.ch>
This commit is contained in:
zolliker 2020-05-20 15:51:14 +02:00
parent f7a6ba8b5b
commit a25cb3dce5

View File

@ -40,7 +40,7 @@ __all__ = [
'DataType', 'get_datatype',
'FloatRange', 'IntRange', 'ScaledInteger',
'BoolType', 'EnumType',
'BLOBType', 'StringType',
'BLOBType', 'StringType', 'TextType',
'TupleOf', 'ArrayOf', 'StructOf',
'CommandType', 'StatusType',
]
@ -592,7 +592,9 @@ class TextType(StringType):
super(TextType, self).__init__(0, maxchars)
def __repr__(self):
return 'TextType(%d, %d)' % (self.minchars, self.maxchars)
if self.maxchars == UNLIMITED:
return 'TextType()'
return 'TextType(%d)' % (self.maxchars)
def copy(self):
# DataType.copy will not work, because it is exported as 'string'