##// END OF EJS Templates
pager: remove pager code from core
Matt Mackall -
r6325:41c77bb8 default
parent child Browse files
Show More
@@ -535,12 +535,6 b' ui::'
535 535 Print debugging information. True or False. Default is False.
536 536 editor;;
537 537 The editor to use during a commit. Default is $EDITOR or "vi".
538 pager;;
539 The pager that is used when displaying long output.
540 Default is $PAGER. If not set, the output is written to the
541 stdandard output.
542 usepager;;
543 If set to true, the system pager is used. True or False. Default is False.
544 538 fallbackencoding;;
545 539 Encoding to try if it's not possible to decode the changelog using
546 540 UTF-8. Default is ISO-8859-1.
@@ -31,7 +31,6 b' class ui(object):'
31 31 parentui=None):
32 32 self.overlay = None
33 33 self.buffers = []
34 self.pager = None
35 34 if parentui is None:
36 35 # this is the parent of all ui children
37 36 self.parentui = None
@@ -66,15 +65,6 b' class ui(object):'
66 65 def __getattr__(self, key):
67 66 return getattr(self.parentui, key)
68 67
69 def __del__(self):
70 if self.pager:
71 try:
72 self.pager.close()
73 except IOException:
74 # we might get into an broken pipe if the users quit
75 # the pager before we finished io
76 pass
77
78 68 def isatty(self):
79 69 if ui._isatty is None:
80 70 ui._isatty = sys.stdin.isatty()
@@ -381,14 +371,9 b' class ui(object):'
381 371 return "".join(self.buffers.pop())
382 372
383 373 def write(self, *args):
384 """Write to a pager if available, otherwise to stdout"""
385 374 if self.buffers:
386 375 self.buffers[-1].extend([str(a) for a in args])
387 376 else:
388 if self.getpager() and not self.pager:
389 self.pager = os.popen(self.getpager(), "wb")
390 sys.stderr = self.pager
391 sys.stdout = self.pager
392 377 for a in args:
393 378 sys.stdout.write(str(a))
394 379
@@ -493,9 +478,3 b' class ui(object):'
493 478 self.config("ui", "editor") or
494 479 os.environ.get("VISUAL") or
495 480 os.environ.get("EDITOR", "vi"))
496
497 def getpager(self):
498 '''return a pager'''
499 if sys.stdout.isatty() and self.configbool("ui", "usepager", False):
500 return (self.config("ui", "pager")
501 or os.environ.get("PAGER"))
General Comments 0
You need to be logged in to leave comments. Login now