def _colors(ns): cols, _ = shutil.get_terminal_size() cmap = tools.color_style() akey = next(iter(cmap)) if isinstance(akey, str): s = _str_colors(cmap, cols) else: s = _tok_colors(cmap, cols) tools.print_color(s)
def _colors(ns): cols, _ = shutil.get_terminal_size() if ON_WINDOWS: cols -= 1 cmap = color_style() akey = next(iter(cmap)) if isinstance(akey, str): s = _str_colors(cmap, cols) else: s = _tok_colors(cmap, cols) print_color(s)
def _colors(args): columns, _ = shutil.get_terminal_size() columns -= int(ON_WINDOWS) style_stash = builtins.__xonsh__.env["XONSH_COLOR_STYLE"] if args.style is not None: if args.style not in color_style_names(): print("Invalid style: {}".format(args.style)) return builtins.__xonsh__.env["XONSH_COLOR_STYLE"] = args.style color_map = color_style() akey = next(iter(color_map)) if isinstance(akey, str): s = _str_colors(color_map, columns) else: s = _tok_colors(color_map, columns) print_color(s) builtins.__xonsh__.env["XONSH_COLOR_STYLE"] = style_stash
def _colors(args): columns, _ = shutil.get_terminal_size() columns -= int(ON_WINDOWS) style_stash = builtins.__xonsh_env__["XONSH_COLOR_STYLE"] if args.style is not None: if args.style not in color_style_names(): print("Invalid style: {}".format(args.style)) return builtins.__xonsh_env__["XONSH_COLOR_STYLE"] = args.style color_map = color_style() akey = next(iter(color_map)) if isinstance(akey, str): s = _str_colors(color_map, columns) else: s = _tok_colors(color_map, columns) print_color(s) builtins.__xonsh_env__["XONSH_COLOR_STYLE"] = style_stash