本文整理汇总了Python中pypeline.node.CommandNode._teardown方法的典型用法代码示例。如果您正苦于以下问题:Python CommandNode._teardown方法的具体用法?Python CommandNode._teardown怎么用?Python CommandNode._teardown使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pypeline.node.CommandNode
的用法示例。
在下文中一共展示了CommandNode._teardown方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _teardown
# 需要导入模块: from pypeline.node import CommandNode [as 别名]
# 或者: from pypeline.node.CommandNode import _teardown [as 别名]
def _teardown(self, config, temp):
# Picard creates a folder named after the user in the temp-root
try_rmtree(os.path.join(temp, getpass.getuser()))
# Some JREs may create a folder for temporary performance counters
try_rmtree(os.path.join(temp, "hsperfdata_" + getpass.getuser()))
CommandNode._teardown(self, config, temp)
示例2: _teardown
# 需要导入模块: from pypeline.node import CommandNode [as 别名]
# 或者: from pypeline.node.CommandNode import _teardown [as 别名]
def _teardown(self, config, temp):
os.remove(os.path.join(temp, "RAxML_info.output"))
source = os.path.join(temp, "RAxML_parsimonyTree.output.0")
destination = fileutils.reroot_path(temp, self._output_tree)
fileutils.move_file(source, destination)
CommandNode._teardown(self, config, temp)
示例3: _teardown
# 需要导入模块: from pypeline.node import CommandNode [as 别名]
# 或者: from pypeline.node.CommandNode import _teardown [as 别名]
def _teardown(self, config, temp):
template = self._output_template
bootstraps = self._bootstrap_num
start = self._bootstrap_start
for (src_file, dst_file) in self._bootstraps(template, bootstraps, start):
src_file = os.path.join(temp, src_file)
dst_file = fileutils.reroot_path(temp, dst_file)
fileutils.move_file(src_file, dst_file)
CommandNode._teardown(self, config, temp)
示例4: _teardown
# 需要导入模块: from pypeline.node import CommandNode [as 别名]
# 或者: from pypeline.node.CommandNode import _teardown [as 别名]
def _teardown(self, config, temp):
fileutils.move_file(os.path.join(temp, "RAxML_info.Pypeline"),
os.path.join(temp, fileutils.swap_ext(self._output_alignment, ".info")))
fileutils.move_file(os.path.join(temp, "input.alignment.BS0"),
os.path.join(temp, self._output_alignment))
os.remove(os.path.join(temp, "input.alignment"))
os.remove(os.path.join(temp, "input.partition"))
CommandNode._teardown(self, config, temp)
示例5: test_commandnode_teardown__missing_optional_files
# 需要导入模块: from pypeline.node import CommandNode [as 别名]
# 或者: from pypeline.node.CommandNode import _teardown [as 别名]
def test_commandnode_teardown__missing_optional_files(temp_folder):
destination, temp_folder = _setup_temp_folders(temp_folder)
cmd = AtomicCmd(("echo", "-n", "1 2 3"),
TEMP_OUT_BAR = "bar.txt",
OUT_STDOUT = os.path.join(destination, "foo.txt"))
cmd.run(temp_folder)
assert_equal(cmd.join(), [0])
node = CommandNode(cmd)
node._teardown(None, temp_folder)
assert_equal(os.listdir(temp_folder), [])
assert_equal(os.listdir(destination), ["foo.txt"])
示例6: test_commandnode_teardown
# 需要导入模块: from pypeline.node import CommandNode [as 别名]
# 或者: from pypeline.node.CommandNode import _teardown [as 别名]
def test_commandnode_teardown(temp_folder):
destination, temp_folder = _setup_temp_folders(temp_folder)
cmd = AtomicCmd(("echo", "-n", "1 2 3"),
OUT_STDOUT = os.path.join(destination, "foo.txt"))
cmd.run(temp_folder)
assert_equal(cmd.join(), [0])
node = CommandNode(cmd)
assert os.path.exists(os.path.join(temp_folder, "foo.txt"))
assert not os.path.exists(os.path.join(destination, "foo.txt"))
node._teardown(None, temp_folder)
assert not os.path.exists(os.path.join(temp_folder, "foo.txt"))
assert os.path.exists(os.path.join(destination, "foo.txt"))
示例7: test_commandnode_teardown__commit
# 需要导入模块: from pypeline.node import CommandNode [as 别名]
# 或者: from pypeline.node.CommandNode import _teardown [as 别名]
def test_commandnode_teardown__commit(temp_folder):
cmd_mock = _build_cmd_mock()
cmd_mock.should_receive("commit").with_args(temp_folder).once
node = CommandNode(cmd_mock)
node._teardown(None, temp_folder)
示例8: _teardown
# 需要导入模块: from pypeline.node import CommandNode [as 别名]
# 或者: from pypeline.node.CommandNode import _teardown [as 别名]
def _teardown(self, config, temp):
"""See CommandNode._teardown."""
os.remove(reroot_path(temp, self._infile))
CommandNode._teardown(self, config, temp)
示例9: _teardown
# 需要导入模块: from pypeline.node import CommandNode [as 别名]
# 或者: from pypeline.node.CommandNode import _teardown [as 别名]
def _teardown(self, config, temp):
os.rename(os.path.join(temp, self._basename) + ".calmd",
os.path.join(temp, self._basename))
CommandNode._teardown(self, config, temp)
示例10: _teardown
# 需要导入模块: from pypeline.node import CommandNode [as 别名]
# 或者: from pypeline.node.CommandNode import _teardown [as 别名]
def _teardown(self, config, temp):
for filename in os.listdir(temp):
if filename.endswith(".txt") or filename.endswith(".pdf") or filename.endswith(".csv"):
if not filename.startswith("pipe_"):
os.remove(os.path.join(temp, filename))
CommandNode._teardown(self, config, temp)