aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/python/PyYAML/py2/yaml/emitter.py
diff options
context:
space:
mode:
authorshadchin <shadchin@yandex-team.ru>2022-02-10 16:44:30 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:44:30 +0300
commit2598ef1d0aee359b4b6d5fdd1758916d5907d04f (patch)
tree012bb94d777798f1f56ac1cec429509766d05181 /contrib/python/PyYAML/py2/yaml/emitter.py
parent6751af0b0c1b952fede40b19b71da8025b5d8bcf (diff)
downloadydb-2598ef1d0aee359b4b6d5fdd1758916d5907d04f.tar.gz
Restoring authorship annotation for <shadchin@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'contrib/python/PyYAML/py2/yaml/emitter.py')
-rw-r--r--contrib/python/PyYAML/py2/yaml/emitter.py22
1 files changed, 11 insertions, 11 deletions
diff --git a/contrib/python/PyYAML/py2/yaml/emitter.py b/contrib/python/PyYAML/py2/yaml/emitter.py
index 23c25ca80a..7c18ba5c30 100644
--- a/contrib/python/PyYAML/py2/yaml/emitter.py
+++ b/contrib/python/PyYAML/py2/yaml/emitter.py
@@ -8,13 +8,13 @@
__all__ = ['Emitter', 'EmitterError']
-import sys
-
+import sys
+
from error import YAMLError
from events import *
-has_ucs4 = sys.maxunicode > 0xffff
-
+has_ucs4 = sys.maxunicode > 0xffff
+
class EmitterError(YAMLError):
pass
@@ -45,7 +45,7 @@ class Emitter(object):
# The stream should have the methods `write` and possibly `flush`.
self.stream = stream
- # Encoding can be overridden by STREAM-START.
+ # Encoding can be overridden by STREAM-START.
self.encoding = None
# Emitter is a state machine with a stack of states to handle nested
@@ -659,7 +659,7 @@ class Emitter(object):
flow_indicators = True
# First character or preceded by a whitespace.
- preceded_by_whitespace = True
+ preceded_by_whitespace = True
# Last character or followed by a whitespace.
followed_by_whitespace = (len(scalar) == 1 or
@@ -678,7 +678,7 @@ class Emitter(object):
# Check for indicators.
if index == 0:
# Leading indicators are special characters.
- if ch in u'#,[]{}&*!|>\'\"%@`':
+ if ch in u'#,[]{}&*!|>\'\"%@`':
flow_indicators = True
block_indicators = True
if ch in u'?:':
@@ -696,7 +696,7 @@ class Emitter(object):
flow_indicators = True
if followed_by_whitespace:
block_indicators = True
- if ch == u'#' and preceded_by_whitespace:
+ if ch == u'#' and preceded_by_whitespace:
flow_indicators = True
block_indicators = True
@@ -705,8 +705,8 @@ class Emitter(object):
line_breaks = True
if not (ch == u'\n' or u'\x20' <= ch <= u'\x7E'):
if (ch == u'\x85' or u'\xA0' <= ch <= u'\uD7FF'
- or u'\uE000' <= ch <= u'\uFFFD'
- or (u'\U00010000' <= ch < u'\U0010ffff')) and ch != u'\uFEFF':
+ or u'\uE000' <= ch <= u'\uFFFD'
+ or (u'\U00010000' <= ch < u'\U0010ffff')) and ch != u'\uFEFF':
unicode_characters = True
if not self.allow_unicode:
special_characters = True
@@ -738,7 +738,7 @@ class Emitter(object):
# Prepare for the next character.
index += 1
- preceded_by_whitespace = (ch in u'\0 \t\r\n\x85\u2028\u2029')
+ preceded_by_whitespace = (ch in u'\0 \t\r\n\x85\u2028\u2029')
followed_by_whitespace = (index+1 >= len(scalar) or
scalar[index+1] in u'\0 \t\r\n\x85\u2028\u2029')