本文整理汇总了Python中topydo.lib.Todo.Todo.priority方法的典型用法代码示例。如果您正苦于以下问题:Python Todo.priority方法的具体用法?Python Todo.priority怎么用?Python Todo.priority使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类topydo.lib.Todo.Todo
的用法示例。
在下文中一共展示了Todo.priority方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_priority_color1
# 需要导入模块: from topydo.lib.Todo import Todo [as 别名]
# 或者: from topydo.lib.Todo.Todo import priority [as 别名]
def test_priority_color1(self):
config("test/data/ColorsTest1.conf")
todo_a = Todo('(A) Foo')
todo_b = Todo('(B) Bar')
todo_c = Todo('(C) FooBar')
color_a = config().priority_color(todo_a.priority()).as_ansi()
color_b = config().priority_color(todo_b.priority()).as_ansi()
color_c = config().priority_color(todo_c.priority()).as_ansi()
self.assertEqual(color_a, '\033[0;31m')
self.assertEqual(color_b, '\033[0;32m')
self.assertEqual(color_c, '\033[0;33m')
示例2: test_priority_color3
# 需要导入模块: from topydo.lib.Todo import Todo [as 别名]
# 或者: from topydo.lib.Todo.Todo import priority [as 别名]
def test_priority_color3(self):
config("test/data/ColorsTest3.conf")
todo_a = Todo('(A) Foo')
todo_b = Todo('(B) Bar')
todo_z = Todo('(Z) FooBar')
todo_d = Todo('(D) Baz')
todo_c = Todo('(C) FooBaz')
color_a = config().priority_color(todo_a.priority()).as_ansi()
color_b = config().priority_color(todo_b.priority()).as_ansi()
color_z = config().priority_color(todo_z.priority()).as_ansi()
color_d = config().priority_color(todo_d.priority()).as_ansi()
color_c = config().priority_color(todo_c.priority()).as_ansi()
self.assertEqual(color_a, '\033[0;35m')
self.assertEqual(color_b, '\033[0;1;36m')
self.assertEqual(color_z, NEUTRAL_COLOR)
self.assertEqual(color_d, '\033[0;31m')
self.assertEqual(color_c, '\033[0;37m')
示例3: test_empty_colorscheme
# 需要导入模块: from topydo.lib.Todo import Todo [as 别名]
# 或者: from topydo.lib.Todo.Todo import priority [as 别名]
def test_empty_colorscheme(self):
config("test/data/config1")
project_color = config().project_color().as_ansi(p_decoration='bold')
context_color = config().context_color().as_ansi(p_decoration='bold')
link_color = config().link_color().as_ansi(p_decoration='underline')
metadata_color = config().metadata_color().as_ansi(p_decoration='bold')
todo_a = Todo('(A) Foo')
todo_b = Todo('(B) Bar')
todo_c = Todo('(C) FooBar')
color_a = config().priority_color(todo_a.priority()).as_ansi()
color_b = config().priority_color(todo_b.priority()).as_ansi()
color_c = config().priority_color(todo_c.priority()).as_ansi()
self.assertEqual(color_a, '\033[0;36m')
self.assertEqual(color_b, '\033[0;33m')
self.assertEqual(color_c, '\033[0;34m')
self.assertEqual(project_color, '\033[1;31m')
self.assertEqual(context_color, '\033[1;35m')
self.assertEqual(link_color, '\033[4;36m')
self.assertEqual(metadata_color, '\033[1;32m')
示例4: test_empty_color_values
# 需要导入模块: from topydo.lib.Todo import Todo [as 别名]
# 或者: from topydo.lib.Todo.Todo import priority [as 别名]
def test_empty_color_values(self):
config("test/data/ColorsTest5.conf")
project_color = config().project_color().as_ansi(p_decoration='bold')
context_color = config().context_color().as_ansi(p_decoration='bold')
link_color = config().link_color().as_ansi(p_decoration='underline')
metadata_color = config().metadata_color().as_ansi(p_decoration='bold')
todo_a = Todo('(A) Foo')
todo_b = Todo('(B) Bar')
todo_c = Todo('(C) FooBar')
color_a = config().priority_color(todo_a.priority()).as_ansi()
color_b = config().priority_color(todo_b.priority()).as_ansi()
color_c = config().priority_color(todo_c.priority()).as_ansi()
self.assertEqual(color_a, NEUTRAL_COLOR)
self.assertEqual(color_b, NEUTRAL_COLOR)
self.assertEqual(color_c, NEUTRAL_COLOR)
self.assertEqual(project_color, '')
self.assertEqual(context_color, '')
self.assertEqual(link_color, '')
self.assertEqual(metadata_color, '')