Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
joocer committed Jan 31, 2023
1 parent 7d2ff0a commit 58113cc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
5 changes: 3 additions & 2 deletions opteryx/utils/colors.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@
"\001PUNCm": "\033[38;5;237m",
"\001VARCHARm": "\033[38;5;227m",
"\001CONSTm": "\033[38;5;117m",
"\001VALUEm": "\033[38;5;170m",
"\001NULLm": "\033[38;5;170m",
"\001VALUEm": "\033[38;5;12m",
"\001NUMERICm": "\033[38;5;203m",
"\001DATEm": "\033[38;5;72m",
"\001TIMEm": "\033[38;5;150m",
"\001KEYm": "\033[38;5;26m",
"\001KEYm": "\033[38;5;32m",
# Regular Colors
"\001BLACKm": "\033[0;30m", # Black
"\001REDm": "\033[0;31m", # Red
Expand Down
6 changes: 4 additions & 2 deletions opteryx/utils/display.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,10 @@ def ascii_table(

def type_formatter(value, width):

if value is None or isinstance(value, bool):
return "\001CONSTm" + str(value).center(width)[:width] + "\001OFFm"
if value is None:
return "\001NULLm" + str(value).rjust(width)[:width] + "\001OFFm"
if isinstance(value, bool):
return "\001CONSTm" + str(value).rjust(width)[:width] + "\001OFFm"
if isinstance(value, int):
return "\001NUMERICm" + str(value).rjust(width)[:width] + "\001OFFm"
if isinstance(value, float):
Expand Down

0 comments on commit 58113cc

Please sign in to comment.