def _string_node_dump(self, key, node, f, env_escape_ok): state = node.state values = node.value.split("\n") for comment in node.comments: f.write(self._comment_format(comment)) value0 = values.pop(0) if env_escape_ok: value0 = env_var_escape(value0) f.write(state + key + self.char_assign + value0) f.write("\n") if values: indent = " " * len(state + key) for v in values: if env_escape_ok: v = env_var_escape(v) f.write(indent + self.char_assign + v + "\n")
def _string_node_dump(self, key, node, handle, env_escape_ok): """Helper for self.dump(). Return text representation of a string node. """ state = node.state values = node.value.split("\n") for comment in node.comments: handle.write(self._comment_format(comment)) value0 = values.pop(0) if env_escape_ok: value0 = env_var_escape(value0) handle.write(state + key + self.char_assign + value0) handle.write("\n") if values: indent = " " * len(state + key) for value in values: if env_escape_ok: value = env_var_escape(value) handle.write(indent + self.char_assign + value + "\n")