From 125f0d83e931959953a824532c3a3cf7d5e54275 Mon Sep 17 00:00:00 2001 From: Enrico Faulhaber Date: Wed, 24 Jul 2019 14:29:08 +0200 Subject: [PATCH] Use new TextType + fix Property usage in tcp.py Change-Id: I254ddfe30605298ce419667e9b1985df48ef824a Reviewed-on: https://forge.frm2.tum.de/review/20952 Tested-by: JenkinsCodeReview Reviewed-by: Enrico Faulhaber --- secop/modules.py | 4 ++-- secop/params.py | 6 +++--- secop/protocol/interface/tcp.py | 9 ++++++--- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/secop/modules.py b/secop/modules.py index cde003f..bdc82f0 100644 --- a/secop/modules.py +++ b/secop/modules.py @@ -28,7 +28,7 @@ import time from collections import OrderedDict from secop.datatypes import EnumType, FloatRange, BoolType, IntRange, \ - StringType, TupleOf, get_datatype, ArrayOf + StringType, TupleOf, get_datatype, ArrayOf, TextType from secop.errors import ConfigError, ProgrammingError from secop.lib import formatException, \ formatExtendedStack, mkthread, unset_value @@ -70,7 +70,7 @@ class Module(HasProperties): properties = { 'export': Property('Flag if this Module is to be exported', BoolType(), default=True, export=False), 'group': Property('Optional group the Module belongs to', StringType(), default='', extname='group'), - 'description': Property('Description of the module', StringType(), extname='description', mandatory=True), + 'description': Property('Description of the module', TextType(), extname='description', mandatory=True), 'meaning': Property('Optional Meaning indicator', TupleOf(StringType(),IntRange(0,50)), default=('',0), extname='meaning'), 'visibility': Property('Optional visibility hint', EnumType('visibility', user=1, advanced=2, expert=3), diff --git a/secop/params.py b/secop/params.py index bbeaefe..542e6a6 100644 --- a/secop/params.py +++ b/secop/params.py @@ -26,7 +26,7 @@ from __future__ import division, print_function from collections import OrderedDict from secop.datatypes import CommandType, DataType, StringType, BoolType, EnumType, DataTypeType, ValueType, OrType, \ - NoneOr + NoneOr, TextType from secop.errors import ProgrammingError from secop.properties import HasProperties, Property @@ -92,7 +92,7 @@ class Parameter(Accessible): """ properties = { - u'description': Property('Description of the Parameter', StringType(), + u'description': Property('Description of the Parameter', TextType(), extname=u'description', mandatory=True), u'datatype': Property('Datatype of the Parameter', DataTypeType(), extname=u'datatype', mandatory=True), @@ -251,7 +251,7 @@ class Command(Accessible): """ # datatype is not listed (handled separately) properties = { - u'description': Property('Description of the Command', StringType(), + u'description': Property('Description of the Command', TextType(), extname=u'description', export=True, mandatory=True), u'group': Property('Optional command group of the command.', StringType(), extname=u'group', export=True, default=''), diff --git a/secop/protocol/interface/tcp.py b/secop/protocol/interface/tcp.py index 8eb6996..6a95f41 100644 --- a/secop/protocol/interface/tcp.py +++ b/secop/protocol/interface/tcp.py @@ -187,9 +187,12 @@ class TCPServer(HasProperties, socketserver.ThreadingTCPServer): allow_reuse_address = True properties = { - 'bindto' : Property(StringType(), default='localhost:%d' % DEF_PORT, export=False), - 'bindport' : Property(IntRange(1,65535), default=DEF_PORT, export=False), - 'detailed_errors': Property(BoolType(), default=False, export=False), + 'bindto' : Property('hostname or ip address for binding',StringType(), + default='localhost:%d' % DEF_PORT, export=False), + 'bindport' : Property('port number to bind',IntRange(1,65535), + default=DEF_PORT, export=False), + 'detailed_errors': Property('Flag to enable detailed Errorreporting.', BoolType(), + default=False, export=False), } # XXX: create configurables from Metaclass!