__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 import env
00020 from airbus_docgen.common import html
00021 from airbus_docgen.common.html import HtmlElement, HtmlElementTree
00022 
00023 from airbus_docgen.digraph.digraph import *
00024 
00025 from airbus_docgen.docgen.home.workspace import RosWorkspace
00026 
00027 class HtmlHomeFileGenerator(HtmlElementTree):
00028     
00029     def __init__(self, index, packages_dir):
00030         
00031         HtmlElementTree.__init__(self, index.getroot())
00032         
00033         div = self.getroot().find("./body/div")
00034         
00035         section = HtmlElement(html.Sections.section)
00036         #{
00037         
00038         title = HtmlElement(html.Sections.h2)
00039         title.text = "1. Overview"
00040         section.append(title)
00041         
00042         aros_title = HtmlElement(html.Sections.h3)
00043         aros_title.text = "1.1 About ROS"
00044         section.append(aros_title)
00045         
00046         aros_article = HtmlElement(html.Sections.article)
00047         aros_article.text = """The Robot Operating System (ROS) is a flexible framework for writing robot software.
00048            It is a collection of tools,
00049            libraries, and conventions that aim to simplify the task of creating complex and robust robot behavior across a wide variety of robotic platforms."""
00050         section.append(aros_article)
00051         
00052         ws_title = HtmlElement(html.Sections.h3)
00053         ws_title.text = "1.2 AGI ROS Workspace"
00054         section.append(ws_title)
00055         
00056         try:
00057             section.append(RosWorkspace(packages_dir))
00058         except Exception as ex:
00059             html.HTMLException(ex, section)
00060         
00061         dev_title = HtmlElement(html.Sections.h3)
00062         dev_title.text = "1.3 Team"
00063         section.append(dev_title)
00064         
00065         ref_title = HtmlElement(html.Sections.h3)
00066         ref_title.text = "1.4 References"
00067         section.append(ref_title)
00068         
00069         #}
00070         
00071         div.append(section)
00072 
00073     def save(self):
00074         html.indent(self.getroot())
00075         self.write(os.path.join(env.ROSDOC_GEN, "home.html"),
00076                    encoding="utf8",
00077                    method="xml")
00078     
00079     def __str__(self):
00080         html.indent(self.getroot())
00081         return html.tostring(self.getroot())
00082     


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