From a5f5028c7d5623a13b392d8e9bdb9be622476f8c Mon Sep 17 00:00:00 2001 From: Anthon van der Neut Date: Tue, 16 Feb 2016 21:16:30 +0100 Subject: - make sure there is a space before # if scalar pushes (through indent) a comment from its original column - flake 8 --- scalarstring.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'scalarstring.py') 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] -- cgit v1.2.1