mirror of
https://github.com/kellyjonbrazil/jc.git
synced 2025-06-19 00:17:51 +02:00
Remove dependency on 3rd party packaging library
This commit is contained in:
@ -17,7 +17,6 @@ from pygments.style import Style
|
|||||||
from pygments.token import (Name, Number, String, Keyword)
|
from pygments.token import (Name, Number, String, Keyword)
|
||||||
from pygments.lexers import JsonLexer
|
from pygments.lexers import JsonLexer
|
||||||
from pygments.formatters import Terminal256Formatter
|
from pygments.formatters import Terminal256Formatter
|
||||||
from packaging import version
|
|
||||||
import jc.appdirs as appdirs
|
import jc.appdirs as appdirs
|
||||||
|
|
||||||
|
|
||||||
@ -100,7 +99,9 @@ if os.path.isdir(local_parsers_dir):
|
|||||||
parsers.append(plugin_name)
|
parsers.append(plugin_name)
|
||||||
|
|
||||||
|
|
||||||
if version.parse(pygments.__version__) < version.parse("2.4.0"):
|
# We only support 2.3.0+, pygments changed color names in 2.4.0.
|
||||||
|
# startswith is sufficient and avoids potential exceptions from split and int.
|
||||||
|
if pygments.__version__.startswith("2.3."):
|
||||||
PYGMENT_COLOR = {
|
PYGMENT_COLOR = {
|
||||||
'black': '#ansiblack',
|
'black': '#ansiblack',
|
||||||
'red': '#ansidarkred',
|
'red': '#ansidarkred',
|
||||||
|
Reference in New Issue
Block a user