Esempio n. 1
0
    def get_attrs_for_token(self, token):
        try:
            style = self.pygmens_style_cls.style_for_token(token)
            return Attrs(color=style['color'],
                         bgcolor=style['bgcolor'],
                         bold=style.get('bold', False),
                         underline=style.get('underline', False),
                         reverse=False)

        except KeyError:
            return _default_attrs
Esempio n. 2
0
        def get_attributes(token):
            try:
                style = self.pygmens_style_cls.style_for_token(token)
                return Attrs(color=style['color'],
                             bgcolor=style['bgcolor'],
                             bold=style.get('bold', False),
                             underline=style.get('underline', False),
                             reverse=False)

            except KeyError:
                return _default_attrs
Esempio n. 3
0
    def get_attrs_for_token(self, token):
        try:
            style = self.pygments_style_cls.style_for_token(token)
            return Attrs(color=style['color'],
                         bgcolor=style['bgcolor'],
                         bold=style.get('bold', False),
                         underline=style.get('underline', False),
                         italic=style.get('italic', False),
                         blink=False,
                         reverse=False)

        except KeyError:
            return _default_attrs
Esempio n. 4
0
 class StyleClass(pygments.style.Style):
     styles = {
         pygments.token.Token:
         style.get('Token', CONFIG['styles']['solarized']['Token']),
         pygments.token.Keyword:
         style.get('Keyword', CONFIG['styles']['solarized']['Keyword']),
         pygments.token.Name.Tag:
         style.get('Name_Tag', CONFIG['styles']['solarized']['Name_Tag']),
         pygments.token.String:
         style.get('String', CONFIG['styles']['solarized']['String']),
         pygments.token.Number:
         style.get('Number', CONFIG['styles']['solarized']['Number']),
     }
Esempio n. 5
0
    def get_attrs_for_token(self, token):
        try:
            style = self.pygments_style_cls.style_for_token(token)
            return Attrs(
                color=style["color"],
                bgcolor=style["bgcolor"],
                bold=style.get("bold", False),
                underline=style.get("underline", False),
                italic=style.get("italic", False),
                blink=False,
                reverse=False,
            )

        except KeyError:
            return _default_attrs