Changeset 3429 for pykota/trunk/pykota/tool.py
- Timestamp:
- 10/05/08 11:21:53 (16 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/pykota/tool.py
r3413 r3429 47 47 def __init__(self, app, size=None) : 48 48 """Initializes the engine.""" 49 self.isatty = sys.stdout.isatty() 49 50 self.app = app 50 51 self.size = None … … 63 64 def display(self, msg) : 64 65 """Displays the value.""" 65 self.app.display(msg) 66 if self.isatty : 67 self.app.display(msg) 68 sys.stdout.flush() 66 69 67 70 def oneMore(self) : … … 151 154 152 155 def display(self, message) : 153 """Display a message but only if stdout is a tty.""" 154 if sys.stdout.isatty() : 155 sys.stdout.write(message.encode(self.charset, \ 156 """Display a message after ensuring the correct charset is used.""" 157 sys.stdout.write(message.encode(self.charset, 156 158 "replace")) 157 sys.stdout.flush()158 159 159 160 def logdebug(self, message) :