screensolver 0.1.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,24 @@
1
+ Metadata-Version: 2.4
2
+ Name: screensolver
3
+ Version: 0.1.0
4
+ Summary: Download and run ScreenSolver exe
5
+ Requires-Python: >=3.8
6
+ Description-Content-Type: text/markdown
7
+ Requires-Dist: requests
8
+ Requires-Dist: tqdm
9
+ Requires-Dist: python-dotenv
10
+
11
+ # ScreenSolver
12
+
13
+ ScreenSolver is a lightweight CLI tool that automatically downloads and runs the ScreenSolver Windows application.
14
+
15
+ ---
16
+
17
+ ## 🚀 Installation
18
+
19
+ ```bash
20
+ pip install screensolver
21
+ ## Usage
22
+ After installation, run:
23
+
24
+ screensolver
@@ -0,0 +1,14 @@
1
+ # ScreenSolver
2
+
3
+ ScreenSolver is a lightweight CLI tool that automatically downloads and runs the ScreenSolver Windows application.
4
+
5
+ ---
6
+
7
+ ## 🚀 Installation
8
+
9
+ ```bash
10
+ pip install screensolver
11
+ ## Usage
12
+ After installation, run:
13
+
14
+ screensolver
@@ -0,0 +1,14 @@
1
+ [project]
2
+ name = "screensolver"
3
+ version = "0.1.0"
4
+ description = "Download and run ScreenSolver exe"
5
+ readme = "README.md"
6
+ requires-python = ">=3.8"
7
+ dependencies = [
8
+ "requests",
9
+ "tqdm",
10
+ "python-dotenv"
11
+ ]
12
+
13
+ [project.scripts]
14
+ screensolver = "screensolver.main:main"
File without changes
@@ -0,0 +1,93 @@
1
+ import os
2
+ import requests
3
+ import subprocess
4
+ from tqdm import tqdm
5
+ from dotenv import load_dotenv
6
+ import sys
7
+
8
+ OWNER = "amanksingh678"
9
+ REPO = "ScreenSolver"
10
+ TAG = "v1.1.0"
11
+ APP_NAME = "ScreenSolver.exe"
12
+ INSTALL_DIR = os.path.join(os.environ.get("LOCALAPPDATA", ""), "ScreenSolver")
13
+ EXE_PATH = os.path.join(INSTALL_DIR, APP_NAME)
14
+
15
+ load_dotenv()
16
+ def get_asset_api_url(headers):
17
+ url = f"https://api.github.com/repos/{OWNER}/{REPO}/releases/tags/{TAG}"
18
+ response = requests.get(url, headers=headers)
19
+ response.raise_for_status()
20
+ for asset in response.json()["assets"]:
21
+ if asset["name"].endswith(".exe"):
22
+ return asset["url"]
23
+ raise Exception("No EXE found in release")
24
+
25
+
26
+ def download_exe(headers):
27
+ print("Downloading ScreenSolver...")
28
+ os.makedirs(INSTALL_DIR, exist_ok=True)
29
+
30
+ asset_url = get_asset_api_url(headers)
31
+
32
+ download_headers = {**headers, "Accept": "application/octet-stream"}
33
+
34
+ with requests.get(asset_url, headers=download_headers,
35
+ stream=True, allow_redirects=True) as r:
36
+ r.raise_for_status()
37
+ total_size = int(r.headers.get("content-length", 0))
38
+
39
+ # ✅ Fix 3: correct tqdm indentation and total size
40
+ with open(EXE_PATH, "wb") as f, tqdm(
41
+ desc="Downloading ScreenSolver.exe",
42
+ total=total_size,
43
+ unit="B",
44
+ unit_scale=True,
45
+ unit_divisor=1024,
46
+ ) as bar:
47
+ for chunk in r.iter_content(chunk_size=8192):
48
+ if chunk:
49
+ f.write(chunk)
50
+ bar.update(len(chunk))
51
+
52
+ print("Download complete.")
53
+
54
+ def run_exe():
55
+ print("Launching ScreenSolver...")
56
+ subprocess.Popen(EXE_PATH, shell=True)
57
+
58
+ def show_help():
59
+ print("""
60
+ ScreenSolver CLI
61
+
62
+ Usage:
63
+ screensolver Run the application
64
+ screensolver --help Show this help message
65
+
66
+ Description:
67
+ Downloads and runs the ScreenSolver executable.
68
+ On first run, it installs the app automatically.
69
+ """)
70
+
71
+ def main():
72
+ if "--help" in sys.argv or "-h" in sys.argv:
73
+ show_help()
74
+ return
75
+
76
+ TOKEN = os.environ.get("GITHUB_TOKEN")
77
+ if not TOKEN:
78
+ print("Error: GITHUB_TOKEN not set in .env file")
79
+ sys.exit(1)
80
+
81
+ headers = {
82
+ "Authorization": f"token {TOKEN}",
83
+ "Accept": "application/vnd.github+json"
84
+ }
85
+
86
+ if not os.path.exists(EXE_PATH):
87
+ download_exe(headers)
88
+ else:
89
+ print("Already installed.")
90
+ run_exe()
91
+
92
+ if __name__ == "__main__":
93
+ main()
@@ -0,0 +1,24 @@
1
+ Metadata-Version: 2.4
2
+ Name: screensolver
3
+ Version: 0.1.0
4
+ Summary: Download and run ScreenSolver exe
5
+ Requires-Python: >=3.8
6
+ Description-Content-Type: text/markdown
7
+ Requires-Dist: requests
8
+ Requires-Dist: tqdm
9
+ Requires-Dist: python-dotenv
10
+
11
+ # ScreenSolver
12
+
13
+ ScreenSolver is a lightweight CLI tool that automatically downloads and runs the ScreenSolver Windows application.
14
+
15
+ ---
16
+
17
+ ## 🚀 Installation
18
+
19
+ ```bash
20
+ pip install screensolver
21
+ ## Usage
22
+ After installation, run:
23
+
24
+ screensolver
@@ -0,0 +1,10 @@
1
+ README.md
2
+ pyproject.toml
3
+ screensolver/__init__.py
4
+ screensolver/main.py
5
+ screensolver.egg-info/PKG-INFO
6
+ screensolver.egg-info/SOURCES.txt
7
+ screensolver.egg-info/dependency_links.txt
8
+ screensolver.egg-info/entry_points.txt
9
+ screensolver.egg-info/requires.txt
10
+ screensolver.egg-info/top_level.txt
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ screensolver = screensolver.main:main
@@ -0,0 +1,3 @@
1
+ requests
2
+ tqdm
3
+ python-dotenv
@@ -0,0 +1 @@
1
+ screensolver
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+