parameter.py
Go to the documentation of this file.
1 #!/usr/bin/env python
2 
3 
6 
7 """ Contains a class that holds diagram informations
8 .. module:: node
9 """
10 
11 import converter.node as node
12 import converter.xar_types as xar_types
13 
14 
16  """ Stores informations about parameter in the xar format
17  """
18 
19  def __init__(self, attrs):
20  super(Parameter, self).__init__("Parameter")
21 
22  # Attributes
23  self.name = attrs.getValue("name")
24  self.inherits_from_parent = attrs.getValue("inherits_from_parent")
25  self.value = attrs.getValue("value")
26  self.default_value = attrs.getValue("default_value")
27  self.min = attrs.getValue("min")
28  self.max = attrs.getValue("max")
29  self.custom_choice = attrs.getValue("custom_choice")
30  self.password = attrs.getValue("password")
31  self.tooltip = attrs.getValue("tooltip")
32  self.id = attrs.getValue("id")
33 
34  # parameter from the new format
35  if attrs.getValue("content_type") is None:
36  self.type = attrs.getValue("type")
37  else: # parameter from old xar
38  self.type = xar_types.resolve_parameter_signature(attrs.getValue("content_type"))
39 
40  # Elements
41  self.choices = []
42 
43  self._function_map = {'Choice': Parameter.attach_choice}
44 
45  def attach_choice(self, attrs):
46  choice = xar_types.choice(attrs.getValue('value'))
47  self.choices.append(choice)
48 
49  def beacon(self):
50  return "Parameter"
converter.node.parameter.Parameter.min
min
Definition: parameter.py:27
converter.node.Node.id
id
Definition: xarconverter/converter/node/__init__.py:17
converter.node.parameter.Parameter.value
value
Definition: parameter.py:25
converter.node.parameter.Parameter.custom_choice
custom_choice
Definition: parameter.py:29
converter.node
Definition: xarconverter/converter/node/__init__.py:1
converter.node.parameter.Parameter.attach_choice
def attach_choice(self, attrs)
Definition: parameter.py:45
converter.xar_types
Definition: xar_types.py:1
converter.node.parameter.Parameter.tooltip
tooltip
Definition: parameter.py:31
converter.node.parameter.Parameter
Definition: parameter.py:15
converter.node.parameter.Parameter.beacon
def beacon(self)
Definition: parameter.py:49
converter.node.Node._function_map
_function_map
Definition: xarconverter/converter/node/__init__.py:25
converter.node.parameter.Parameter.type
type
Definition: parameter.py:36
converter.node.parameter.Parameter.inherits_from_parent
inherits_from_parent
Definition: parameter.py:24
converter.node.parameter.Parameter.max
max
Definition: parameter.py:28
converter.node.parameter.Parameter.__init__
def __init__(self, attrs)
Definition: parameter.py:19
converter.node.parameter.Parameter.choices
choices
Definition: parameter.py:41
converter.node.Node.name
name
Definition: xarconverter/converter/node/__init__.py:18
converter.node.parameter.Parameter.default_value
default_value
Definition: parameter.py:26
converter.node.Node
Definition: xarconverter/converter/node/__init__.py:12
converter.node.parameter.Parameter.password
password
Definition: parameter.py:30
converter.xar_types.choice
Definition: xar_types.py:60


naoqi_libqicore
Author(s): Aldebaran
autogenerated on Wed Sep 14 2022 02:22:41