summaryrefslogtreecommitdiff
path: root/pygments
diff options
context:
space:
mode:
authorMatthias Bussonnier <bussonniermatthias@gmail.com>2016-02-14 15:17:47 -0800
committerMatthias Bussonnier <bussonniermatthias@gmail.com>2016-02-14 15:17:47 -0800
commitcb9ffed2cb5e1c17ad6438ee00ff791c17cecf5b (patch)
tree8b1f262cce1bdfe08ba937bbbaa426d50e792fa2 /pygments
parent8933a64a6eaf30645af5170b69c09904c4217b6c (diff)
downloadpygments-git-cb9ffed2cb5e1c17ad6438ee00ff791c17cecf5b.tar.gz
Rename ansilist that now is a set, slipped though PR 531 review
Diffstat (limited to 'pygments')
-rw-r--r--pygments/formatters/terminal256.py8
-rw-r--r--pygments/style.py4
-rw-r--r--pygments/styles/arduino.py2
3 files changed, 7 insertions, 7 deletions
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
+ }