本文整理汇总了Python中Shine.CLI.TextTable.TextTable.title方法的典型用法代码示例。如果您正苦于以下问题:Python TextTable.title方法的具体用法?Python TextTable.title怎么用?Python TextTable.title使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Shine.CLI.TextTable.TextTable
的用法示例。
在下文中一共展示了TextTable.title方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_long_title_truncated
# 需要导入模块: from Shine.CLI.TextTable import TextTable [as 别名]
# 或者: from Shine.CLI.TextTable.TextTable import title [as 别名]
def test_long_title_truncated(self):
"""very wide data does not imply wery wide title"""
tbl = TextTable("%one %two")
tbl.title = "title"
tbl.append({'one': 'foobar', 'two': ' go' * 100})
self.assertEqual(str(tbl),
"== title =\n"
"ONE TWO\n"
"--- ---\n"
"foobar " + ' go' * 100)
示例2: test_title_with_color
# 需要导入模块: from Shine.CLI.TextTable import TextTable [as 别名]
# 或者: from Shine.CLI.TextTable.TextTable import title [as 别名]
def test_title_with_color(self):
"""display with title and color"""
tbl = TextTable("%filesystem %two")
tbl.title = "title"
tbl.color = True
tbl.append({'filesystem': 'foo', 'two': 'bar'})
self.assertEqual(str(tbl),
"====\033[34m title \033[0m===\n"
"\033[34mFILESYSTEM TWO\033[0m\n"
"---------- ---\n"
"foo bar")
示例3: test_title
# 需要导入模块: from Shine.CLI.TextTable import TextTable [as 别名]
# 或者: from Shine.CLI.TextTable.TextTable import title [as 别名]
def test_title(self):
"""display with a simple title"""
tbl = TextTable("%one")
tbl.title = "test title"
tbl.append({'one': 'foo'})
self.assertEqual(str(tbl), "= test title =\nONE\n---\nfoo")