m-you-tk 0.1.0__tar.gz → 0.1.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.
@@ -0,0 +1 @@
1
+ recursive-include m_you/assets *
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: m-you-tk
3
- Version: 0.1.0
3
+ Version: 0.1.1
4
4
  Summary: Material You components for Tkinter
5
5
  Author-email: logic-break <abibasqabiba@email.com>
6
6
  Requires-Python: >=3.7
@@ -0,0 +1,45 @@
1
+ import ctypes
2
+ import os
3
+ import sys
4
+
5
+ # 1. Находим ПРАВИЛЬНЫЙ путь к файлу шрифта внутри установленного пакета
6
+ # __file__ указывает на текущий __init__.py, берем его папку и идем в assets
7
+ CURRENT_DIR = os.path.dirname(os.path.abspath(__file__))
8
+ font_path = os.path.join(CURRENT_DIR, "assets", "material.ttf")
9
+
10
+ def load_font():
11
+ if not os.path.exists(font_path):
12
+ return
13
+
14
+ if sys.platform == "win32":
15
+ # Код для Windows
16
+ ctypes.windll.gdi32.AddFontResourceExW(font_path, 0x10, 0)
17
+ else:
18
+ # Для Linux (Arch) шрифт обычно подгружается через Fontconfig
19
+ # Если ты используешь PIL (Pillow) для отрисовки иконок,
20
+ # нужно передавать полный путь font_path прямо в ImageFont.truetype()
21
+ pass
22
+
23
+ load_font()
24
+ # --- 2. ЭКСПОРТ КОМПОНЕНТОВ ---
25
+ # Это позволяет писать: from m_you import MaterialButton
26
+ from .button import MaterialButton
27
+ from .input import MaterialInput
28
+ from .dropdown import MaterialDropdown
29
+ from .checkbox import MaterialCheckbox
30
+ from .switch import MaterialSwitch
31
+ from .slider import MaterialSlider
32
+ from .radiobutton import MaterialRadioButton
33
+ from .toast import MaterialToast
34
+
35
+ # Список того, что будет доступно при "from m_you import *"
36
+ __all__ = [
37
+ "MaterialButton",
38
+ "MaterialInput",
39
+ "MaterialDropdown",
40
+ "MaterialCheckbox",
41
+ "MaterialSwitch",
42
+ "MaterialSlider",
43
+ "MaterialRadioButton",
44
+ "MaterialToast"
45
+ ]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: m-you-tk
3
- Version: 0.1.0
3
+ Version: 0.1.1
4
4
  Summary: Material You components for Tkinter
5
5
  Author-email: logic-break <abibasqabiba@email.com>
6
6
  Requires-Python: >=3.7
@@ -1,4 +1,5 @@
1
1
  LICENSE
2
+ MANIFEST.in
2
3
  pyproject.toml
3
4
  setup.py
4
5
  m_you/__init__.py
@@ -4,7 +4,7 @@ build-backend = "setuptools.build-meta"
4
4
 
5
5
  [project]
6
6
  name = "m-you-tk"
7
- version = "0.1.0"
7
+ version = "0.1.1"
8
8
  authors = [{name = "logic-break", email = "abibasqabiba@email.com"}]
9
9
  description = "Material You components for Tkinter"
10
10
  readme = "README.md"
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
2
2
 
3
3
  setup(
4
4
  name="m-you-tk",
5
- version="0.1.0",
5
+ version="0.1.1",
6
6
  packages=find_packages(),
7
7
  include_package_data=True,
8
8
  package_data={
@@ -1,41 +0,0 @@
1
- import ctypes
2
- import os
3
- import sys
4
-
5
- # --- 1. ЛОГИКА ЗАГРУЗКИ ШРИФТА ---
6
- # Используем dirname(__file__), чтобы путь всегда вел внутрь установленного пакета
7
- font_path = os.path.join(os.path.dirname(__file__), "assets", "material.ttf")
8
-
9
- if os.path.exists(font_path):
10
- if sys.platform == "win32":
11
- # Загрузка для Windows (без установки в систему)
12
- ctypes.windll.gdi32.AddFontResourceExW(font_path, 0x10, 0)
13
- # На Linux (Arch) шрифты обычно подхватываются из папки ~/.fonts или через fontconfig,
14
- # но для кроссплатформенности на Win этого кода достаточно.
15
- else:
16
- # Не принтим ошибку в продакшне, чтобы не спамить пользователю в консоль,
17
- # либо используем logging
18
- pass
19
-
20
- # --- 2. ЭКСПОРТ КОМПОНЕНТОВ ---
21
- # Это позволяет писать: from m_you import MaterialButton
22
- from .button import MaterialButton
23
- from .input import MaterialInput
24
- from .dropdown import MaterialDropdown
25
- from .checkbox import MaterialCheckbox
26
- from .switch import MaterialSwitch
27
- from .slider import MaterialSlider
28
- from .radiobutton import MaterialRadioButton
29
- from .toast import MaterialToast
30
-
31
- # Список того, что будет доступно при "from m_you import *"
32
- __all__ = [
33
- "MaterialButton",
34
- "MaterialInput",
35
- "MaterialDropdown",
36
- "MaterialCheckbox",
37
- "MaterialSwitch",
38
- "MaterialSlider",
39
- "MaterialRadioButton",
40
- "MaterialToast"
41
- ]
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