box_interface.py
Go to the documentation of this file.
1 #!/usr/bin/env python
2 
3 
6 
7 """ Contains a class that holds box 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 box in the xar format
17  """
18 
19  def __init__(self, attrs):
20  super(BoxInterface, self).__init__("BoxInterface")
21 
22  # Attributes
23  self.uuid = attrs.getValue("uuid")
24  self.box_version = attrs.getValue("box_version")
25  self.name = attrs.getValue("name")
26  self.localization = attrs.getValue("localization")
27  self.tooltip = attrs.getValue("tooltip")
28  self.plugin = attrs.getValue("plugin")
29  self.format_version = attrs.getValue("format_version")
30 
31  # Elements
32  self.bitmaps = []
33  self.inputs = []
34  self.outputs = []
35  self.parameters = []
36  self.resources = []
37  self.contents = []
38 
39  # Function map to speed up process
40  self._function_map = {'Bitmap': BoxInterface.attach_bitmap,
41  'Input': BoxInterface.attach_input,
42  'Output': BoxInterface.attach_output,
43  'Parameter': BoxInterface.attach_parameter,
44  'Resource': BoxInterface.attach_resource,
45  'Content': BoxInterface.attach_content}
46 
47  def attach_bitmap(self, bitmap):
48  self.bitmaps.append(bitmap)
49 
50  def attach_input(self, attrs):
51  input = xar_types.IO(attrs.getValue('name'),
52  attrs.getValue('signature'),
53  attrs.getValue('nature'),
54  attrs.getValue('stm_value_name'),
55  attrs.getValue('inner'),
56  attrs.getValue('tooltip'),
57  attrs.getValue('id'))
58  self.inputs.append(input)
59 
60  def attach_output(self, attrs):
61  output = xar_types.IO(attrs.getValue('name'),
62  attrs.getValue('signature'),
63  attrs.getValue('nature'),
64  attrs.getValue('stm_value_name'),
65  attrs.getValue('inner'),
66  attrs.getValue('tooltip'),
67  attrs.getValue('id'))
68  self.outputs.append(output)
69 
70  def attach_parameter(self, parameter):
71  self.parameters.append(parameter)
72 
73  def attach_resource(self, attrs):
74  resource = xar_types.resource(attrs.getValue('name'),
75  attrs.getValue('lock_type'),
76  attrs.getValue('timeout'))
77  self.resources.append(resource)
78 
79  def attach_content(self, content):
80  self.contents.append(content)
converter.node.box_interface.BoxInterface.__init__
def __init__(self, attrs)
Definition: box_interface.py:19
converter.node.box_interface.BoxInterface.attach_content
def attach_content(self, content)
Definition: box_interface.py:79
converter.node.box_interface.BoxInterface.attach_output
def attach_output(self, attrs)
Definition: box_interface.py:60
converter.node.box_interface.BoxInterface
Definition: box_interface.py:15
converter.xar_types.resource
Definition: xar_types.py:46
converter.node.box_interface.BoxInterface.outputs
outputs
Definition: box_interface.py:34
converter.node.box_interface.BoxInterface.parameters
parameters
Definition: box_interface.py:35
converter.node.box_interface.BoxInterface.contents
contents
Definition: box_interface.py:37
converter.node.box_interface.BoxInterface.attach_resource
def attach_resource(self, attrs)
Definition: box_interface.py:73
converter.node
Definition: xarconverter/converter/node/__init__.py:1
converter.xar_types.IO
Definition: xar_types.py:26
converter.node.box_interface.BoxInterface.inputs
inputs
Definition: box_interface.py:33
converter.xar_types
Definition: xar_types.py:1
converter.node.box_interface.BoxInterface.attach_input
def attach_input(self, attrs)
Definition: box_interface.py:50
converter.node.box_interface.BoxInterface.format_version
format_version
Definition: box_interface.py:29
converter.node.box_interface.BoxInterface.plugin
plugin
Definition: box_interface.py:28
converter.node.box_interface.BoxInterface.uuid
uuid
Definition: box_interface.py:23
converter.node.box_interface.BoxInterface.tooltip
tooltip
Definition: box_interface.py:27
converter.node.box_interface.BoxInterface.bitmaps
bitmaps
Definition: box_interface.py:32
converter.node.box_interface.BoxInterface.attach_bitmap
def attach_bitmap(self, bitmap)
Definition: box_interface.py:47
converter.node.Node._function_map
_function_map
Definition: xarconverter/converter/node/__init__.py:25
converter.node.box_interface.BoxInterface.resources
resources
Definition: box_interface.py:36
converter.node.box_interface.BoxInterface.box_version
box_version
Definition: box_interface.py:24
converter.node.box_interface.BoxInterface.attach_parameter
def attach_parameter(self, parameter)
Definition: box_interface.py:70
converter.node.Node.name
name
Definition: xarconverter/converter/node/__init__.py:18
converter.node.box_interface.BoxInterface.localization
localization
Definition: box_interface.py:26
converter.node.Node
Definition: xarconverter/converter/node/__init__.py:12


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