aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/python/Pygments/py2/pygments/formatters
diff options
context:
space:
mode:
authorshadchin <shadchin@yandex-team.ru>2022-02-10 16:44:39 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:44:39 +0300
commite9656aae26e0358d5378e5b63dcac5c8dbe0e4d0 (patch)
tree64175d5cadab313b3e7039ebaa06c5bc3295e274 /contrib/python/Pygments/py2/pygments/formatters
parent2598ef1d0aee359b4b6d5fdd1758916d5907d04f (diff)
downloadydb-e9656aae26e0358d5378e5b63dcac5c8dbe0e4d0.tar.gz
Restoring authorship annotation for <shadchin@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'contrib/python/Pygments/py2/pygments/formatters')
-rw-r--r--contrib/python/Pygments/py2/pygments/formatters/__init__.py4
-rw-r--r--contrib/python/Pygments/py2/pygments/formatters/html.py2
-rw-r--r--contrib/python/Pygments/py2/pygments/formatters/img.py16
-rw-r--r--contrib/python/Pygments/py2/pygments/formatters/other.py14
-rw-r--r--contrib/python/Pygments/py2/pygments/formatters/rtf.py4
5 files changed, 20 insertions, 20 deletions
diff --git a/contrib/python/Pygments/py2/pygments/formatters/__init__.py b/contrib/python/Pygments/py2/pygments/formatters/__init__.py
index 329a21c0e4..6f1130a801 100644
--- a/contrib/python/Pygments/py2/pygments/formatters/__init__.py
+++ b/contrib/python/Pygments/py2/pygments/formatters/__init__.py
@@ -108,8 +108,8 @@ def load_formatter_from_file(filename, formattername="CustomFormatter",
# And finally instantiate it with the options
return formatter_class(**options)
except IOError as err:
- raise ClassNotFound('cannot read %s: %s' % (filename, err))
- except ClassNotFound:
+ raise ClassNotFound('cannot read %s: %s' % (filename, err))
+ except ClassNotFound:
raise
except Exception as err:
raise ClassNotFound('error when loading custom formatter: %s' % err)
diff --git a/contrib/python/Pygments/py2/pygments/formatters/html.py b/contrib/python/Pygments/py2/pygments/formatters/html.py
index 9c8bff0547..042f04cfb1 100644
--- a/contrib/python/Pygments/py2/pygments/formatters/html.py
+++ b/contrib/python/Pygments/py2/pygments/formatters/html.py
@@ -435,7 +435,7 @@ class HtmlFormatter(Formatter):
self.linenostep = abs(get_int_opt(options, 'linenostep', 1))
self.linenospecial = abs(get_int_opt(options, 'linenospecial', 0))
self.nobackground = get_bool_opt(options, 'nobackground', False)
- self.lineseparator = options.get('lineseparator', u'\n')
+ self.lineseparator = options.get('lineseparator', u'\n')
self.lineanchors = options.get('lineanchors', '')
self.linespans = options.get('linespans', '')
self.anchorlinenos = options.get('anchorlinenos', False)
diff --git a/contrib/python/Pygments/py2/pygments/formatters/img.py b/contrib/python/Pygments/py2/pygments/formatters/img.py
index d1737a7a74..6bb3364458 100644
--- a/contrib/python/Pygments/py2/pygments/formatters/img.py
+++ b/contrib/python/Pygments/py2/pygments/formatters/img.py
@@ -46,9 +46,9 @@ STYLES = {
}
# A sane default for modern systems
-DEFAULT_FONT_NAME_NIX = 'DejaVu Sans Mono'
+DEFAULT_FONT_NAME_NIX = 'DejaVu Sans Mono'
DEFAULT_FONT_NAME_WIN = 'Courier New'
-DEFAULT_FONT_NAME_MAC = 'Menlo'
+DEFAULT_FONT_NAME_MAC = 'Menlo'
class PilNotAvailable(ImportError):
@@ -125,8 +125,8 @@ class FontManager(object):
for font_dir in (os.path.join(os.getenv("HOME"), 'Library/Fonts/'),
'/Library/Fonts/', '/System/Library/Fonts/'):
font_map.update(
- (os.path.splitext(f)[0].lower(), os.path.join(font_dir, f))
- for f in os.listdir(font_dir) if f.lower().endswith('ttf'))
+ (os.path.splitext(f)[0].lower(), os.path.join(font_dir, f))
+ for f in os.listdir(font_dir) if f.lower().endswith('ttf'))
for name in STYLES['NORMAL']:
path = self._get_mac_font_path(font_map, self.font_name, name)
@@ -237,8 +237,8 @@ class ImageFormatter(Formatter):
bold and italic fonts will be generated. This really should be a
monospace font to look sane.
- Default: "Courier New" on Windows, "Menlo" on Mac OS, and
- "DejaVu Sans Mono" on \\*nix
+ Default: "Courier New" on Windows, "Menlo" on Mac OS, and
+ "DejaVu Sans Mono" on \\*nix
`font_size`
The font size in points to be used.
@@ -522,8 +522,8 @@ class ImageFormatter(Formatter):
rectw = self.image_pad + self.line_number_width - self.line_number_pad
draw.rectangle([(0, 0), (rectw, recth)],
fill=self.line_number_bg)
- if self.line_number_separator:
- draw.line([(rectw, 0), (rectw, recth)], fill=self.line_number_fg)
+ if self.line_number_separator:
+ draw.line([(rectw, 0), (rectw, recth)], fill=self.line_number_fg)
del draw
def format(self, tokensource, outfile):
diff --git a/contrib/python/Pygments/py2/pygments/formatters/other.py b/contrib/python/Pygments/py2/pygments/formatters/other.py
index f3fe919a50..c09eff0cb4 100644
--- a/contrib/python/Pygments/py2/pygments/formatters/other.py
+++ b/contrib/python/Pygments/py2/pygments/formatters/other.py
@@ -10,7 +10,7 @@
"""
from pygments.formatter import Formatter
-from pygments.util import get_choice_opt
+from pygments.util import get_choice_opt
from pygments.token import Token
from pygments.console import colorize
@@ -87,17 +87,17 @@ class RawTokenFormatter(Formatter):
if self.compress == 'gz':
import gzip
outfile = gzip.GzipFile('', 'wb', 9, outfile)
-
+
def write(text):
outfile.write(text.encode())
flush = outfile.flush
elif self.compress == 'bz2':
import bz2
compressor = bz2.BZ2Compressor(9)
-
+
def write(text):
outfile.write(compressor.compress(text.encode()))
-
+
def flush():
outfile.write(compressor.flush())
outfile.flush()
@@ -118,15 +118,15 @@ class RawTokenFormatter(Formatter):
write("%s\t%r\n" % (ttype, value))
flush()
-
+
TESTCASE_BEFORE = u'''\
- def testNeedsName(lexer):
+ def testNeedsName(lexer):
fragment = %r
tokens = [
'''
TESTCASE_AFTER = u'''\
]
- assert list(lexer.get_tokens(fragment)) == tokens
+ assert list(lexer.get_tokens(fragment)) == tokens
'''
diff --git a/contrib/python/Pygments/py2/pygments/formatters/rtf.py b/contrib/python/Pygments/py2/pygments/formatters/rtf.py
index b980b19281..1246db2a73 100644
--- a/contrib/python/Pygments/py2/pygments/formatters/rtf.py
+++ b/contrib/python/Pygments/py2/pygments/formatters/rtf.py
@@ -35,7 +35,7 @@ class RtfFormatter(Formatter):
``'default'``).
`fontface`
- The used font family, for example ``Bitstream Vera Sans``. Defaults to
+ The used font family, for example ``Bitstream Vera Sans``. Defaults to
some generic font which is supposed to have fixed width.
`fontsize`
@@ -70,7 +70,7 @@ class RtfFormatter(Formatter):
.replace(u'}', u'\\}')
def _escape_text(self, text):
- # empty strings, should give a small performance improvement
+ # empty strings, should give a small performance improvement
if not text:
return u''