equal
deleted
inserted
replaced
1105 |
1105 |
1106 @property |
1106 @property |
1107 def fout(self): |
1107 def fout(self): |
1108 return self._fout |
1108 return self._fout |
1109 |
1109 |
|
1110 @util.propertycache |
|
1111 def _fout_is_a_tty(self): |
|
1112 self._isatty(self._fout) |
|
1113 |
1110 @fout.setter |
1114 @fout.setter |
1111 def fout(self, f): |
1115 def fout(self, f): |
1112 self._fout = f |
1116 self._fout = f |
1113 self._fmsgout, self._fmsgerr = _selectmsgdests(self) |
1117 self._fmsgout, self._fmsgerr = _selectmsgdests(self) |
|
1118 if '_fout_is_a_tty' in vars(self): |
|
1119 del self._fout_is_a_tty |
1114 |
1120 |
1115 @property |
1121 @property |
1116 def ferr(self): |
1122 def ferr(self): |
1117 return self._ferr |
1123 return self._ferr |
1118 |
1124 |
1232 else: |
1238 else: |
1233 self._buffers[-1].extend(args) |
1239 self._buffers[-1].extend(args) |
1234 return |
1240 return |
1235 |
1241 |
1236 # inlined _writenobuf() for speed |
1242 # inlined _writenobuf() for speed |
1237 if not opts.get('keepprogressbar', False): |
1243 if not opts.get('keepprogressbar', self._fout_is_a_tty): |
1238 self._progclear() |
1244 self._progclear() |
1239 msg = b''.join(args) |
1245 msg = b''.join(args) |
1240 |
1246 |
1241 # opencode timeblockedsection because this is a critical path |
1247 # opencode timeblockedsection because this is a critical path |
1242 starttime = util.timer() |
1248 starttime = util.timer() |
1271 else: |
1277 else: |
1272 self._writenobuf(dest, *args, **opts) |
1278 self._writenobuf(dest, *args, **opts) |
1273 |
1279 |
1274 def _writenobuf(self, dest, *args: bytes, **opts: _MsgOpts) -> None: |
1280 def _writenobuf(self, dest, *args: bytes, **opts: _MsgOpts) -> None: |
1275 # update write() as well if you touch this code |
1281 # update write() as well if you touch this code |
1276 if not opts.get('keepprogressbar', False): |
1282 if not opts.get('keepprogressbar', self._fout_is_a_tty): |
1277 self._progclear() |
1283 self._progclear() |
1278 msg = b''.join(args) |
1284 msg = b''.join(args) |
1279 |
1285 |
1280 # opencode timeblockedsection because this is a critical path |
1286 # opencode timeblockedsection because this is a critical path |
1281 starttime = util.timer() |
1287 starttime = util.timer() |