__init__.py
Go to the documentation of this file.
00001 #!/usr/bin/env python
00002 #
00003 # Copyright 2015 Airbus
00004 # Copyright 2017 Fraunhofer Institute for Manufacturing Engineering and Automation (IPA)
00005 #
00006 # Licensed under the Apache License, Version 2.0 (the "License");
00007 # you may not use this file except in compliance with the License.
00008 # You may obtain a copy of the License at
00009 #
00010 #   http://www.apache.org/licenses/LICENSE-2.0
00011 #
00012 # Unless required by applicable law or agreed to in writing, software
00013 # distributed under the License is distributed on an "AS IS" BASIS,
00014 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00015 # See the License for the specific language governing permissions and
00016 # limitations under the License.
00017 
00018 import os
00019 from airbus_docgen.common import html
00020 from airbus_docgen.common.html import HtmlElement
00021 
00022 from airbus_docgen.docgen.pkg.node.description import NodeDescription
00023 from airbus_docgen.docgen.pkg.node.ios import NodeInputOutput
00024 from airbus_docgen.docgen.pkg.node.params import NodeParameters
00025 
00026 
00027 class RosNode(HtmlElement):
00028     
00029     def __init__(self):
00030         HtmlElement.__init__(self,
00031                              tag=html.Sections.article,
00032                              attrib={"class":"node"})
00033         
00034     def read(self, node_name, node_xml, isection, iarticle):
00035         
00036         item_index = 0
00037         
00038         try:
00039             node_desc = NodeDescription()
00040             if node_desc.read(node_name, node_xml) is True:
00041                 item_index += 1
00042                 title = HtmlElement(html.Sections.h4)
00043                 title.text = "%i.%i.%i. Description"%(isection, iarticle, item_index)
00044                 self.append(title)
00045                 self.append(node_desc)
00046         except Exception as ex:
00047             html.HTMLException(ex,self)
00048             
00049         try:
00050             node_io = NodeInputOutput()
00051             if node_io.read(node_name, node_xml) is True:
00052                 item_index += 1
00053                 title = HtmlElement(html.Sections.h4)
00054                 title.text = "%i.%i.%i. Input/Output"%(isection, iarticle, item_index)
00055                 self.append(title)
00056                 self.append(node_io)
00057         except Exception as ex:
00058             html.HTMLException(ex,self)
00059             
00060         try:
00061             node_params = NodeParameters()
00062             if node_params.read(node_name, node_xml) is True:
00063                 item_index += 1
00064                 title = HtmlElement(html.Sections.h4)
00065                 title.text = "%i.%i.%i. Parameter(s)"%(isection, iarticle, item_index)
00066                 self.append(title)
00067                 self.append(node_params)
00068         except Exception as ex:
00069             html.HTMLException(ex,self)
00070         
00071         if item_index is 0:
00072             return False
00073         else:
00074             return True
00075     


airbus_docgen
Author(s): Matignon Martin
autogenerated on Thu Jun 6 2019 17:59:08