diff options
| author | Richard Purdie <richard@openedhand.com> | 2006-03-20 17:45:11 +0000 |
|---|---|---|
| committer | Richard Purdie <richard@openedhand.com> | 2006-03-20 17:45:11 +0000 |
| commit | b26a945734ce271aa7d443ff9e96fe2851b21138 (patch) | |
| tree | f540b8d58a7411cf0cabe5c8f4ad40f9f597352a /bitbake/bin/bitdoc | |
| parent | 3cd47ad235d54a9c539ae6fe4a5a2b4b5f7e5621 (diff) | |
| download | poky-b26a945734ce271aa7d443ff9e96fe2851b21138.tar.gz | |
Update to latest bitbake
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@309 311d38ba-8fff-0310-9ca6-ca027cbcb966
Diffstat (limited to 'bitbake/bin/bitdoc')
| -rwxr-xr-x | bitbake/bin/bitdoc | 55 |
1 files changed, 33 insertions, 22 deletions
diff --git a/bitbake/bin/bitdoc b/bitbake/bin/bitdoc index 64d32945ba..84d2ee23ce 100755 --- a/bitbake/bin/bitdoc +++ b/bitbake/bin/bitdoc | |||
| @@ -30,7 +30,7 @@ import optparse, os, sys | |||
| 30 | # bitbake | 30 | # bitbake |
| 31 | sys.path.append(os.path.join(os.path.dirname(os.path.dirname(sys.argv[0])), 'lib')) | 31 | sys.path.append(os.path.join(os.path.dirname(os.path.dirname(sys.argv[0])), 'lib')) |
| 32 | import bb | 32 | import bb |
| 33 | from bb import make | 33 | import bb.parse |
| 34 | from string import split, join | 34 | from string import split, join |
| 35 | 35 | ||
| 36 | __version__ = "0.0.2" | 36 | __version__ = "0.0.2" |
| @@ -45,8 +45,8 @@ class HTMLFormatter: | |||
| 45 | one site for each key with links to the relations and groups. | 45 | one site for each key with links to the relations and groups. |
| 46 | 46 | ||
| 47 | index.html | 47 | index.html |
| 48 | keys.html | 48 | all_keys.html |
| 49 | groups.html | 49 | all_groups.html |
| 50 | groupNAME.html | 50 | groupNAME.html |
| 51 | keyNAME.html | 51 | keyNAME.html |
| 52 | """ | 52 | """ |
| @@ -75,8 +75,8 @@ class HTMLFormatter: | |||
| 75 | return """<table class="navigation" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2"> | 75 | return """<table class="navigation" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2"> |
| 76 | <tr valign="middle"> | 76 | <tr valign="middle"> |
| 77 | <td><a accesskey="g" href="index.html">Home</a></td> | 77 | <td><a accesskey="g" href="index.html">Home</a></td> |
| 78 | <td><a accesskey="n" href="groups.html">Groups</a></td> | 78 | <td><a accesskey="n" href="all_groups.html">Groups</a></td> |
| 79 | <td><a accesskey="u" href="keys.html">Keys</a></td> | 79 | <td><a accesskey="u" href="all_keys.html">Keys</a></td> |
| 80 | </tr></table> | 80 | </tr></table> |
| 81 | """ | 81 | """ |
| 82 | 82 | ||
| @@ -89,10 +89,11 @@ class HTMLFormatter: | |||
| 89 | return "" | 89 | return "" |
| 90 | 90 | ||
| 91 | txt = "<p><b>See also:</b><br>" | 91 | txt = "<p><b>See also:</b><br>" |
| 92 | txts = [] | ||
| 92 | for it in item.related(): | 93 | for it in item.related(): |
| 93 | txt += """<a href="key%s.html">%s</a>, """ % (it, it) | 94 | txts.append("""<a href="key%(it)s.html">%(it)s</a>""" % vars() ) |
| 94 | 95 | ||
| 95 | return txt | 96 | return txt + ",".join(txts) |
| 96 | 97 | ||
| 97 | def groups(self,item): | 98 | def groups(self,item): |
| 98 | """ | 99 | """ |
| @@ -103,11 +104,12 @@ class HTMLFormatter: | |||
| 103 | return "" | 104 | return "" |
| 104 | 105 | ||
| 105 | 106 | ||
| 106 | txt = "<p><b>Seel also:</b><br>" | 107 | txt = "<p><b>See also:</b><br>" |
| 108 | txts = [] | ||
| 107 | for group in item.groups(): | 109 | for group in item.groups(): |
| 108 | txt += """<a href="group%s.html">%s</a>, """ % (group,group) | 110 | txts.append( """<a href="group%s.html">%s</a> """ % (group,group) ) |
| 109 | 111 | ||
| 110 | return txt | 112 | return txt + ",".join(txts) |
| 111 | 113 | ||
| 112 | 114 | ||
| 113 | def createKeySite(self,item): | 115 | def createKeySite(self,item): |
| @@ -125,23 +127,23 @@ class HTMLFormatter: | |||
| 125 | 127 | ||
| 126 | <div class="refsynopsisdiv"> | 128 | <div class="refsynopsisdiv"> |
| 127 | <h2>Synopsis</h2> | 129 | <h2>Synopsis</h2> |
| 128 | <pre class="synopsis"> | 130 | <p> |
| 129 | %s | 131 | %s |
| 130 | </pre> | 132 | </p> |
| 131 | </div> | 133 | </div> |
| 132 | 134 | ||
| 133 | <div class="refsynopsisdiv"> | 135 | <div class="refsynopsisdiv"> |
| 134 | <h2>Related Keys</h2> | 136 | <h2>Related Keys</h2> |
| 135 | <pre class="synopsis"> | 137 | <p> |
| 136 | %s | 138 | %s |
| 137 | </pre> | 139 | </p> |
| 138 | </div> | 140 | </div> |
| 139 | 141 | ||
| 140 | <div class="refsynopsisdiv"> | 142 | <div class="refsynopsisdiv"> |
| 141 | <h2>Groups</h2> | 143 | <h2>Groups</h2> |
| 142 | <pre class="synopsis"> | 144 | <p> |
| 143 | %s | 145 | %s |
| 144 | </pre> | 146 | </p> |
| 145 | </div> | 147 | </div> |
| 146 | 148 | ||
| 147 | 149 | ||
| @@ -181,8 +183,8 @@ class HTMLFormatter: | |||
| 181 | <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> | 183 | <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> |
| 182 | %s | 184 | %s |
| 183 | <h2>Documentation Entrance</h2> | 185 | <h2>Documentation Entrance</h2> |
| 184 | <a href="groups.html">All available groups</a><br> | 186 | <a href="all_groups.html">All available groups</a><br> |
| 185 | <a href="keys.html">All available keys</a><br> | 187 | <a href="all_keys.html">All available keys</a><br> |
| 186 | </body> | 188 | </body> |
| 187 | """ % self.createNavigator() | 189 | """ % self.createNavigator() |
| 188 | 190 | ||
| @@ -206,13 +208,21 @@ class HTMLFormatter: | |||
| 206 | </body> | 208 | </body> |
| 207 | """ % (self.createNavigator(), keys) | 209 | """ % (self.createNavigator(), keys) |
| 208 | 210 | ||
| 209 | def createGroupSite(self,gr, items): | 211 | def createGroupSite(self, gr, items, _description = None): |
| 210 | """ | 212 | """ |
| 211 | Create a site for a group: | 213 | Create a site for a group: |
| 212 | Group the name of the group, items contain the name of the keys | 214 | Group the name of the group, items contain the name of the keys |
| 213 | inside this group | 215 | inside this group |
| 214 | """ | 216 | """ |
| 215 | groups = "" | 217 | groups = "" |
| 218 | description = "" | ||
| 219 | |||
| 220 | # create a section with the group descriptions | ||
| 221 | if _description: | ||
| 222 | description += "<h2 Description of Grozp %s</h2>" % gr | ||
| 223 | description += _description | ||
| 224 | |||
| 225 | items.sort(lambda x,y:cmp(x.name(),y.name())) | ||
| 216 | for group in items: | 226 | for group in items: |
| 217 | groups += """<a href="key%s.html">%s</a><br>""" % (group.name(), group.name()) | 227 | groups += """<a href="key%s.html">%s</a><br>""" % (group.name(), group.name()) |
| 218 | 228 | ||
| @@ -221,6 +231,7 @@ class HTMLFormatter: | |||
| 221 | <link rel="stylesheet" href="style.css" type="text/css"> | 231 | <link rel="stylesheet" href="style.css" type="text/css"> |
| 222 | <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> | 232 | <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> |
| 223 | %s | 233 | %s |
| 234 | %s | ||
| 224 | <div class="refsynopsisdiv"> | 235 | <div class="refsynopsisdiv"> |
| 225 | <h2>Keys in Group %s</h2> | 236 | <h2>Keys in Group %s</h2> |
| 226 | <pre class="synopsis"> | 237 | <pre class="synopsis"> |
| @@ -228,7 +239,7 @@ class HTMLFormatter: | |||
| 228 | </pre> | 239 | </pre> |
| 229 | </div> | 240 | </div> |
| 230 | </body> | 241 | </body> |
| 231 | """ % (gr, self.createNavigator(), gr, groups) | 242 | """ % (gr, self.createNavigator(), description, gr, groups) |
| 232 | 243 | ||
| 233 | 244 | ||
| 234 | 245 | ||
| @@ -508,10 +519,10 @@ def main(): | |||
| 508 | f = file('index.html', 'w') | 519 | f = file('index.html', 'w') |
| 509 | print >> f, html_slave.createIndex() | 520 | print >> f, html_slave.createIndex() |
| 510 | 521 | ||
| 511 | f = file('groups.html', 'w') | 522 | f = file('all_groups.html', 'w') |
| 512 | print >> f, html_slave.createGroupsSite(doc) | 523 | print >> f, html_slave.createGroupsSite(doc) |
| 513 | 524 | ||
| 514 | f = file('keys.html', 'w') | 525 | f = file('all_keys.html', 'w') |
| 515 | print >> f, html_slave.createKeysSite(doc) | 526 | print >> f, html_slave.createKeysSite(doc) |
| 516 | 527 | ||
| 517 | # now for each group create the site | 528 | # now for each group create the site |
