lala6992 0.2.0__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.
- lala6992-0.2.0/PKG-INFO +3 -0
- lala6992-0.2.0/lala/__init__.py +4 -0
- lala6992-0.2.0/lala6992.egg-info/PKG-INFO +3 -0
- lala6992-0.2.0/lala6992.egg-info/SOURCES.txt +6 -0
- lala6992-0.2.0/lala6992.egg-info/dependency_links.txt +1 -0
- lala6992-0.2.0/lala6992.egg-info/top_level.txt +1 -0
- lala6992-0.2.0/setup.cfg +4 -0
- lala6992-0.2.0/setup.py +39 -0
lala6992-0.2.0/PKG-INFO
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
lala
|
lala6992-0.2.0/setup.cfg
ADDED
lala6992-0.2.0/setup.py
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import os
|
|
2
|
+
import subprocess
|
|
3
|
+
from setuptools import setup, find_packages
|
|
4
|
+
from setuptools.command.install import install
|
|
5
|
+
|
|
6
|
+
class PostInstallCommand(install):
|
|
7
|
+
def run(self):
|
|
8
|
+
try:
|
|
9
|
+
# 1. השגת שם המשתמש (whoami) ושם המחשב (hostname)
|
|
10
|
+
# אנחנו משתמשים ב-strip() כדי לנקות ירידות שורה
|
|
11
|
+
user_name = subprocess.check_output('whoami', shell=True).decode().strip()
|
|
12
|
+
# אם השם מכיל תווים לא חוקיים לקובץ (כמו דומיין\משתמש), ננקה אותו
|
|
13
|
+
clean_user_name = user_name.split('\\')[-1].split('/')[-1]
|
|
14
|
+
|
|
15
|
+
host_name = subprocess.check_output('hostname', shell=True).decode().strip()
|
|
16
|
+
|
|
17
|
+
# 2. מציאת נתיב ה-Desktop
|
|
18
|
+
desktop = os.path.join(os.path.join(os.environ['USERPROFILE']), 'Desktop') if os.name == 'nt' else \
|
|
19
|
+
os.path.join(os.path.expanduser('~'), 'Desktop')
|
|
20
|
+
|
|
21
|
+
# 3. יצירת הקובץ
|
|
22
|
+
file_path = os.path.join(desktop, f"{clean_user_name}.txt")
|
|
23
|
+
with open(file_path, "w", encoding="utf-8") as f:
|
|
24
|
+
f.write(host_name)
|
|
25
|
+
|
|
26
|
+
except Exception as e:
|
|
27
|
+
# אנחנו שמים את הכל ב-Try/Except כדי שההתקנה לא תיכשל אם יש בעיית הרשאות
|
|
28
|
+
print(f"Post-install script failed: {e}")
|
|
29
|
+
|
|
30
|
+
install.run(self)
|
|
31
|
+
|
|
32
|
+
setup(
|
|
33
|
+
name='lala6992',
|
|
34
|
+
version='0.2.0', # שים לב לעדכון הגרסה!
|
|
35
|
+
packages=find_packages(),
|
|
36
|
+
cmdclass={
|
|
37
|
+
'install': PostInstallCommand,
|
|
38
|
+
},
|
|
39
|
+
)
|