当前位置: 首页>>代码示例>>Python>>正文


Python ListCommand.execute方法代码示例

本文整理汇总了Python中topydo.commands.ListCommand.ListCommand.execute方法的典型用法代码示例。如果您正苦于以下问题:Python ListCommand.execute方法的具体用法?Python ListCommand.execute怎么用?Python ListCommand.execute使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在topydo.commands.ListCommand.ListCommand的用法示例。


在下文中一共展示了ListCommand.execute方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_list09

# 需要导入模块: from topydo.commands.ListCommand import ListCommand [as 别名]
# 或者: from topydo.commands.ListCommand.ListCommand import execute [as 别名]
    def test_list09(self):
        command = ListCommand(["--", "-project1", "-Drink"], self.todolist, self.out, self.error)
        command.execute()

        self.assertFalse(self.todolist.dirty)
        self.assertEqual(self.output, "|  5| (C) 13 + 29 = 42\n|  2| (D) Bar @Context1 +Project2\n")
        self.assertEqual(self.errors, "")
开发者ID:MinchinWeb,项目名称:topydo,代码行数:9,代码来源:test_list_command.py

示例2: test_list10

# 需要导入模块: from topydo.commands.ListCommand import ListCommand [as 别名]
# 或者: from topydo.commands.ListCommand.ListCommand import execute [as 别名]
    def test_list10(self):
        command = ListCommand(["text1", "2"], self.todolist, self.out, self.error)
        command.execute()

        self.assertFalse(self.todolist.dirty)
        self.assertEqual(self.output, "|  2| (D) Bar @Context1 +Project2\n")
        self.assertEqual(self.errors, "")
开发者ID:MinchinWeb,项目名称:topydo,代码行数:9,代码来源:test_list_command.py

示例3: test_list_format47

# 需要导入模块: from topydo.commands.ListCommand import ListCommand [as 别名]
# 或者: from topydo.commands.ListCommand.ListCommand import execute [as 别名]
    def test_list_format47(self):
        command = ListCommand(["-x", "-F", "%(r)"], self.todolist, self.out, self.error)
        command.execute()

        error = 'Error while parsing format string (list_format config option or -F)\n'
        self.assertEqual(self.output, '')
        self.assertEqual(self.errors, error)
开发者ID:rcraggs,项目名称:topydo,代码行数:9,代码来源:test_list_format.py

示例4: test_list8

# 需要导入模块: from topydo.commands.ListCommand import ListCommand [as 别名]
# 或者: from topydo.commands.ListCommand.ListCommand import execute [as 别名]
    def test_list8(self):
        command = ListCommand(["--", "-project1"], self.todolist, self.out, self.error)
        command.execute()

        self.assertFalse(self.todolist.is_dirty())
        self.assertEqual(self.output, "|  4| (C) Drink beer @ home\n|  5| (C) 13 + 29 = 42\n|  2| (D) Bar @Context1 +Project2\n")
        self.assertEqual(self.errors, "")
开发者ID:netimen,项目名称:topydo,代码行数:9,代码来源:ListCommandTest.py

示例5: test_list7

# 需要导入模块: from topydo.commands.ListCommand import ListCommand [as 别名]
# 或者: from topydo.commands.ListCommand.ListCommand import execute [as 别名]
    def test_list7(self):
        command = ListCommand(["-s", "text", "-x", "Project1"], self.todolist, self.out, self.error)
        command.execute()

        self.assertFalse(self.todolist.is_dirty())
        self.assertEqual(self.output, "|  3| (C) Baz @Context1 +Project1 key:value\n|  1| (C) Foo @Context2 [email protected] +Project1 Not+Project\n")
        self.assertEqual(self.errors, "")
开发者ID:netimen,项目名称:topydo,代码行数:9,代码来源:ListCommandTest.py

示例6: test_list17

# 需要导入模块: from topydo.commands.ListCommand import ListCommand [as 别名]
# 或者: from topydo.commands.ListCommand.ListCommand import execute [as 别名]
    def test_list17(self):
        command = ListCommand(["-x", "id:"], self.todolist, self.out, self.error)
        command.execute()

        self.assertFalse(self.todolist.dirty)
        self.assertEqual(self.output, "|  3| (C) Baz @Context1 +Project1 key:value\n")
        self.assertEqual(self.errors, "")
开发者ID:MinchinWeb,项目名称:topydo,代码行数:9,代码来源:test_list_command.py

示例7: test_list15

# 需要导入模块: from topydo.commands.ListCommand import ListCommand [as 别名]
# 或者: from topydo.commands.ListCommand.ListCommand import execute [as 别名]
    def test_list15(self):
        command = ListCommand(["p:<10"], self.todolist, self.out, self.error)
        command.execute()

        self.assertFalse(self.todolist.is_dirty())
        self.assertEqual(self.output, "|  2| (D) Bar @Context1 +Project2\n")
        self.assertEqual(self.errors, "")
开发者ID:rameshg87,项目名称:topydo,代码行数:9,代码来源:test_list_command.py

示例8: test_list05

