##// END OF EJS Templates
ui: remove _write() and _write_err() functions
Yuya Nishihara -
r40576:06e841e7 default
parent child Browse files
Show More
@@ -951,12 +951,6 b' class ui(object):'
951 951
952 952 def _writenobuf(self, dest, *args, **opts):
953 953 self._progclear()
954 if dest is self.fout:
955 write = self._write
956 elif dest is self.ferr:
957 write = self._write_err
958 else:
959 raise error.ProgrammingError('unsupported file to write')
960 954 msg = b''.join(args)
961 955
962 956 # opencode timeblockedsection because this is a critical path
@@ -967,12 +961,12 b' class ui(object):'
967 961 if self._colormode == 'win32':
968 962 # windows color printing is its own can of crab, defer to
969 963 # the color module and that is it.
970 color.win32print(self, write, msg, **opts)
964 color.win32print(self, dest.write, msg, **opts)
971 965 else:
972 966 if self._colormode is not None:
973 967 label = opts.get(r'label', '')
974 968 msg = self.label(msg, label)
975 write(msg)
969 dest.write(msg)
976 970 # stderr may be buffered under win32 when redirected to files,
977 971 # including stdout.
978 972 if dest is self.ferr and not getattr(self.ferr, 'closed', False):
@@ -987,18 +981,12 b' class ui(object):'
987 981 self._blockedtimes['stdio_blocked'] += \
988 982 (util.timer() - starttime) * 1000
989 983
990 def _write(self, data):
991 self.fout.write(data)
992
993 984 def write_err(self, *args, **opts):
994 985 if self._bufferstates and self._bufferstates[-1][0]:
995 986 self.write(*args, **opts)
996 987 else:
997 988 self._writenobuf(self.ferr, *args, **opts)
998 989
999 def _write_err(self, data):
1000 self.ferr.write(data)
1001
1002 990 def flush(self):
1003 991 # opencode timeblockedsection because this is a critical path
1004 992 starttime = util.timer()
General Comments 0
You need to be logged in to leave comments. Login now