diff options
author | gbrandl <devnull@localhost> | 2006-10-30 10:52:36 +0100 |
---|---|---|
committer | gbrandl <devnull@localhost> | 2006-10-30 10:52:36 +0100 |
commit | 5555cc89b14f0d30438d04eb535ca8c61fa6bd8a (patch) | |
tree | 152353a7fc55194412e5f871ea85451e0873e1f9 /pygments/formatters/bbcode.py | |
parent | 2c0b1bae7a5f3416b75ca76fc93cad8bf422a08d (diff) | |
download | pygments-5555cc89b14f0d30438d04eb535ca8c61fa6bd8a.tar.gz |
[svn] More pylint fixes, update BBcode formatter to new style API.
Diffstat (limited to 'pygments/formatters/bbcode.py')
-rw-r--r-- | pygments/formatters/bbcode.py | 18 |
1 files changed, 9 insertions, 9 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 |