Skip to content

Commit

Permalink
hachoir-core: create method UnicodeStdout.writelines()
Browse files Browse the repository at this point in the history
  • Loading branch information
Victor Stinner committed Feb 20, 2010
1 parent f8a16b0 commit 186f90c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion hachoir-core/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
hachoir-core 1.3.3
==================

XXX
* Add writelines() method to UnicodeStdout

hachoir-core 1.3.2 (2010-01-28)
===============================
Expand Down
6 changes: 5 additions & 1 deletion hachoir-core/hachoir_core/i18n.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def getTerminalCharset():
getTerminalCharset.value = _getTerminalCharset()
return getTerminalCharset.value

class UnicodeStdout:
class UnicodeStdout(object):
def __init__(self, old_device, charset):
self.device = old_device
self.charset = charset
Expand All @@ -79,6 +79,10 @@ def write(self, text):
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:
Expand Down

0 comments on commit 186f90c

Please sign in to comment.