Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
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