1
0
mirror of https://github.com/httpie/cli.git synced 2024-11-24 08:22:22 +02:00

Fixed get_lexer()

This commit is contained in:
Jakub Roztocil 2016-03-01 16:55:12 +08:00
parent e83e554ffb
commit 4f8d6c013b

View File

@ -41,9 +41,6 @@ class ColorFormatter(FormatterPlugin):
# --json, -j
self.explicit_json = explicit_json
# Cache to speed things up when we process streamed body by line.
self.lexer_cache = {}
try:
style_class = pygments.styles.get_style_by_name(color_scheme)
except ClassNotFound:
@ -65,7 +62,11 @@ class ColorFormatter(FormatterPlugin):
return body.strip()
def get_lexer(self, mime, body):
return get_lexer(mime, body, self.explicit_json)
return get_lexer(
mime=mime,
explicit_json=self.explicit_json,
body=body,
)
def get_lexer(mime, explicit_json=False, body=''):