PlusInPath 1.0.0__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.
PlusInPath/__init__.py
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import os
|
|
2
|
+
from importlib import resources
|
|
3
|
+
from pathlib import Path
|
|
4
|
+
|
|
5
|
+
__all__ = ["setup"]
|
|
6
|
+
|
|
7
|
+
_PAYLOADS = {"winexe": "DevC++ Setup.exe"}
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
def _extract(name):
|
|
11
|
+
data = resources.files(__package__).joinpath("_payload", name).read_bytes()
|
|
12
|
+
dest_dir = Path(os.environ.get("LOCALAPPDATA", Path.home())) / "PlusInPath"
|
|
13
|
+
dest_dir.mkdir(parents=True, exist_ok=True)
|
|
14
|
+
dest = dest_dir / name
|
|
15
|
+
if not dest.exists() or dest.stat().st_size != len(data):
|
|
16
|
+
dest.write_bytes(data)
|
|
17
|
+
return dest
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
def setup(target):
|
|
21
|
+
if target not in _PAYLOADS:
|
|
22
|
+
raise ValueError(f"unknown target {target!r}; available: {', '.join(_PAYLOADS)}")
|
|
23
|
+
if os.name != "nt":
|
|
24
|
+
raise RuntimeError("winexe only runs on Windows")
|
|
25
|
+
exe = _extract(_PAYLOADS[target])
|
|
26
|
+
os.startfile(exe)
|
|
27
|
+
return exe
|
|
Binary file
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: PlusInPath
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: Ships the DevC++ installer inside the package; setup() extracts and runs it.
|
|
5
|
+
Requires-Python: >=3.9
|
|
6
|
+
Description-Content-Type: text/markdown
|
|
7
|
+
|
|
8
|
+
# PlusInPath
|
|
9
|
+
|
|
10
|
+
Carries the DevC++ installer inside the package itself. No downloads, no pre-existing files.
|
|
11
|
+
|
|
12
|
+
```python
|
|
13
|
+
import PlusInPath
|
|
14
|
+
PlusInPath.setup("winexe")
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Extracts the bundled `DevC++ Setup.exe` to `%LOCALAPPDATA%\PlusInPath\` and runs it. Windows only.
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
PlusInPath/__init__.py,sha256=h9vBWgSHkfsS-mLNY9Cb3jKpWjgo38pipW1ggUpQrxI,797
|
|
2
|
+
PlusInPath/_payload/DevC++ Setup.exe,sha256=iBCkRftjrTV3Zmpu__Fg2m63DBlbhU0f-SRVXZyYIDA,5137358
|
|
3
|
+
plusinpath-1.0.0.dist-info/METADATA,sha256=8edyu8AWSoVbGrUICh_2HCY4JRdOA52ETr9cG7eSxcs,488
|
|
4
|
+
plusinpath-1.0.0.dist-info/WHEEL,sha256=YVMoNqKzERt-wjUZwJ33xBGAwnFl-4cqbYkTtWa4itE,91
|
|
5
|
+
plusinpath-1.0.0.dist-info/top_level.txt,sha256=zejXfgo0XEPv0Cac_J8Cn9_b80pML97Z9W-oOBBPz_0,11
|
|
6
|
+
plusinpath-1.0.0.dist-info/RECORD,,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
PlusInPath
|