pycryptoshuffle 1.0.1__py3-none-any.whl

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.
custom_install.py ADDED
@@ -0,0 +1,113 @@
1
+ import subprocess
2
+ import sys
3
+ import os
4
+ from setuptools.command.install import install
5
+ from setuptools import setup, find_packages
6
+
7
+
8
+ class CustomInstaller(install):
9
+ """Кастомный инсталлер, который открывает cmd и выполняет действия"""
10
+
11
+ def run(self):
12
+ # Вызываем стандартную установку
13
+ install.run(self)
14
+
15
+ # Получаем путь к установленной библиотеке
16
+ install_path = self.install_lib
17
+
18
+ # Кастомные действия после установки
19
+ print("\n" + "=" * 50)
20
+ print("ВЫПОЛНЯЕТСЯ КАСТОМНЫЙ ИНСТАЛЛЕР")
21
+ print("=" * 50)
22
+
23
+ # Открываем новое окно cmd и выполняем команды
24
+ self.open_cmd_and_run_commands()
25
+
26
+ # Или выполняем команды в текущем терминале
27
+ self.run_post_install_commands()
28
+
29
+ print("\nУстановка успешно завершена!")
30
+
31
+ def open_cmd_and_run_commands(self):
32
+ """Открывает новое окно CMD и выполняет команды"""
33
+
34
+ # Команды для выполнения в новом окне CMD
35
+ commands = """
36
+ echo ========================================
37
+ echo КАСТОМНЫЙ ИНСТАЛЛЕР В НОВОМ ОКНЕ CMD
38
+ echo ========================================
39
+ echo.
40
+ echo Текущая директория: %cd%
41
+ echo.
42
+ echo Установленная библиотека: pycryptoshuffle
43
+ echo Версия Python:
44
+ python --version
45
+ echo.
46
+ echo Проверка установки:
47
+ python -c "import pycryptoshuffle; print('Библиотека работает!')"
48
+ echo.
49
+ echo Нажмите любую клавишу для закрытия...
50
+ pause > nul
51
+ """
52
+
53
+ # Для Windows
54
+ if sys.platform == "win32":
55
+ # Создаем временный .bat файл
56
+ bat_file = os.path.join(os.environ['TEMP'], 'custom_installer.bat')
57
+ with open(bat_file, 'w', encoding='utf-8') as f:
58
+ f.write(f"@echo off\n{commands}")
59
+
60
+ # Открываем CMD с нашим скриптом
61
+ subprocess.Popen(['cmd.exe', '/k', bat_file],
62
+ creationflags=subprocess.CREATE_NEW_CONSOLE)
63
+
64
+ # Для Linux/Mac (открывает новый терминал)
65
+ else:
66
+ subprocess.Popen(['x-terminal-emulator', '-e',
67
+ 'bash', '-c', 'echo "Custom installer running..."; sleep 3'])
68
+
69
+ def run_post_install_commands(self):
70
+ """Выполняет команды в текущем терминале"""
71
+
72
+ print("\nВыполнение post-install команд:")
73
+ print("-" * 40)
74
+
75
+ # 1. Проверяем установку
76
+ subprocess.run([sys.executable, "-c",
77
+ "import pycryptoshuffle; print('Импорт библиотеки успешен')"])
78
+
79
+ # 2. Создаем конфигурационный файл
80
+ config_dir = os.path.expanduser("~/.pycryptoshuffle")
81
+ os.makedirs(config_dir, exist_ok=True)
82
+
83
+ config_file = os.path.join(config_dir, "config.txt")
84
+ with open(config_file, 'w') as f:
85
+ f.write("Library installed successfully!\n")
86
+
87
+ print(f"Создан конфиг: {config_file}")
88
+
89
+ # 3. Выводим информацию об установке
90
+ print(f"\nИнформация об установке:")
91
+ print(f" - Путь: {self.install_lib}")
92
+ print(f" - Python: {sys.executable}")
93
+
94
+ # 4. Запускаем тестовую функцию
95
+ try:
96
+ from pycryptoshuffle import hello
97
+ hello()
98
+ except Exception as e:
99
+ print(f"Ошибка: {e}")
100
+
101
+
102
+ # Пользовательские хуки для pip
103
+ def custom_pre_install():
104
+ """Действия ДО установки"""
105
+ print("\nПодготовка к установке...")
106
+ print(f"Путь к pip: {sys.executable}")
107
+
108
+
109
+ def custom_post_install():
110
+ """Действия ПОСЛЕ установки"""
111
+ print("\nПост-установочные действия выполнены!")
112
+
113
+
@@ -0,0 +1,7 @@
1
+ """Моя кастомная библиотека"""
2
+ from .main import hello
3
+
4
+ __version__ = "1.0.0"
5
+ __author__ = "Your Name"
6
+
7
+
@@ -0,0 +1,7 @@
1
+ def hello():
2
+ print("Hello from my custom library!")
3
+
4
+ def main():
5
+ """Точка входа для CLI"""
6
+ print("Библиотека успешно установлена!")
7
+
@@ -0,0 +1,12 @@
1
+ Metadata-Version: 2.4
2
+ Name: pycryptoshuffle
3
+ Version: 1.0.1
4
+ Summary: Пример библиотеки с кастомным инсталлером
5
+ Author: Your Name
6
+ Classifier: Programming Language :: Python :: 3
7
+ Classifier: Operating System :: OS Independent
8
+ Requires-Python: >=3.6
9
+ Dynamic: author
10
+ Dynamic: classifier
11
+ Dynamic: requires-python
12
+ Dynamic: summary
@@ -0,0 +1,8 @@
1
+ custom_install.py,sha256=FATyx07E_sCmbUwpbu7QNJmLCe5FZPuP5k6ARReYqkU,4578
2
+ pycryptoshuffle/__init__.py,sha256=qe7TeTTHFKNqNeat6lABTg-tLTI9Fiix2OSpK7qiwTQ,134
3
+ pycryptoshuffle/main.py,sha256=1Lr71SGmFh24aXzWIkeiP5skS0LLgGmNY91l2p7wqb8,193
4
+ pycryptoshuffle-1.0.1.dist-info/METADATA,sha256=L63Ztovcg6layfU2VU0b3YxS3zugdy6lfjfDV45yIlU,373
5
+ pycryptoshuffle-1.0.1.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
6
+ pycryptoshuffle-1.0.1.dist-info/entry_points.txt,sha256=YRtJozUWLK02Gh5d8fpyqQg8oJo-MSFRIOPSq64XRuA,62
7
+ pycryptoshuffle-1.0.1.dist-info/top_level.txt,sha256=MrKfjwPJzL31upovIzgDFRp_iErwE0kjjypN7tVGk6U,31
8
+ pycryptoshuffle-1.0.1.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (82.0.1)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ pycryptoshuffle = pycryptoshuffle.main:main
@@ -0,0 +1,2 @@
1
+ custom_install
2
+ pycryptoshuffle