summaryrefslogtreecommitdiffstats
path: root/bin/bitdoc
diff options
context:
space:
mode:
authorChris Larson <chris_larson@mentor.com>2010-06-20 12:08:07 -0700
committerChris Larson <chris_larson@mentor.com>2010-06-21 08:05:12 -0700
commit219be63895b20daa646066ae52872ce90a9da1e8 (patch)
treeedc4d84d6d995a899152e3058ceb589b01702d6c /bin/bitdoc
parent40925230781ddd550bf21d90714c5349f9240a51 (diff)
downloadbitbake-219be63895b20daa646066ae52872ce90a9da1e8.tar.gz
Apply some 2to3 refactorings
Diffstat (limited to 'bin/bitdoc')
-rwxr-xr-xbin/bitdoc26
1 files changed, 12 insertions, 14 deletions
diff --git a/bin/bitdoc b/bin/bitdoc
index 4940f660a..8043b2bd1 100755
--- a/bin/bitdoc
+++ b/bin/bitdoc
@@ -48,7 +48,7 @@ class HTMLFormatter:
From pydoc... almost identical at least
"""
while pairs:
- (a,b) = pairs[0]
+ (a, b) = pairs[0]
text = join(split(text, a), b)
pairs = pairs[1:]
return text
@@ -87,7 +87,7 @@ class HTMLFormatter:
return txt + ",".join(txts)
- def groups(self,item):
+ def groups(self, item):
"""
Create HTML to link to related groups
"""
@@ -99,12 +99,12 @@ class HTMLFormatter:
txt = "<p><b>See also:</b><br>"
txts = []
for group in item.groups():
- txts.append( """<a href="group%s.html">%s</a> """ % (group,group) )
+ txts.append( """<a href="group%s.html">%s</a> """ % (group, group) )
return txt + ",".join(txts)
- def createKeySite(self,item):
+ def createKeySite(self, item):
"""
Create a site for a key. It contains the header/navigator, a heading,
the description, links to related keys and to the groups.
@@ -149,8 +149,7 @@ class HTMLFormatter:
"""
groups = ""
- sorted_groups = doc.groups()
- sorted_groups.sort()
+ sorted_groups = sorted(doc.groups())
for group in sorted_groups:
groups += """<a href="group%s.html">%s</a><br>""" % (group, group)
@@ -185,8 +184,7 @@ class HTMLFormatter:
Create Overview of all avilable keys
"""
keys = ""
- sorted_keys = doc.doc_keys()
- sorted_keys.sort()
+ sorted_keys = sorted(doc.doc_keys())
for key in sorted_keys:
keys += """<a href="key%s.html">%s</a><br>""" % (key, key)
@@ -214,7 +212,7 @@ class HTMLFormatter:
description += "<h2 Description of Grozp %s</h2>" % gr
description += _description
- items.sort(lambda x,y:cmp(x.name(),y.name()))
+ items.sort(lambda x, y:cmp(x.name(), y.name()))
for group in items:
groups += """<a href="key%s.html">%s</a><br>""" % (group.name(), group.name())
@@ -343,7 +341,7 @@ class DocumentationItem:
def addGroup(self, group):
self._groups.append(group)
- def addRelation(self,relation):
+ def addRelation(self, relation):
self._related.append(relation)
def sort(self):
@@ -396,7 +394,7 @@ class Documentation:
"""
return self.__groups.keys()
- def group_content(self,group_name):
+ def group_content(self, group_name):
"""
Return a list of keys/names that are in a specefic
group or the empty list
@@ -412,7 +410,7 @@ def parse_cmdline(args):
Parse the CMD line and return the result as a n-tuple
"""
- parser = optparse.OptionParser( version = "Bitbake Documentation Tool Core version %s, %%prog version %s" % (bb.__version__,__version__))
+ parser = optparse.OptionParser( version = "Bitbake Documentation Tool Core version %s, %%prog version %s" % (bb.__version__, __version__))
usage = """%prog [options]
Create 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....
parser.add_option( "-D", "--debug", help = "Increase the debug level",
action = "count", dest = "debug", default = 0 )
- parser.add_option( "-v","--verbose", help = "output more chit-char to the terminal",
+ parser.add_option( "-v", "--verbose", help = "output more chit-char to the terminal",
action = "store_true", dest = "verbose", default = False )
options, args = parser.parse_args( sys.argv )
@@ -443,7 +441,7 @@ def main():
The main Method
"""
- (config_file,output_dir) = parse_cmdline( sys.argv )
+ (config_file, output_dir) = parse_cmdline( sys.argv )
# right to let us load the file now
try: