mirror of
https://github.com/kellyjonbrazil/jc.git
synced 2025-06-19 00:17:51 +02:00
fix unbuffer
This commit is contained in:
@ -68,7 +68,6 @@ class JcCli():
|
|||||||
self.custom_colors: Dict = {}
|
self.custom_colors: Dict = {}
|
||||||
self.show_hidden = False
|
self.show_hidden = False
|
||||||
self.ascii_only = False
|
self.ascii_only = False
|
||||||
self.flush = False
|
|
||||||
self.json_separators = (',', ':')
|
self.json_separators = (',', ':')
|
||||||
self.json_indent = None
|
self.json_indent = None
|
||||||
self.path_string = None
|
self.path_string = None
|
||||||
@ -386,17 +385,17 @@ Examples:
|
|||||||
"""Safely prints JSON or YAML output in both UTF-8 and ASCII systems"""
|
"""Safely prints JSON or YAML output in both UTF-8 and ASCII systems"""
|
||||||
if self.yaml_output:
|
if self.yaml_output:
|
||||||
try:
|
try:
|
||||||
print(self.yaml_out(), flush=self.flush)
|
print(self.yaml_out(), flush=self.unbuffer)
|
||||||
except UnicodeEncodeError:
|
except UnicodeEncodeError:
|
||||||
self.ascii_only = True
|
self.ascii_only = True
|
||||||
print(self.yaml_out(), flush=self.flush)
|
print(self.yaml_out(), flush=self.unbuffer)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
print(self.json_out(), flush=self.flush)
|
print(self.json_out(), flush=self.unbuffer)
|
||||||
except UnicodeEncodeError:
|
except UnicodeEncodeError:
|
||||||
self.ascii_only = True
|
self.ascii_only = True
|
||||||
print(self.json_out(), flush=self.flush)
|
print(self.json_out(), flush=self.unbuffer)
|
||||||
|
|
||||||
def magic_parser(self):
|
def magic_parser(self):
|
||||||
"""
|
"""
|
||||||
|
Reference in New Issue
Block a user