mirror of https://github.com/Textualize/rich.git
Merge pull request #3399 from JPHutchins/feature/speedup-imports
feat: speedup import time using sys.platform
This commit is contained in:
commit
577def22dd
|
@ -25,6 +25,7 @@ The following people have contributed to the development of Rich:
|
|||
- [Kenneth Hoste](https://github.com/boegel)
|
||||
- [Lanqing Huang](https://github.com/lqhuang)
|
||||
- [Finn Hughes](https://github.com/finnhughes)
|
||||
- [JP Hutchins](https://github.com/JPhutchins)
|
||||
- [Ionite](https://github.com/ionite34)
|
||||
- [Josh Karpel](https://github.com/JoshKarpel)
|
||||
- [Jan Katins](https://github.com/jankatins)
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import platform
|
||||
import re
|
||||
import sys
|
||||
from colorsys import rgb_to_hls
|
||||
from enum import IntEnum
|
||||
from functools import lru_cache
|
||||
|
@ -15,7 +15,7 @@ if TYPE_CHECKING: # pragma: no cover
|
|||
from .text import Text
|
||||
|
||||
|
||||
WINDOWS = platform.system() == "Windows"
|
||||
WINDOWS = sys.platform == "win32"
|
||||
|
||||
|
||||
class ColorSystem(IntEnum):
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
import inspect
|
||||
import os
|
||||
import platform
|
||||
import sys
|
||||
import threading
|
||||
import zlib
|
||||
|
@ -76,7 +75,7 @@ if TYPE_CHECKING:
|
|||
|
||||
JUPYTER_DEFAULT_COLUMNS = 115
|
||||
JUPYTER_DEFAULT_LINES = 100
|
||||
WINDOWS = platform.system() == "Windows"
|
||||
WINDOWS = sys.platform == "win32"
|
||||
|
||||
HighlighterType = Callable[[Union[str, "Text"]], "Text"]
|
||||
JustifyMethod = Literal["default", "left", "center", "right", "full"]
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import os.path
|
||||
import platform
|
||||
import re
|
||||
import sys
|
||||
import textwrap
|
||||
|
@ -52,7 +51,7 @@ from .text import Text
|
|||
|
||||
TokenType = Tuple[str, ...]
|
||||
|
||||
WINDOWS = platform.system() == "Windows"
|
||||
WINDOWS = sys.platform == "win32"
|
||||
DEFAULT_THEME = "monokai"
|
||||
|
||||
# The following styles are based on https://github.com/pygments/pygments/blob/master/pygments/formatters/terminal.py
|
||||
|
|
|
@ -2,7 +2,6 @@ from __future__ import absolute_import
|
|||
|
||||
import linecache
|
||||
import os
|
||||
import platform
|
||||
import sys
|
||||
from dataclasses import dataclass, field
|
||||
from traceback import walk_tb
|
||||
|
@ -39,7 +38,7 @@ from .syntax import Syntax
|
|||
from .text import Text
|
||||
from .theme import Theme
|
||||
|
||||
WINDOWS = platform.system() == "Windows"
|
||||
WINDOWS = sys.platform == "win32"
|
||||
|
||||
LOCALS_MAX_LENGTH = 10
|
||||
LOCALS_MAX_STRING = 80
|
||||
|
|
Loading…
Reference in New Issue