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.
@@ -0,0 +1,3 @@
1
+ Metadata-Version: 2.4
2
+ Name: lala6992
3
+ Version: 0.2.0
@@ -0,0 +1,4 @@
1
+ print("Hello from lala python package!")
2
+
3
+ def hello():
4
+ print("This is a function from the lala package!")
@@ -0,0 +1,3 @@
1
+ Metadata-Version: 2.4
2
+ Name: lala6992
3
+ Version: 0.2.0
@@ -0,0 +1,6 @@
1
+ setup.py
2
+ lala/__init__.py
3
+ lala6992.egg-info/PKG-INFO
4
+ lala6992.egg-info/SOURCES.txt
5
+ lala6992.egg-info/dependency_links.txt
6
+ lala6992.egg-info/top_level.txt
@@ -0,0 +1 @@
1
+ lala
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -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
+ )