chromatic-python 0.5.0__tar.gz → 0.5.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. chromatic_python-0.5.1/.github/dependabot.yml +6 -0
  2. {chromatic_python-0.5.0/chromatic_python.egg-info → chromatic_python-0.5.1}/PKG-INFO +1 -1
  3. {chromatic_python-0.5.0 → chromatic_python-0.5.1}/chromatic/_version.py +3 -3
  4. {chromatic_python-0.5.0 → chromatic_python-0.5.1}/chromatic/color/core.py +11 -7
  5. {chromatic_python-0.5.0 → chromatic_python-0.5.1}/chromatic/color/core.pyi +4 -0
  6. {chromatic_python-0.5.0 → chromatic_python-0.5.1/chromatic_python.egg-info}/PKG-INFO +1 -1
  7. {chromatic_python-0.5.0 → chromatic_python-0.5.1}/chromatic_python.egg-info/SOURCES.txt +1 -0
  8. {chromatic_python-0.5.0 → chromatic_python-0.5.1}/.gitattributes +0 -0
  9. {chromatic_python-0.5.0 → chromatic_python-0.5.1}/.github/workflows/publish.yml +0 -0
  10. {chromatic_python-0.5.0 → chromatic_python-0.5.1}/.gitignore +0 -0
  11. {chromatic_python-0.5.0 → chromatic_python-0.5.1}/README.md +0 -0
  12. {chromatic_python-0.5.0 → chromatic_python-0.5.1}/banner.png +0 -0
  13. {chromatic_python-0.5.0 → chromatic_python-0.5.1}/chromatic/__init__.py +0 -0
  14. {chromatic_python-0.5.0 → chromatic_python-0.5.1}/chromatic/__init__.pyi +0 -0
  15. {chromatic_python-0.5.0 → chromatic_python-0.5.1}/chromatic/_typing.py +0 -0
  16. {chromatic_python-0.5.0 → chromatic_python-0.5.1}/chromatic/color/__init__.py +0 -0
  17. {chromatic_python-0.5.0 → chromatic_python-0.5.1}/chromatic/color/__init__.pyi +0 -0
  18. {chromatic_python-0.5.0 → chromatic_python-0.5.1}/chromatic/color/colorconv.py +0 -0
  19. {chromatic_python-0.5.0 → chromatic_python-0.5.1}/chromatic/color/iterators.py +0 -0
  20. {chromatic_python-0.5.0 → chromatic_python-0.5.1}/chromatic/color/palette.py +0 -0
  21. {chromatic_python-0.5.0 → chromatic_python-0.5.1}/chromatic/color/palette.pyi +0 -0
  22. {chromatic_python-0.5.0 → chromatic_python-0.5.1}/chromatic/data/__init__.py +0 -0
  23. {chromatic_python-0.5.0 → chromatic_python-0.5.1}/chromatic/data/__init__.pyi +0 -0
  24. {chromatic_python-0.5.0 → chromatic_python-0.5.1}/chromatic/data/_fetchers.py +0 -0
  25. {chromatic_python-0.5.0 → chromatic_python-0.5.1}/chromatic/data/butterfly.jpg +0 -0
  26. {chromatic_python-0.5.0 → chromatic_python-0.5.1}/chromatic/data/escher.png +0 -0
  27. {chromatic_python-0.5.0 → chromatic_python-0.5.1}/chromatic/data/fonts/consolas.ttf +0 -0
  28. {chromatic_python-0.5.0 → chromatic_python-0.5.1}/chromatic/data/fonts/vga437.ttf +0 -0
  29. {chromatic_python-0.5.0 → chromatic_python-0.5.1}/chromatic/data/goblin_virus.png +0 -0
  30. {chromatic_python-0.5.0 → chromatic_python-0.5.1}/chromatic/data/registry.json +0 -0
  31. {chromatic_python-0.5.0 → chromatic_python-0.5.1}/chromatic/data/userfont.py +0 -0
  32. {chromatic_python-0.5.0 → chromatic_python-0.5.1}/chromatic/data/userfont.pyi +0 -0
  33. {chromatic_python-0.5.0 → chromatic_python-0.5.1}/chromatic/data/userfont.schema.json +0 -0
  34. {chromatic_python-0.5.0 → chromatic_python-0.5.1}/chromatic/demo.py +0 -0
  35. {chromatic_python-0.5.0 → chromatic_python-0.5.1}/chromatic/image/__init__.py +0 -0
  36. {chromatic_python-0.5.0 → chromatic_python-0.5.1}/chromatic/image/__init__.pyi +0 -0
  37. {chromatic_python-0.5.0 → chromatic_python-0.5.1}/chromatic/image/_array.py +0 -0
  38. {chromatic_python-0.5.0 → chromatic_python-0.5.1}/chromatic/image/_curses.py +0 -0
  39. {chromatic_python-0.5.0 → chromatic_python-0.5.1}/chromatic/image/_glyph.py +0 -0
  40. {chromatic_python-0.5.0 → chromatic_python-0.5.1}/chromatic_python.egg-info/dependency_links.txt +0 -0
  41. {chromatic_python-0.5.0 → chromatic_python-0.5.1}/chromatic_python.egg-info/requires.txt +0 -0
  42. {chromatic_python-0.5.0 → chromatic_python-0.5.1}/chromatic_python.egg-info/top_level.txt +0 -0
  43. {chromatic_python-0.5.0 → chromatic_python-0.5.1}/pyproject.toml +0 -0
  44. {chromatic_python-0.5.0 → chromatic_python-0.5.1}/setup.cfg +0 -0
  45. {chromatic_python-0.5.0 → chromatic_python-0.5.1}/tests/__init__.py +0 -0
  46. {chromatic_python-0.5.0 → chromatic_python-0.5.1}/tests/test_color_str.py +0 -0
