本文整理匯總了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