~edwargix/git.sr.ht

2771c158437c74db9026a5896eed0e9ddde70d37 — Thorben Günther 5 years ago 963825d
Update for newest pygments release

string_types and iteritems, which are for python2 compatibility, got
removed
1 files changed, 2 insertions(+), 3 deletions(-)

M gitsrht/annotations.py
M gitsrht/annotations.py => gitsrht/annotations.py +2 -3
@@ 1,6 1,5 @@
from pygments.formatter import Formatter
from pygments.token import Token, STANDARD_TYPES
from pygments.util import string_types, iteritems
from srht.markdown import markdown
from urllib.parse import urlparse



@@ 43,7 42,7 @@ class _BaseFormatter(Formatter):
        """
        if arg is None:
            arg = ".highlight"
        if isinstance(arg, string_types):
        if isinstance(arg, str):
            args = [arg]
        else:
            args = list(arg)


@@ 57,7 56,7 @@ class _BaseFormatter(Formatter):
            return ', '.join(tmp)

        styles = [(level, ttype, cls, style)
                  for cls, (style, ttype, level) in iteritems(self.class2style)
                  for cls, (style, ttype, level) in self.class2style.items()
                  if cls and style]
        styles.sort()
        lines = ['%s { %s } /* %s */' % (prefix(cls), style, repr(ttype)[6:])