original_docstring: Add a text filed in a xml element corresponding to the parameter value
  
      Parameters
      ----------
      elt: XML elt
      param: Parameter
  
      See Also
      --------
      add_text_to_elt, walk_parameters_to_xml, dict_from_param
      
docstring: Add a text filed in a xml element corresponding to the parameter value
  Parameters
  
  XML elt
  param: Parameter
  
  See Also
  
  
docstring_tokens: Add a text filed in a xml element corresponding to the parameter value Parameters XML elt param : Parameter See Also
code: def add_text_to_elt(elt, param):
      """Add a text filed in a xml element corresponding to the parameter value
  
      Parameters
      ----------
      elt: XML elt
      param: Parameter
  
      See Also
      --------
      add_text_to_elt, walk_parameters_to_xml, dict_from_param
      """
      param_type = str(param.type())
      if 'bool' in param_type or 'led' in param_type:
          if param.value():
              text = '1'
          else:
              text = '0'
      elif param_type == 'itemselect':
          if param.value() is not None:
              elt.set('all_items',
                      str(param.value()['all_items']))  # use list(eval(val_str[1:-1])) to get back a list of strings
              text = str(param.value()['selected'])  # use list(eval(val_str[1:-1])) to get back a list of strings
          else:
              text = str(None)
      elif param_type == 'color':
          text = str([param.value().red(), param.value().green(), param.value().blue(), param.value().alpha()])
      elif param_type == 'list':
          if isinstance(param.value(), str):
              text = "str('{}')".format(param.value())
          elif isinstance(param.value(), int):
              text = 'int({})'.format(param.value())
          elif isinstance(param.value(), float):
              text = 'float({})'.format(param.value())
          else:
              str(param.value())
      elif param_type == 'int':
          if param.value() == True:  #known bug
              val = 1
          else:
              val = param.value()
          text = str(val)
      elif param_type == 'date_time':
          text = str(param.value().toSecsSinceEpoch())
      elif param_type == 'date':
          text = str(QDateTime(param.value()).toSecsSinceEpoch())
      elif param_type == 'table_view':
          try:
              data = dict(classname=param.value().__class__.__name__,
                          module=param.value().__class__.__module__,
                          data=param.value().get_data_all(),
                          header=param.value().header)
              text = json.dumps(data)
          except:
              text = ''
      else:
          text = str(param.value())
      elt.text = text
code_tokens: def add_text_to_elt ( elt , param ) : param_type = str ( param . type ( ) ) if 'bool' in param_type or 'led' in param_type : if param . value ( ) : text = '1' else : text = '0' elif param_type == 'itemselect' : if param . value ( ) is not None : elt . set ( 'all_items' , str ( param . value ( ) [ 'all_items' ] ) ) text = str ( param . value ( ) [ 'selected' ] ) else : text = str ( None ) elif param_type == 'color' : text = str ( [ param . value ( ) . red ( ) , param . value ( ) . green ( ) , param . value ( ) . blue ( ) , param . value ( ) . alpha ( ) ] ) elif param_type == 'list' : if isinstance ( param . value ( ) , str ) : text = "str('{}')" . format ( param . value ( ) ) elif isinstance ( param . value ( ) , int ) : text = 'int({})' . format ( param . value ( ) ) elif isinstance ( param . value ( ) , float ) : text = 'float({})' . format ( param . value ( ) ) else : str ( param . value ( ) ) elif param_type == 'int' : if param . value ( ) == True : val = 1 else : val = param . value ( ) text = str ( val ) elif param_type == 'date_time' : text = str ( param . value ( ) . toSecsSinceEpoch ( ) ) elif param_type == 'date' : text = str ( QDateTime ( param . value ( ) ) . toSecsSinceEpoch ( ) ) elif param_type == 'table_view' : try : data = dict ( classname = param . value ( ) . __class__ . __name__ , module = param . value ( ) . __class__ . __module__ , data = param . value ( ) . get_data_all ( ) , header = param . value ( ) . header ) text = json . dumps ( data ) except : text = '' else : text = str ( param . value ( ) ) elt . text = text
short_docstring: Add a text filed in a xml element corresponding to the parameter value
  Parameters
short_docstring_tokens: Add a text filed in a xml element corresponding to the parameter value Parameters
comment: """Add a text filed in a xml element corresponding to the parameter value
  
      Parameters
      ----------
      elt: XML elt
      param: Parameter
  
      See Also
      --------
      add_text_to_elt, walk_parameters_to_xml, dict_from_param
      """$SEP$# use list(eval(val_str[1:-1])) to get back a list of strings$SEP$# use list(eval(val_str[1:-1])) to get back a list of strings$SEP$#known bug