summaryrefslogtreecommitdiff
path: root/tokens.py
diff options
context:
space:
mode:
authorAnthon van der Neut <anthon@mnt.org>2018-08-03 22:14:57 +0200
committerAnthon van der Neut <anthon@mnt.org>2018-08-03 22:14:57 +0200
commitdce10fcff1de54121fb8b440b883ef5d3fe2f96a (patch)
tree072b4bd247e6f1cd95c08c7b67fea0fc96f0578e /tokens.py
parent2966a4f215861fa05e0dc7e0cd53350766e794c6 (diff)
downloadruamel.yaml-dce10fcff1de54121fb8b440b883ef5d3fe2f96a.tar.gz
Apply oitnb and mypy 0.620, then make everything work again0.15.48
Diffstat (limited to 'tokens.py')
-rw-r--r--tokens.py20
1 files changed, 10 insertions, 10 deletions
diff --git a/tokens.py b/tokens.py
index 94b1c10..54a8bd7 100644
--- a/tokens.py
+++ b/tokens.py
@@ -8,7 +8,7 @@ SHOWLINES = True
class Token(object):
- __slots__ = 'start_mark', 'end_mark', '_comment',
+ __slots__ = 'start_mark', 'end_mark', '_comment'
def __init__(self, start_mark, end_mark):
# type: (Any, Any) -> None
@@ -21,8 +21,7 @@ class Token(object):
# hasattr('self', key)]
attributes = [key for key in self.__slots__ if not key.endswith('_mark')]
attributes.sort()
- arguments = u', '.join([u'%s=%r' % (key, getattr(self, key))
- for key in attributes])
+ arguments = u', '.join([u'%s=%r' % (key, getattr(self, key)) for key in attributes])
if SHOWLINES:
try:
arguments += u', line: ' + str(self.start_mark.line)
@@ -102,8 +101,9 @@ class Token(object):
# class BOMToken(Token):
# id = '<byte order mark>'
+
class DirectiveToken(Token):
- __slots__ = 'name', 'value',
+ __slots__ = 'name', 'value'
id = '<directive>'
def __init__(self, name, value, start_mark, end_mark):
@@ -124,7 +124,7 @@ class DocumentEndToken(Token):
class StreamStartToken(Token):
- __slots__ = 'encoding',
+ __slots__ = ('encoding',)
id = '<stream start>'
def __init__(self, start_mark=None, end_mark=None, encoding=None):
@@ -198,7 +198,7 @@ class FlowEntryToken(Token):
class AliasToken(Token):
- __slots__ = 'value',
+ __slots__ = ('value',)
id = '<alias>'
def __init__(self, value, start_mark, end_mark):
@@ -208,7 +208,7 @@ class AliasToken(Token):
class AnchorToken(Token):
- __slots__ = 'value',
+ __slots__ = ('value',)
id = '<anchor>'
def __init__(self, value, start_mark, end_mark):
@@ -218,7 +218,7 @@ class AnchorToken(Token):
class TagToken(Token):
- __slots__ = 'value',
+ __slots__ = ('value',)
id = '<tag>'
def __init__(self, value, start_mark, end_mark):
@@ -228,7 +228,7 @@ class TagToken(Token):
class ScalarToken(Token):
- __slots__ = 'value', 'plain', 'style',
+ __slots__ = 'value', 'plain', 'style'
id = '<scalar>'
def __init__(self, value, plain, start_mark, end_mark, style=None):
@@ -240,7 +240,7 @@ class ScalarToken(Token):
class CommentToken(Token):
- __slots__ = 'value', 'pre_done',
+ __slots__ = 'value', 'pre_done'
id = '<comment>'
def __init__(self, value, start_mark, end_mark):