Skip to content
This repository has been archived by the owner on Dec 7, 2021. It is now read-only.

Create unicode_tables.py #42

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 69 additions & 0 deletions terminaltables/unicode_tables.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
"""Tables using unicode box drawing characters defined here."""

from terminaltables.ascii_table import AsciiTable

class UnicodeSingleTable(AsciiTable):
"""Draw a table using box-drawing characters.
"""
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove newline from here so both """ are on the same line as per pep8.

CHAR_F_INNER_HORIZONTAL = '─'
CHAR_F_INNER_INTERSECT = '┼'
CHAR_F_INNER_VERTICAL = '│'
CHAR_F_OUTER_LEFT_INTERSECT = '├'
CHAR_F_OUTER_LEFT_VERTICAL = '│'
CHAR_F_OUTER_RIGHT_INTERSECT = '┤'
CHAR_F_OUTER_RIGHT_VERTICAL = '│'
CHAR_H_INNER_HORIZONTAL = '─'
CHAR_H_INNER_INTERSECT = '┼'
CHAR_H_INNER_VERTICAL = '│'
CHAR_H_OUTER_LEFT_INTERSECT = '├'
CHAR_H_OUTER_LEFT_VERTICAL = '│'
CHAR_H_OUTER_RIGHT_INTERSECT = '┤'
CHAR_H_OUTER_RIGHT_VERTICAL = '│'
CHAR_INNER_HORIZONTAL = '─'
CHAR_INNER_INTERSECT = '┼'
CHAR_INNER_VERTICAL = '│'
CHAR_OUTER_BOTTOM_HORIZONTAL = '─'
CHAR_OUTER_BOTTOM_INTERSECT = '┴'
CHAR_OUTER_BOTTOM_LEFT = '└'
CHAR_OUTER_BOTTOM_RIGHT = '┘'
CHAR_OUTER_LEFT_INTERSECT = '├'
CHAR_OUTER_LEFT_VERTICAL = '│'
CHAR_OUTER_RIGHT_INTERSECT = '┤'
CHAR_OUTER_RIGHT_VERTICAL = '│'
CHAR_OUTER_TOP_HORIZONTAL = '─'
CHAR_OUTER_TOP_INTERSECT = '┬'
CHAR_OUTER_TOP_LEFT = '┌'
CHAR_OUTER_TOP_RIGHT = '┐'

class UnicodeDoubleTable(AsciiTable):
"""Draw a table using double lined box-drawing characters.
"""
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above.

CHAR_F_INNER_HORIZONTAL = '═'
CHAR_F_INNER_INTERSECT = '╬'
CHAR_F_INNER_VERTICAL = '║'
CHAR_F_OUTER_LEFT_INTERSECT = '╠'
CHAR_F_OUTER_LEFT_VERTICAL = '║'
CHAR_F_OUTER_RIGHT_INTERSECT = '╣'
CHAR_F_OUTER_RIGHT_VERTICAL = '║'
CHAR_H_INNER_HORIZONTAL = '═'
CHAR_H_INNER_INTERSECT = '╬'
CHAR_H_INNER_VERTICAL = '║'
CHAR_H_OUTER_LEFT_INTERSECT = '╠'
CHAR_H_OUTER_LEFT_VERTICAL = '║'
CHAR_H_OUTER_RIGHT_INTERSECT = '╣'
CHAR_H_OUTER_RIGHT_VERTICAL = '║'
CHAR_INNER_HORIZONTAL = '═'
CHAR_INNER_INTERSECT = '╬'
CHAR_INNER_VERTICAL = '║'
CHAR_OUTER_BOTTOM_HORIZONTAL = '═'
CHAR_OUTER_BOTTOM_INTERSECT = '╩'
CHAR_OUTER_BOTTOM_LEFT = '╚'
CHAR_OUTER_BOTTOM_RIGHT = '╝'
CHAR_OUTER_LEFT_INTERSECT = '╠'
CHAR_OUTER_LEFT_VERTICAL = '║'
CHAR_OUTER_RIGHT_INTERSECT = '╣'
CHAR_OUTER_RIGHT_VERTICAL = '║'
CHAR_OUTER_TOP_HORIZONTAL = '═'
CHAR_OUTER_TOP_INTERSECT = '╦'
CHAR_OUTER_TOP_LEFT = '╔'
CHAR_OUTER_TOP_RIGHT = '╗'