jbqt 0.1.10__tar.gz → 0.1.12__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.

Potentially problematic release.


This version of jbqt might be problematic. Click here for more details.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: jbqt
3
- Version: 0.1.10
3
+ Version: 0.1.12
4
4
  Summary:
5
5
  Author: Joseph Bochinski
6
6
  Author-email: stirgejr@gmail.com
@@ -8,7 +8,7 @@ Requires-Python: >=3.12,<4.0
8
8
  Classifier: Programming Language :: Python :: 3
9
9
  Classifier: Programming Language :: Python :: 3.12
10
10
  Requires-Dist: fuzzywuzzy (>=0.18.0,<0.19.0)
11
- Requires-Dist: jbutils (>=0.1.1,<0.2.0)
11
+ Requires-Dist: jbutils (>=0.1.21,<0.2.0)
12
12
  Requires-Dist: pyqt6 (>=6.9.0,<7.0.0)
13
13
  Requires-Dist: python-levenshtein (>=0.27.1,<0.28.0)
14
14
  Description-Content-Type: text/markdown
@@ -1,6 +1,7 @@
1
1
  import os
2
2
  import re
3
3
 
4
+ from typing import Optional
4
5
 
5
6
  import jbutils
6
7
 
@@ -86,6 +87,12 @@ class SIZES:
86
87
  ICON_XL = QSize(32, 32)
87
88
  ICON_XXL = QSize(48, 48)
88
89
 
90
+ @classmethod
91
+ def get(cls, key: str, default: QSize | None = None) -> QSize:
92
+ if hasattr(cls, key):
93
+ return getattr(cls, key)
94
+ return default or cls.ICON_MD
95
+
89
96
 
90
97
  def icon_dir(file_name: str) -> str:
91
98
  if QtPaths.icon_dir:
@@ -131,7 +138,10 @@ def recolor_icon(
131
138
 
132
139
 
133
140
  def get_icon(file_name: str) -> IconGetter:
134
- def getter(color: str | QColor = "", size: QSize | int | None = None) -> QIcon:
141
+ def getter(
142
+ color: Optional[str | QColor] = "", size: QSize | int | None = None
143
+ ) -> QIcon:
144
+ color = color or ""
135
145
  if isinstance(size, int):
136
146
  size = QSize(size, size)
137
147
 
@@ -5,4 +5,4 @@ from PyQt6.QtCore import QSize
5
5
  from PyQt6.QtGui import QIcon, QColor
6
6
 
7
7
 
8
- IconGetter = Callable[[str | QColor, QSize | int | None], QIcon]
8
+ IconGetter = Callable[[Optional[str | QColor], QSize | int | None], QIcon]
@@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"
4
4
 
5
5
  [tool.poetry]
6
6
  name = "jbqt"
7
- version = "0.1.10"
7
+ version = "0.1.12"
8
8
  description = ""
9
9
  authors = [ "Joseph Bochinski <stirgejr@gmail.com>",]
10
10
  readme = "README.md"
@@ -14,4 +14,4 @@ python = "^3.12"
14
14
  pyqt6 = "^6.9.0"
15
15
  fuzzywuzzy = "^0.18.0"
16
16
  python-levenshtein = "^0.27.1"
17
- jbutils = "^0.1.1"
17
+ jbutils = "^0.1.21"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes