Commits

haypo  committed 343d3e3

ParserList.print_(): write short version (disabled by default)

  • Participants
  • Parent commits 3a7a4d5

Comments (0)

Files changed (1)

File hachoir-parser/hachoir_parser/parser_list.py

             print title
         else:
             print _("List of Hachoir parsers.")
+        print
 
         # Create parser list sorted by module
         for category in sorted(self.bycategory.iterkeys()):
-            print
-            print "[%s]" % category
-            parser_list = sorted(self.bycategory[category],
-                key=lambda parser: parser.tags["id"])
-            for parser in parser_list:
-                self.printParser(parser, verbose)
-        print
+            if False:
+                parser_list = [ parser.tags["id"] for parser in self.bycategory[category] ]
+                parser_list.sort()
+                print "- %s: %s" % (category.title(), ", ".join(parser_list))
+            else:
+                print "[%s]" % category
+                parser_list = sorted(self.bycategory[category],
+                    key=lambda parser: parser.tags["id"])
+                for parser in parser_list:
+                    self.printParser(parser, verbose)
+                print
         print "Total: %s parsers" % len(self.parser_list)
 
     def __getitem__(self, key):