Commits

Victor Stinner committed 526416b

hachoir-core: create method UnicodeStdout.writelines()

  • Participants
  • Parent commits c961298

Comments (0)

Files changed (2)

File hachoir-core/ChangeLog

 hachoir-core 1.3.3
 ==================
 
-XXX
+ * Add writelines() method to UnicodeStdout
 
 hachoir-core 1.3.2 (2010-01-28)
 ===============================

File hachoir-core/hachoir_core/i18n.py

         getTerminalCharset.value = _getTerminalCharset()
         return getTerminalCharset.value
 
-class UnicodeStdout:
+class UnicodeStdout(object):
     def __init__(self, old_device, charset):
         self.device = old_device
         self.charset = charset
             text = text.encode(self.charset, 'replace')
         self.device.write(text)
 
+    def writelines(self, lines):
+        for text in lines:
+            self.write(text)
+
 def initLocale():
     # Only initialize locale once
     if initLocale.is_done: