# HG changeset patch # User Mario de Sousa # Date 1591569976 -3600 # Node ID 253110ba0fd786c76c979d167295d1540d6ff3bd # Parent 5f48d5e60a8134dda4a95c75dae30ada3d3ce4a3 Bacnet plugin web configuration: strip leading and trailing spaces for net. interface and port numb. diff -r 5f48d5e60a81 -r 253110ba0fd7 runtime/BACnet_config.py --- a/runtime/BACnet_config.py Sun Jun 07 23:38:20 2020 +0100 +++ b/runtime/BACnet_config.py Sun Jun 07 23:46:16 2020 +0100 @@ -87,6 +87,10 @@ +class BN_StrippedString(annotate.String): + def __init__(self, *args, **kwargs): + annotate.String.__init__(self, strip = True, *args, **kwargs) + BACnet_parameters = [ @@ -94,8 +98,8 @@ # (C code var name) (used on web interface) (C data type) (web data type) # (annotate.String, # annotate.Integer, ...) - ("network_interface" , _("Network Interface") , ctypes.c_char_p, annotate.String), - ("port_number" , _("UDP Port Number") , ctypes.c_char_p, annotate.String), + ("network_interface" , _("Network Interface") , ctypes.c_char_p, BN_StrippedString), + ("port_number" , _("UDP Port Number") , ctypes.c_char_p, BN_StrippedString), ("comm_control_passwd" , _("BACnet Communication Control Password") , ctypes.c_char_p, annotate.String), ("device_id" , _("BACnet Device ID") , ctypes.c_int, annotate.Integer), ("device_name" , _("BACnet Device Name") , ctypes.c_char_p, annotate.String), @@ -269,8 +273,8 @@ _("BACnet Configuration"), # description [], # fields (empty, no parameters required!) _("Delete Configuration Stored in Persistent Storage"), # button label - OnButtonDel) # callback - + OnButtonDel, # callback + "BACnetConfigParm") # Add after entry xxxx def OnButtonSave(**kwargs):