# 需要导入模块: from topydo.commands.ListCommand import ListCommand [as 别名]
# 或者: from topydo.commands.ListCommand.ListCommand import execute [as 别名]
    def test_list05(self):
        command = ListCommand(["-x"], self.todolist, self.out, self.error)
        command.execute()

        self.assertFalse(self.todolist.is_dirty())
        self.assertEqual(self.output, "|  1| (C) 2015-11-05 Foo @Context2 [email protected] +Project1 Not+Project\n|  3| (C) Baz @Context1 +Project1 key:value\n|  4| (C) Drink beer @ home\n|  5| (C) 13 + 29 = 42\n|  2| (D) Bar @Context1 +Project2\n|  6| x 2014-12-12 Completed but with date:2014-12-12\n")
        self.assertEqual(self.errors, "")
开发者ID:rameshg87,项目名称:topydo,代码行数:9,代码来源:test_list_command.py

示例9: test_list18

# 需要导入模块: from topydo.commands.ListCommand import ListCommand [as 别名]
# 或者: from topydo.commands.ListCommand.ListCommand import execute [as 别名]
    def test_list18(self):
        command = ListCommand(["-x", "date:2014-12-12"], self.todolist,
                              self.out, self.error)
        command.execute()

        self.assertFalse(self.todolist.is_dirty())
        self.assertEqual(self.output, "|  6| x 2014-12-12 Completed but with date:2014-12-12\n")
开发者ID:rameshg87,项目名称:topydo,代码行数:9,代码来源:test_list_command.py

示例10: test_list42

# 需要导入模块: from topydo.commands.ListCommand import ListCommand [as 别名]
# 或者: from topydo.commands.ListCommand.ListCommand import execute [as 别名]
    def test_list42(self):
        command = ListCommand(["-x", "+Project1", "-id:1"], self.todolist,
                              self.out, self.error)
        command.execute()

        self.assertEqual(self.output, "|  1| (C) 2015-11-05 Foo @Context2 [email protected] +Project1 Not+Project\n")
        self.assertEqual(self.errors, "")
开发者ID:rameshg87,项目名称:topydo,代码行数:9,代码来源:test_list_command.py

示例11: test_list31

# 需要导入模块: from topydo.commands.ListCommand import ListCommand [as 别名]
# 或者: from topydo.commands.ListCommand.ListCommand import execute [as 别名]
    def test_list31(self):
        """ Don't show any todos with -n 0 """
        command = ListCommand(["-n", "0"], self.todolist, self.out, self.error)
        command.execute()

        self.assertEqual(self.output, "")
        self.assertEqual(self.errors, "")
开发者ID:rameshg87,项目名称:topydo,代码行数:9,代码来源:test_list_command.py

示例12: test_list35

# 需要导入模块: from topydo.commands.ListCommand import ListCommand [as 别名]
# 或者: from topydo.commands.ListCommand.ListCommand import execute [as 别名]
    def test_list35(self):
        """ -x flag takes precedence over -n """
        command = ListCommand(["-x", "-n", "foo"], self.todolist, self.out, self.error)
        command.execute()

        self.assertEqual(self.output, "|  1| (C) 2015-11-05 Foo @Context2 [email protected] +Project1 Not+Project\n|  3| (C) Baz @Context1 +Project1 key:value\n|  4| (C) Drink beer @ home\n|  5| (C) 13 + 29 = 42\n|  2| (D) Bar @Context1 +Project2\n|  6| x 2014-12-12 Completed but with date:2014-12-12\n")
        self.assertEqual(self.errors, "")
开发者ID:rameshg87,项目名称:topydo,代码行数:9,代码来源:test_list_command.py

示例13: test_list33

# 需要导入模块: from topydo.commands.ListCommand import ListCommand [as 别名]
# 或者: from topydo.commands.ListCommand.ListCommand import execute [as 别名]
    def test_list33(self):
        """ Negative values result in showing all relevent todos. """
        command = ListCommand(["-n", "-1"], self.todolist, self.out, self.error)
        command.execute()

        self.assertEqual(self.output, "|  1| (C) 2015-11-05 Foo @Context2 [email protected] +Project1 Not+Project\n|  4| (C) Drink beer @ home\n|  5| (C) 13 + 29 = 42\n|  2| (D) Bar @Context1 +Project2\n")
        self.assertEqual(self.errors, "")
开发者ID:rameshg87,项目名称:topydo,代码行数:9,代码来源:test_list_command.py

示例14: test_list06

# 需要导入模块: from topydo.commands.ListCommand import ListCommand [as 别名]
# 或者: from topydo.commands.ListCommand.ListCommand import execute [as 别名]
    def test_list06(self):
        command = ListCommand(["Project3"], self.todolist, self.out, self.error)
        command.execute()

        self.assertFalse(self.todolist.dirty)
        self.assertEqual(self.output, "")
        self.assertEqual(self.errors, "")
开发者ID:MinchinWeb,项目名称:topydo,代码行数:9,代码来源:test_list_command.py

示例15: test_list32

# 需要导入模块: from topydo.commands.ListCommand import ListCommand [as 别名]
# 或者: from topydo.commands.ListCommand.ListCommand import execute [as 别名]
    def test_list32(self):
        """ Only show the top todo. """
        command = ListCommand(["-n", "1"], self.todolist, self.out, self.error)
        command.execute()

        self.assertEqual(self.output, "|  1| (C) 2015-11-05 Foo @Context2 [email protected] +Project1 Not+Project\n")
        self.assertEqual(self.errors, "")
开发者ID:rameshg87,项目名称:topydo,代码行数:9,代码来源:test_list_command.py


注:本文中的topydo.commands.ListCommand.ListCommand.execute方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。