Commits

Anonymous committed 1e6a677

Fix ParserList.print_(): first argument is now the title and not 'out'.
If out is not specified, use sys.stdout.

  • Participants
  • Parent commits 01b23a3

Comments (0)

Files changed (2)

File hachoir-parser/ChangeLog

  * HachoirParserList() is no more a singleton:
    use HachoirParserList.getInstance() to get a singleton
  * createParser() has an option tags argument: can be used to force a parser
+ * Fix ParserList.print_(): first argument is now the title and not 'out'.
+   If out is not specified, use sys.stdout.
 
 What's new in hachoir-parser 1.2.1?
 ===================================

File hachoir-parser/hachoir_parser/parser_list.py

 from hachoir_core.error import error
 from hachoir_core.i18n import _
 from hachoir_parser import Parser, HachoirParser
+import sys
 
 ### Parser list ################################################################
 
     def __iter__(self):
         return iter(self.parser_list)
 
-    def print_(self, out, title=None, verbose=False, format="one-line"):
+    def print_(self, title=None, out=None, verbose=False, format="one-line"):
         """Display a list of parser with its title
          * out: output file
          * title : title of the list to display
          * format: "rest", "trac", "file-ext", "mime" or "one_line" (default)
         """
+        if out is None:
+            out = sys.stdout
 
         if format in ("file-ext", "mime"):
             # Create file extension set