@@ -0,0 +1,6 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: "pip"
4
+ directory: "/"
5
+ schedule:
6
+ interval: "weekly"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: chromatic-python
3
- Version: 0.5.0
3
+ Version: 0.5.1
4
4
  Summary: ANSI art image processing and colored terminal text
5
5
  Author: crypt0lith
6
6
  License-Expression: MIT
@@ -18,7 +18,7 @@ version_tuple: tuple[int | str, ...]
18
18
  commit_id: str | None
19
19
  __commit_id__: str | None
20
20
 
21
- __version__ = version = '0.5.0'
22
- __version_tuple__ = version_tuple = (0, 5, 0)
21
+ __version__ = version = '0.5.1'
22
+ __version_tuple__ = version_tuple = (0, 5, 1)
23
23
 
24
- __commit_id__ = commit_id = 'g066855df5'
24
+ __commit_id__ = commit_id = 'g2a3a6815c'
@@ -753,11 +753,15 @@ def _is_sgr_param(value: int, /):
753
753
 
754
754
 
755
755
  class SgrSequence(MutableSequence[SgrParamBuffer]):
756
+ _idx_attrs = ("_bg_idx", "_fg_idx")
757
+ __slots__ = ("_sgr_params", *_idx_attrs)
758
+
756
759
  class _color_descriptor:
757
760
  def __set_name__(self, objtype, name, /):
758
761
  self.__objclass__ = objtype
759
762
  self.key = name
760
763
  self.idx = f"_{name}_idx"
764
+ assert self.idx in objtype._idx_attrs
761
765
 
762
766
  def __get__(self, inst, objtype=None):
763
767
  if inst is None:
@@ -894,7 +898,7 @@ class SgrSequence(MutableSequence[SgrParamBuffer]):
894
898
  def __copy__(self):
895
899
  inst = object.__new__(self.__class__)
896
900
  inst._sgr_params = self._sgr_params.copy()
897
- for attr in ("_bg_idx", "_fg_idx"):
901
+ for attr in self._idx_attrs:
898
902
  try:
899
903
  idx = getattr(self, attr)
900
904
  except AttributeError:
