summaryrefslogtreecommitdiff
path: root/pygments/formatters
diff options
context:
space:
mode:
Diffstat (limited to 'pygments/formatters')
-rw-r--r--pygments/formatters/bbcode.py18
-rw-r--r--pygments/formatters/html.py2
-rw-r--r--pygments/formatters/latex.py2
-rw-r--r--pygments/formatters/other.py2
4 files changed, 12 insertions, 12 deletions
diff --git a/pygments/formatters/bbcode.py b/pygments/formatters/bbcode.py
index 223d1110..a03afdb1 100644
--- a/pygments/formatters/bbcode.py
+++ b/pygments/formatters/bbcode.py
@@ -41,25 +41,25 @@ class BBCodeFormatter(Formatter):
def __init__(self, **options):
Formatter.__init__(self, **options)
- self._make_styles()
self._code = get_bool_opt(options, 'codetag', False)
self._mono = get_bool_opt(options, 'monofont', False)
+ self.styles = {}
+ self._make_styles()
+
def _make_styles(self):
- self.styles = {}
- for token, style in self.style._styles.iteritems():
+ for ttype, ndef in self.style:
start = end = ''
- color, bold, italic, underline, bg, border = style
- if color:
- start += '[color=#%s]' % color
+ if ndef['color']:
+ start += '[color=#%s]' % ndef['color']
end = '[/color]' + end
- if bold:
+ if ndef['bold']:
start += '[b]'
end = '[/b]' + end
- if italic:
+ if ndef['italic']:
start += '[i]'
end = '[/i]' + end
- if underline:
+ if ndef['underline']:
start += '[u]'
end = '[/u]' + end
# there are no common BBcodes for background-color and border
diff --git a/pygments/formatters/html.py b/pygments/formatters/html.py
index 97e49161..782fb2c7 100644
--- a/pygments/formatters/html.py
+++ b/pygments/formatters/html.py
@@ -12,7 +12,7 @@ import StringIO
from pygments.formatter import Formatter
from pygments.token import Token, Text, STANDARD_TYPES
-from pygments.util import get_bool_opt, get_int_opt, get_list_opt
+from pygments.util import get_bool_opt, get_int_opt
__all__ = ['HtmlFormatter']
diff --git a/pygments/formatters/latex.py b/pygments/formatters/latex.py
index 52796a7e..3cc9d219 100644
--- a/pygments/formatters/latex.py
+++ b/pygments/formatters/latex.py
@@ -147,7 +147,7 @@ class LatexFormatter(Formatter):
if cmndef != '#1'])
def format(self, tokensource, outfile):
- #XXX: add support for background colors!!!!!!!111!1
+ # TODO: add support for background colors
if self.full:
realoutfile = outfile
diff --git a/pygments/formatters/other.py b/pygments/formatters/other.py
index 0660f0c3..a3657bbb 100644
--- a/pygments/formatters/other.py
+++ b/pygments/formatters/other.py
@@ -10,7 +10,7 @@
"""
from pygments.formatter import Formatter
-import StringIO
+
__all__ = ['NullFormatter', 'RawTokenFormatter']