From ef1de9ecaf73e28234d284b79ec45e084d0f0c53 Mon Sep 17 00:00:00 2001 From: Chris Larson Date: Sun, 20 Jun 2010 12:08:07 -0700 Subject: Apply some 2to3 refactorings Signed-off-by: Richard Purdie --- bitbake/bin/bitdoc | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) (limited to 'bitbake/bin/bitdoc') 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: 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 = "

See also:
" txts = [] for group in item.groups(): - txts.append( """%s """ % (group,group) ) + txts.append( """%s """ % (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 += """%s
""" % (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 += """%s
""" % (key, key) @@ -214,7 +212,7 @@ class HTMLFormatter: description += "

" % 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 += """%s
""" % (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: -- cgit v1.2.3-54-g00ecf