diff options
author | Anthon van der Neut <anthon@mnt.org> | 2016-02-16 21:16:30 +0100 |
---|---|---|
committer | Anthon van der Neut <anthon@mnt.org> | 2016-02-16 21:16:30 +0100 |
commit | a5f5028c7d5623a13b392d8e9bdb9be622476f8c (patch) | |
tree | 8622585e8067711fcd86cda71d289f46b1309b75 /scalarstring.py | |
parent | 64c39f0c0b38bcac13cb4c31429b5e3caadf278e (diff) | |
download | ruamel.yaml-a5f5028c7d5623a13b392d8e9bdb9be622476f8c.tar.gz |
- make sure there is a space before # if scalar pushes (through indent)
a comment from its original column
- flake 8
Diffstat (limited to 'scalarstring.py')
-rw-r--r-- | scalarstring.py | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/scalarstring.py b/scalarstring.py index 59951c9..48636f4 100644 --- a/scalarstring.py +++ b/scalarstring.py @@ -9,7 +9,6 @@ except (ImportError, ValueError): # for Jython from ruamel.yaml.compat import text_type - class ScalarString(text_type): def __new__(cls, *args, **kw): return text_type.__new__(cls, *args, **kw) @@ -19,6 +18,7 @@ class PreservedScalarString(ScalarString): def __new__(cls, value): return ScalarString.__new__(cls, value) + def preserve_literal(s): return PreservedScalarString(s.replace('\r\n', '\n').replace('\r', '\n')) @@ -31,7 +31,6 @@ def walk_tree(base): """ from ruamel.yaml.compat import string_types - if isinstance(base, dict): for k in base: v = base[k] |