mirror of
https://github.com/ejwa/gitinspector.git
synced 2024-09-30 03:11:29 +02:00
Did some minor tweaks to the strings inside the terminal module.
This commit is contained in:
parent
9b5e82bc2c
commit
c69bd515c2
@ -52,7 +52,7 @@ def __get_size_linux__():
|
|||||||
def ioctl_get_window_size(file_descriptor):
|
def ioctl_get_window_size(file_descriptor):
|
||||||
try:
|
try:
|
||||||
import fcntl, termios, struct
|
import fcntl, termios, struct
|
||||||
size = struct.unpack('hh', fcntl.ioctl(file_descriptor, termios.TIOCGWINSZ, '1234'))
|
size = struct.unpack('hh', fcntl.ioctl(file_descriptor, termios.TIOCGWINSZ, "1234"))
|
||||||
except:
|
except:
|
||||||
return DEFAULT_TERMINAL_SIZE
|
return DEFAULT_TERMINAL_SIZE
|
||||||
|
|
||||||
@ -95,9 +95,9 @@ def get_size():
|
|||||||
if sys.stdout.isatty():
|
if sys.stdout.isatty():
|
||||||
current_os = platform.system()
|
current_os = platform.system()
|
||||||
|
|
||||||
if current_os == 'Windows':
|
if current_os == "Windows":
|
||||||
(width, height) = __get_size_windows__()
|
(width, height) = __get_size_windows__()
|
||||||
elif current_os == 'Linux' or current_os == 'Darwin' or current_os.startswith('CYGWIN'):
|
elif current_os == "Linux" or current_os == "Darwin" or current_os.startswith("CYGWIN"):
|
||||||
(width, height) = __get_size_linux__()
|
(width, height) = __get_size_linux__()
|
||||||
|
|
||||||
if width > 0:
|
if width > 0:
|
||||||
@ -107,7 +107,7 @@ def get_size():
|
|||||||
|
|
||||||
def set_stdout_encoding():
|
def set_stdout_encoding():
|
||||||
if not sys.stdout.isatty() and sys.version_info < (3,):
|
if not sys.stdout.isatty() and sys.version_info < (3,):
|
||||||
sys.stdout = codecs.getwriter('utf-8')(sys.stdout)
|
sys.stdout = codecs.getwriter("utf-8")(sys.stdout)
|
||||||
|
|
||||||
def convert_command_line_to_utf8():
|
def convert_command_line_to_utf8():
|
||||||
try:
|
try:
|
||||||
|
Loading…
Reference in New Issue
Block a user