summaryrefslogtreecommitdiffstats
path: root/bitbake/bin/bitdoc
diff options
context:
space:
mode:
authorChris Larson <chris_larson@mentor.com>2010-06-20 12:08:07 -0700
committerRichard Purdie <rpurdie@linux.intel.com>2010-07-02 15:41:37 +0100
commitef1de9ecaf73e28234d284b79ec45e084d0f0c53 (patch)
tree417f87922c1a2fa4a3bbd4b35e0772221f96641e /bitbake/bin/bitdoc
parent20dc452614c991d1a4f5b7dcc1307cd03cba0c55 (diff)
downloadpoky-ef1de9ecaf73e28234d284b79ec45e084d0f0c53.tar.gz
Apply some 2to3 refactorings
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
Diffstat (limited to 'bitbake/bin/bitdoc')
-rwxr-xr-xbitbake/bin/bitdoc26
1 files changed, 12 insertions, 14 deletions
diff --git a/bitbake/bin/bitdoc b/bitbake/bin/bitdoc
index 4940f660a6..8043b2bd1c 100755
--- a/bitbake/bin/bitdoc
+++ b/bitbake/bin/bitdoc
@@ -48,7 +48,7 @@ class HTMLFormatter:
48 From pydoc... almost identical at least 48 From pydoc... almost identical at least
49 """ 49 """
50 while pairs: 50 while pairs:
51 (a,b) = pairs[0] 51 (a, b) = pairs[0]
52 text = join(split(text, a), b) 52 text = join(split(text, a), b)
53 pairs = pairs[1:] 53 pairs = pairs[1:]
54 return text 54 return text
@@ -87,7 +87,7 @@ class HTMLFormatter:
87 87
88 return txt + ",".join(txts) 88 return txt + ",".join(txts)
89 89
90 def groups(self,item): 90 def groups(self, item):
91 """ 91 """
92 Create HTML to link to related groups 92 Create HTML to link to related groups
93 """ 93 """
@@ -99,12 +99,12 @@ class HTMLFormatter:
99 txt = "<p><b>See also:</b><br>" 99 txt = "<p><b>See also:</b><br>"
100 txts = [] 100 txts = []
101 for group in item.groups(): 101 for group in item.groups():
102 txts.append( """<a href="group%s.html">%s</a> """ % (group,group) ) 102 txts.append( """<a href="group%s.html">%s</a> """ % (group, group) )
103 103
104 return txt + ",".join(txts) 104 return txt + ",".join(txts)
105 105
106 106
107 def createKeySite(self,item): 107 def createKeySite(self, item):
108 """ 108 """
109 Create a site for a key. It contains the header/navigator, a heading, 109 Create a site for a key. It contains the header/navigator, a heading,
110 the description, links to related keys and to the groups. 110 the description, links to related keys and to the groups.
@@ -149,8 +149,7 @@ class HTMLFormatter:
149 """ 149 """
150 150
151 groups = "" 151 groups = ""
152 sorted_groups = doc.groups() 152 sorted_groups = sorted(doc.groups())
153 sorted_groups.sort()
154 for group in sorted_groups: 153 for group in sorted_groups:
155 groups += """<a href="group%s.html">%s</a><br>""" % (group, group) 154 groups += """<a href="group%s.html">%s</a><br>""" % (group, group)
156 155
@@ -185,8 +184,7 @@ class HTMLFormatter:
185 Create Overview of all avilable keys 184 Create Overview of all avilable keys
186 """ 185 """
187 keys = "" 186 keys = ""
188 sorted_keys = doc.doc_keys() 187 sorted_keys = sorted(doc.doc_keys())
189 sorted_keys.sort()
190 for key in sorted_keys: 188 for key in sorted_keys:
191 keys += """<a href="key%s.html">%s</a><br>""" % (key, key) 189 keys += """<a href="key%s.html">%s</a><br>""" % (key, key)
192 190
@@ -214,7 +212,7 @@ class HTMLFormatter:
214 description += "<h2 Description of Grozp %s</h2>" % gr 212 description += "<h2 Description of Grozp %s</h2>" % gr
215 description += _description 213 description += _description
216 214
217 items.sort(lambda x,y:cmp(x.name(),y.name())) 215 items.sort(lambda x, y:cmp(x.name(), y.name()))
218 for group in items: 216 for group in items:
219 groups += """<a href="key%s.html">%s</a><br>""" % (group.name(), group.name()) 217 groups += """<a href="key%s.html">%s</a><br>""" % (group.name(), group.name())
220 218
@@ -343,7 +341,7 @@ class DocumentationItem:
343 def addGroup(self, group): 341 def addGroup(self, group):
344 self._groups.append(group) 342 self._groups.append(group)
345 343
346 def addRelation(self,relation): 344 def addRelation(self, relation):
347 self._related.append(relation) 345 self._related.append(relation)
348 346
349 def sort(self): 347 def sort(self):
@@ -396,7 +394,7 @@ class Documentation:
396 """ 394 """
397 return self.__groups.keys() 395 return self.__groups.keys()
398 396
399 def group_content(self,group_name): 397 def group_content(self, group_name):
400 """ 398 """
401 Return a list of keys/names that are in a specefic 399 Return a list of keys/names that are in a specefic
402 group or the empty list 400 group or the empty list
@@ -412,7 +410,7 @@ def parse_cmdline(args):
412 Parse the CMD line and return the result as a n-tuple 410 Parse the CMD line and return the result as a n-tuple
413 """ 411 """
414 412
415 parser = optparse.OptionParser( version = "Bitbake Documentation Tool Core version %s, %%prog version %s" % (bb.__version__,__version__)) 413 parser = optparse.OptionParser( version = "Bitbake Documentation Tool Core version %s, %%prog version %s" % (bb.__version__, __version__))
416 usage = """%prog [options] 414 usage = """%prog [options]
417 415
418Create a set of html pages (documentation) for a bitbake.conf.... 416Create a set of html pages (documentation) for a bitbake.conf....
@@ -428,7 +426,7 @@ Create a set of html pages (documentation) for a bitbake.conf....
428 parser.add_option( "-D", "--debug", help = "Increase the debug level", 426 parser.add_option( "-D", "--debug", help = "Increase the debug level",
429 action = "count", dest = "debug", default = 0 ) 427 action = "count", dest = "debug", default = 0 )
430 428
431 parser.add_option( "-v","--verbose", help = "output more chit-char to the terminal", 429 parser.add_option( "-v", "--verbose", help = "output more chit-char to the terminal",
432 action = "store_true", dest = "verbose", default = False ) 430 action = "store_true", dest = "verbose", default = False )
433 431
434 options, args = parser.parse_args( sys.argv ) 432 options, args = parser.parse_args( sys.argv )
@@ -443,7 +441,7 @@ def main():
443 The main Method 441 The main Method
444 """ 442 """
445 443
446 (config_file,output_dir) = parse_cmdline( sys.argv ) 444 (config_file, output_dir) = parse_cmdline( sys.argv )
447 445
448 # right to let us load the file now 446 # right to let us load the file now
449 try: 447 try: