Mercurial > hg
comparison mercurial/ui.py @ 8132:cece135ffcf0
ui: move _isatty near user
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Thu, 23 Apr 2009 15:40:10 -0500 |
parents | 57fee79e5588 |
children | 57a2a0070d6b |
comparison
equal
deleted
inserted
replaced
8131:b0d945b95105 | 8132:cece135ffcf0 |
---|---|
22 dest.add_section(section) | 22 dest.add_section(section) |
23 for name, value in source.items(section, raw=True): | 23 for name, value in source.items(section, raw=True): |
24 dest.set(section, name, value) | 24 dest.set(section, name, value) |
25 | 25 |
26 class ui(object): | 26 class ui(object): |
27 _isatty = None | |
28 | |
29 def __init__(self, verbose=False, debug=False, quiet=False, | 27 def __init__(self, verbose=False, debug=False, quiet=False, |
30 interactive=True, traceback=False, report_untrusted=True, | 28 interactive=True, traceback=False, report_untrusted=True, |
31 parentui=None): | 29 parentui=None): |
32 self.overlay = None | 30 self.overlay = None |
33 self.buffers = [] | 31 self.buffers = [] |
67 self.buffers = parentui.buffers | 65 self.buffers = parentui.buffers |
68 | 66 |
69 def __getattr__(self, key): | 67 def __getattr__(self, key): |
70 return getattr(self.parentui, key) | 68 return getattr(self.parentui, key) |
71 | 69 |
70 _isatty = None | |
72 def isatty(self): | 71 def isatty(self): |
73 if ui._isatty is None: | 72 if ui._isatty is None: |
74 ui._isatty = sys.stdin.isatty() | 73 ui._isatty = sys.stdin.isatty() |
75 return ui._isatty | 74 return ui._isatty |
76 | 75 |