diff options
| author | Joshua Harlow <harlowja@gmail.com> | 2015-01-11 13:03:26 -0800 |
|---|---|---|
| committer | Joshua Harlow <harlowja@yahoo-inc.com> | 2015-01-12 20:33:51 -0800 |
| commit | 42a665d06f5a75672417a28375ca4e1988365aa8 (patch) | |
| tree | 6eee5a7f32668f313ac29c2e45767ae2cbe2f623 /taskflow/utils/persistence_utils.py | |
| parent | ab71a2677d8ef96c5469efc925d763dde0cd2ea3 (diff) | |
| download | taskflow-42a665d06f5a75672417a28375ca4e1988365aa8.tar.gz | |
Use platform neutral line separator(s)
To at least try to support things like windows it's better
if we can make an attempt to use the platform neutral
characters for line separator(s) where appropriate.
Change-Id: Icc533ed4d4c94f461b7f19600b74146221f17b18
Diffstat (limited to 'taskflow/utils/persistence_utils.py')
| -rw-r--r-- | taskflow/utils/persistence_utils.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/taskflow/utils/persistence_utils.py b/taskflow/utils/persistence_utils.py index b8a1535..6d5d168 100644 --- a/taskflow/utils/persistence_utils.py +++ b/taskflow/utils/persistence_utils.py @@ -15,6 +15,7 @@ # under the License. import contextlib +import os from oslo.utils import timeutils from oslo.utils import uuidutils @@ -139,7 +140,7 @@ def pformat_atom_detail(atom_detail, indent=0): lines.append("%s- failure = %s" % (" " * (indent + 1), bool(atom_detail.failure))) lines.extend(_format_meta(atom_detail.meta, indent=indent + 1)) - return "\n".join(lines) + return os.linesep.join(lines) def pformat_flow_detail(flow_detail, indent=0): @@ -149,7 +150,7 @@ def pformat_flow_detail(flow_detail, indent=0): lines.extend(_format_meta(flow_detail.meta, indent=indent + 1)) for task_detail in flow_detail: lines.append(pformat_atom_detail(task_detail, indent=indent + 1)) - return "\n".join(lines) + return os.linesep.join(lines) def pformat(book, indent=0): @@ -167,4 +168,4 @@ def pformat(book, indent=0): timeutils.isotime(book.updated_at))) for flow_detail in book: lines.append(pformat_flow_detail(flow_detail, indent=indent + 1)) - return "\n".join(lines) + return os.linesep.join(lines) |
