some minor updates

This commit is contained in:
Anthony Scopatz 2016-07-22 20:37:10 -04:00 committed by Leonardo Santagada
parent 093cce731f
commit 6a8d4f4428
3 changed files with 10 additions and 2 deletions

View file

@ -23,6 +23,7 @@ class _TeeOut(object):
self.buffer = buf
self.stdout = sys.stdout
self.encoding = self.stdout.encoding
self.errors = self.stdout.errors
sys.stdout = self
def __del__(self):
@ -55,6 +56,7 @@ class _TeeErr(object):
self.buffer = buf
self.stderr = sys.stderr
self.encoding = self.stderr.encoding
self.errors = self.stderr.errors
sys.stderr = self
def __del__(self):

View file

@ -110,6 +110,7 @@ DEFAULT_ENSURERS = LazyObject(lambda: {
'IGNOREEOF': (is_bool, to_bool, bool_to_str),
'INTENSIFY_COLORS_ON_WIN': (always_false, intensify_colors_on_win_setter,
bool_to_str),
'LANG': (is_string, ensure_string, ensure_string),
'LC_COLLATE': (always_false, locale_convert('LC_COLLATE'), ensure_string),
'LC_CTYPE': (always_false, locale_convert('LC_CTYPE'), ensure_string),
'LC_MESSAGES': (always_false, locale_convert('LC_MESSAGES'), ensure_string),
@ -253,6 +254,7 @@ def DEFAULT_VALUES():
'IGNOREEOF': False,
'INDENT': ' ',
'INTENSIFY_COLORS_ON_WIN': True,
'LANG': 'C.UTF-8',
'LC_CTYPE': locale.setlocale(locale.LC_CTYPE),
'LC_COLLATE': locale.setlocale(locale.LC_COLLATE),
'LC_TIME': locale.setlocale(locale.LC_TIME),
@ -429,6 +431,7 @@ DEFAULT_DOCS = LazyObject(lambda: {
'which are hard to read, are replaced with cyan. Other colors are '
'generally replaced by their bright counter parts.',
configurable=ON_WINDOWS),
'LANG': VarDocs('Fallback locale setting for systems where it matters'),
'LOADED_CONFIG': VarDocs(
'Whether or not the xonsh config file was loaded',
configurable=False),

View file

@ -336,6 +336,7 @@ def _xonfig_format_json(data):
def _info(ns):
env = builtins.__xonsh_env__
data = [
('xonsh', XONSH_VERSION),
('Git SHA', githash()),
@ -343,9 +344,9 @@ def _info(ns):
('PLY', ply.__version__),
('have readline', is_readline_available()),
('prompt toolkit', ptk_version() or None),
('shell type', builtins.__xonsh_env__.get('SHELL_TYPE')),
('shell type', env.get('SHELL_TYPE')),
('pygments', pygments_version()),
('on posix', ON_POSIX),
('on posix', bool(ON_POSIX)),
('on linux', ON_LINUX)]
if ON_LINUX:
data.append(('distro', linux_distro()))
@ -355,6 +356,8 @@ def _info(ns):
('on cygwin', ON_CYGWIN),
('is superuser', is_superuser()),
('default encoding', DEFAULT_ENCODING),
('xonsh encoding', env.get('XONSH_ENCODING')),
('encoding errors', env.get('XONSH_ENCODING_ERRORS')),
])
formatter = _xonfig_format_json if ns.json else _xonfig_format_human
s = formatter(data)