summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2016-02-15 08:50:55 +0100
committerGeorg Brandl <georg@python.org>2016-02-15 08:50:55 +0100
commitb570292e9f851e5ca98e879b40749dd212f2b554 (patch)
tree4849a072ad574b7ca2376241e5c6e07e6c61e91c
parent96372ec5bd65fcc95c1dbffdba4475d3e8e425f7 (diff)
parenta34c939edf7b8b3f008daa3c1b7e2c94d34db550 (diff)
downloadpygments-b570292e9f851e5ca98e879b40749dd212f2b554.tar.gz
merge
-rw-r--r--doc/docs/styles.rst2
-rw-r--r--pygments/formatters/terminal256.py8
-rw-r--r--pygments/style.py4
-rw-r--r--pygments/styles/arduino.py2
4 files changed, 8 insertions, 8 deletions
diff --git a/doc/docs/styles.rst b/doc/docs/styles.rst
index 394c8ed2..1094a270 100644
--- a/doc/docs/styles.rst
+++ b/doc/docs/styles.rst
@@ -154,7 +154,7 @@ Terminal Styles
Custom styles used with the 256-color terminal formatter can also map colors to
use the 8 default ANSI colors. To do so, use ``#ansigreen``, ``#ansired`` or
-any other colors defined in :attr:`pygments.style.ansilist`. Foreground ANSI
+any other colors defined in :attr:`pygments.style.ansicolors`. Foreground ANSI
colors will be mapped to the corresponding `escape codes 30 to 37
<https://en.wikipedia.org/wiki/ANSI_escape_code#Colors>`_ thus respecting any
custom color mapping and themes provided by many terminal emulators. Light
diff --git a/pygments/formatters/terminal256.py b/pygments/formatters/terminal256.py
index 03c3a42a..5110bc9e 100644
--- a/pygments/formatters/terminal256.py
+++ b/pygments/formatters/terminal256.py
@@ -28,7 +28,7 @@ import sys
from pygments.formatter import Formatter
from pygments.console import codes
-from pygments.style import ansilist
+from pygments.style import ansicolors
__all__ = ['Terminal256Formatter', 'TerminalTrueColorFormatter']
@@ -49,7 +49,7 @@ class EscapeSequence:
def color_string(self):
attrs = []
if self.fg is not None:
- if self.fg in ansilist:
+ if self.fg in ansicolors:
esc = codes[self.fg[5:]]
if ';01m' in esc:
self.bold = True
@@ -58,7 +58,7 @@ class EscapeSequence:
else:
attrs.extend(("38", "5", "%i" % self.fg))
if self.bg is not None:
- if self.bg in ansilist:
+ if self.bg in ansicolors:
esc = codes[self.bg[5:]]
# extract fg color code, add 10 for bg.
attrs.append(str(int(esc[2:4])+10))
@@ -188,7 +188,7 @@ class Terminal256Formatter(Formatter):
def _color_index(self, color):
index = self.best_match.get(color, None)
- if color in ansilist:
+ if color in ansicolors:
# strip the `#ansi` part and look up code
index = color
self.best_match[color] = index
diff --git a/pygments/style.py b/pygments/style.py
index 797a1d34..68ee3a19 100644
--- a/pygments/style.py
+++ b/pygments/style.py
@@ -33,7 +33,7 @@ _ansimap = {
'#ansiturquoise': '00ffff',
'#ansiwhite': 'ffffff',
}
-ansilist = set(_ansimap)
+ansicolors = set(_ansimap)
class StyleMeta(type):
@@ -45,7 +45,7 @@ class StyleMeta(type):
obj.styles[token] = ''
def colorformat(text):
- if text in ansilist:
+ if text in ansicolors:
return text
if text[0:1] == '#':
col = text[1:]
diff --git a/pygments/styles/arduino.py b/pygments/styles/arduino.py
index 5b31bb84..1bf2103c 100644
--- a/pygments/styles/arduino.py
+++ b/pygments/styles/arduino.py
@@ -95,4 +95,4 @@ class ArduinoStyle(Style):
Generic.Strong: "", # class: 'gs'
Generic.Subheading: "", # class: 'gu'
Generic.Traceback: "", # class: 'gt'
- } \ No newline at end of file
+ }