Coding style.

This commit is contained in:
Andrew Hamilton 2018-01-12 15:02:28 +10:00
parent b8732c3028
commit ddd139f69f

View file

@ -8,20 +8,18 @@ import sys
ESC = "\x1b" ESC = "\x1b"
normal = ESC + "(B\x1b[m"
bold = ESC + "[1m"
normal = ESC + "(B\x1b[m" # sgr0 "[0m" ? italic = ESC + "[3m"
bold = ESC + "[1m" # bold standout = ESC + "[7m"
italic = ESC + "[3m" # sitm underline = ESC + "[4m"
standout = ESC + "[7m" # smso enter_fullscreen = ESC + "[?1049h"
underline = ESC + "[4m" # smul exit_fullscreen = ESC + "[?1049l"
enter_fullscreen = ESC + "[?1049h" # smcup hide_cursor = ESC + "[?25l"
exit_fullscreen = ESC + "[?1049l" # rmcup normal_cursor = ESC + "[?25l\x1b[?25h"
hide_cursor = ESC + "[?25l" # civis clear = ESC + "[H\x1b[2J"
normal_cursor = ESC + "[?25l\x1b[?25h" # cnorm save = ESC + "7"
clear = ESC + "[H\x1b[2J" # clear restore = ESC + "8"
save = ESC + "7" # sc
restore = ESC + "8" # rc
def color(color_number, is_foreground): def color(color_number, is_foreground):
@ -32,7 +30,7 @@ def rgb_color(rgb, is_foreground):
return "\x1b[%s;2;" % ("38" if is_foreground else "48") + "%i;%i;%im" % rgb return "\x1b[%s;2;" % ("38" if is_foreground else "48") + "%i;%i;%im" % rgb
def move(x, y): # cup def move(x, y):
return "\x1b[%i;%iH" % (y + 1, x + 1) return "\x1b[%i;%iH" % (y + 1, x + 1)