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 /serializer.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 'serializer.py')
-rw-r--r-- | serializer.py | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/serializer.py b/serializer.py index 125729e..b461ca6 100644 --- a/serializer.py +++ b/serializer.py @@ -6,17 +6,16 @@ import re try: from .error import YAMLError - from .events import * - from .nodes import * + from .events import * # NOQA + from .nodes import * # NOQA from .compat import nprint, DBG_NODE, dbg except (ImportError, ValueError): # for Jython from ruamel.yaml.error import YAMLError - from ruamel.yaml.events import * - from ruamel.yaml.nodes import * + from ruamel.yaml.events import * # NOQA + from ruamel.yaml.nodes import * # NOQA from ruamel.yaml.compat import nprint, DBG_NODE, dbg - class SerializerError(YAMLError): pass @@ -27,7 +26,6 @@ class Serializer(object): ANCHOR_TEMPLATE = u'id%03d' ANCHOR_RE = re.compile(u'id(?!000$)\\d{3,}') - def __init__(self, encoding=None, explicit_start=None, explicit_end=None, version=None, tags=None): self.use_encoding = encoding @@ -168,5 +166,6 @@ class Serializer(object): self.emit(MappingEndEvent(comment=[map_comment, end_comment])) self.ascend_resolver() + def templated_id(s): return Serializer.ANCHOR_RE.match(s) |