本文整理汇总了Python中rpg.command.Command.append_cmdlines方法的典型用法代码示例。如果您正苦于以下问题:Python Command.append_cmdlines方法的具体用法?Python Command.append_cmdlines怎么用?Python Command.append_cmdlines使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类rpg.command.Command
的用法示例。
在下文中一共展示了Command.append_cmdlines方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_command_concat
# 需要导入模块: from rpg.command import Command [as 别名]
# 或者: from rpg.command.Command import append_cmdlines [as 别名]
def test_command_concat(self):
cmd = Command("cd %s" % self.test_project_dir)
cmd.append_cmdlines("cmake ..")
cmd.append_cmdlines(["make", "make test"])
self.assertRaises(TypeError, cmd.append_cmdlines, 4)
expected = "cd %s\ncmake ..\nmake\nmake test" % self.test_project_dir
self.assertEqual(expected, str(cmd))
示例2: patched
# 需要导入模块: from rpg.command import Command [as 别名]
# 或者: from rpg.command.Command import append_cmdlines [as 别名]
def patched(self, project_dir, spec, sack):
if (project_dir / "CMakeLists.txt").is_file():
logging.debug('CMakeLists.txt found')
build = Command()
build.append_cmdlines("cmake " + str(project_dir))
build.append_cmdlines("make")
install = Command("make install DESTDIR=$RPM_BUILD_ROOT")
spec.scripts["%build"] = build
spec.scripts["%install"] = install