mirror of
https://github.com/httpie/cli.git
synced 2025-02-02 18:59:18 +01:00
Fixed get_lexer()
This commit is contained in:
parent
e83e554ffb
commit
4f8d6c013b
@ -41,9 +41,6 @@ class ColorFormatter(FormatterPlugin):
|
|||||||
# --json, -j
|
# --json, -j
|
||||||
self.explicit_json = explicit_json
|
self.explicit_json = explicit_json
|
||||||
|
|
||||||
# Cache to speed things up when we process streamed body by line.
|
|
||||||
self.lexer_cache = {}
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
style_class = pygments.styles.get_style_by_name(color_scheme)
|
style_class = pygments.styles.get_style_by_name(color_scheme)
|
||||||
except ClassNotFound:
|
except ClassNotFound:
|
||||||
@ -65,7 +62,11 @@ class ColorFormatter(FormatterPlugin):
|
|||||||
return body.strip()
|
return body.strip()
|
||||||
|
|
||||||
def get_lexer(self, mime, body):
|
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=''):
|
def get_lexer(mime, explicit_json=False, body=''):
|
||||||
|
Loading…
Reference in New Issue
Block a user