@@ -907,7 +911,7 @@ class SgrSequence(MutableSequence[SgrParamBuffer]):
907
911
  def __deepcopy__(self, memo, /):
908
912
  inst = memo[id(self)] = object.__new__(self.__class__)
909
913
  inst._sgr_params = deepcopy(self._sgr_params, memo)
910
- for attr in ("_bg_idx", "_fg_idx"):
914
+ for attr in self._idx_attrs:
911
915
  try:
912
916
  idx = getattr(self, attr)
913
917
  except AttributeError:
@@ -920,7 +924,7 @@ class SgrSequence(MutableSequence[SgrParamBuffer]):
920
924
  if isinstance(index, slice):
921
925
  del self._sgr_params[index]
922
926
  indices = range(*index.indices(n))
923
- for attr in ("_bg_idx", "_fg_idx"):
927
+ for attr in self._idx_attrs:
924
928
  try:
925
929
  cur_idx = getattr(self, attr)
926
930
  except AttributeError:
@@ -933,7 +937,7 @@ class SgrSequence(MutableSequence[SgrParamBuffer]):
933
937
  index = op.index(index)
934
938
  if index < 0:
935
939
  index += n
936
- for attr in ("_bg_idx", "_fg_idx"):
940
+ for attr in self._idx_attrs:
937
941
  try:
938
942
  cur_idx = getattr(self, attr)
939
943
  except AttributeError:
@@ -949,7 +953,7 @@ class SgrSequence(MutableSequence[SgrParamBuffer]):
949
953
  self._sgr_params = []
950
954
  elif isinstance(iterable, SgrSequence):
951
955
  self._sgr_params = iterable._sgr_params.copy()
952
- for attr in ("_bg_idx", "_fg_idx"):
956
+ for attr in self._idx_attrs:
953
957
  try:
954
958
  idx = getattr(iterable, attr)
955
959
  except AttributeError:
@@ -998,7 +1002,7 @@ class SgrSequence(MutableSequence[SgrParamBuffer]):
998
1002
  if isinstance(index, slice):
999
1003
  self._sgr_params[index] = iterable
1000
1004
  indices = range(*index.indices(n))
1001
- for attr in ("_bg_idx", "_fg_idx"):
1005
+ for attr in self._idx_attrs:
1002
1006
  try:
1003
1007
  cur_idx = getattr(self, attr)
1004
1008
  except AttributeError:
@@ -1012,7 +1016,7 @@ class SgrSequence(MutableSequence[SgrParamBuffer]):
1012
1016
  index = op.index(index)
1013
1017
  if index < 0:
1014
1018
  index += n
1015
- for attr in ("_bg_idx", "_fg_idx"):
1019
+ for attr in self._idx_attrs:
1016
1020
  try:
1017
1021
  cur_idx = getattr(self, attr)
1018
1022
  except AttributeError:
@@ -474,7 +474,11 @@ class SgrSequence(MutableSequence[SgrParamBuffer]):
474
474
  ): ...
475
475
  def __iter__(self) -> Iterator[SgrParamBuffer]: ...
476
476
 
477
+ __slots__ = ("_sgr_params", "_bg_idx", "_fg_idx")
477
478
  _sgr_params: list[SgrParamBuffer]
479
+ _bg_idx: int | None
480
+ _fg_idx: int | None
481
+
478
482
  rgb_dict = property(
479
483
  lambda self: dict[ColorDictKeys, Int3Tuple](), set_colors, clear_colors
480
484
  )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: chromatic-python
3
- Version: 0.5.0
3
+ Version: 0.5.1
4
4
  Summary: ANSI art image processing and colored terminal text
5
5
  Author: crypt0lith
6
6
  License-Expression: MIT
@@ -3,6 +3,7 @@
3
3
  README.md
4
4
  banner.png
5
5
  pyproject.toml
6
+ .github/dependabot.yml
6
7
  .github/workflows/publish.yml
7
8
  chromatic/__init__.py
8
9
  chromatic/__init__.pyi