wwn 26.19__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.
- wwn-26.19/LICENSE.md +21 -0
- wwn-26.19/PKG-INFO +28 -0
- wwn-26.19/README.md +5 -0
- wwn-26.19/nitrogen/__init__.py +94 -0
- wwn-26.19/nitrogen/__main__.py +4 -0
- wwn-26.19/setup.cfg +4 -0
- wwn-26.19/setup.py +26 -0
- wwn-26.19/wwn.egg-info/PKG-INFO +28 -0
- wwn-26.19/wwn.egg-info/SOURCES.txt +10 -0
- wwn-26.19/wwn.egg-info/dependency_links.txt +1 -0
- wwn-26.19/wwn.egg-info/entry_points.txt +2 -0
- wwn-26.19/wwn.egg-info/top_level.txt +2 -0
wwn-26.19/LICENSE.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Wednesware
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
wwn-26.19/PKG-INFO
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: wwn
|
|
3
|
+
Version: 26.19
|
|
4
|
+
Summary: Easy, ultra-light-weight installer for Wednesware publications. Built for single-use and multi-use installations.
|
|
5
|
+
Home-page: https://github.com/wednesware/nitrogen
|
|
6
|
+
Author: Wednesware
|
|
7
|
+
Author-email: wednesware@gmail.com
|
|
8
|
+
Classifier: Programming Language :: Python :: 3
|
|
9
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
10
|
+
Classifier: Operating System :: OS Independent
|
|
11
|
+
Requires-Python: >=3.12
|
|
12
|
+
Description-Content-Type: text/markdown
|
|
13
|
+
License-File: LICENSE.md
|
|
14
|
+
Dynamic: author
|
|
15
|
+
Dynamic: author-email
|
|
16
|
+
Dynamic: classifier
|
|
17
|
+
Dynamic: description
|
|
18
|
+
Dynamic: description-content-type
|
|
19
|
+
Dynamic: home-page
|
|
20
|
+
Dynamic: license-file
|
|
21
|
+
Dynamic: requires-python
|
|
22
|
+
Dynamic: summary
|
|
23
|
+
|
|
24
|
+
# Wednesware Nitrogen
|
|
25
|
+
|
|
26
|
+
Easy, ultra-light-weight installer for Wednesware publications. Built for single-use and multi-use installations.
|
|
27
|
+
|
|
28
|
+
## /!\ This publication does not require Wednesware Magnesium to run.
|
wwn-26.19/README.md
ADDED
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import sys, zipfile, shutil, os, urllib.error, subprocess, traceback
|
|
2
|
+
from urllib.request import urlretrieve
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
PUBLICATION_CACHE: dict[int, str] = {
|
|
6
|
+
7: "nitrogen",
|
|
7
|
+
12: "magnesium",
|
|
8
|
+
2: "helium",
|
|
9
|
+
3: "lithium"
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
def parsepub(pub: str) -> str:
|
|
13
|
+
if pub.isnumeric() and int(pub) in PUBLICATION_CACHE:
|
|
14
|
+
return PUBLICATION_CACHE[int(pub)]
|
|
15
|
+
return pub
|
|
16
|
+
|
|
17
|
+
def install(pub: str, rel: str, getdep: str) -> None:
|
|
18
|
+
pub = parsepub(pub)
|
|
19
|
+
print(f"Now installing: {pub.lower()}-{rel}")
|
|
20
|
+
try:
|
|
21
|
+
try:
|
|
22
|
+
urlretrieve(f"https://github.com/Wednesware/{pub.capitalize()}/releases/{rel + '/download' if rel == 'latest' else 'download/' + rel}/{pub.lower()}.zip", f"{pub.lower()}.zip")
|
|
23
|
+
except urllib.error.HTTPError:
|
|
24
|
+
print(f"Error: Could not find release '{rel}' for publication '{pub.capitalize()}'. Are you sure you spelled it right?")
|
|
25
|
+
sys.exit(1)
|
|
26
|
+
with zipfile.ZipFile(f"{pub.lower()}.zip", "r") as zip_ref:
|
|
27
|
+
zip_ref.extractall(f"{pub.lower()}-repo")
|
|
28
|
+
dirname: str = f"{pub.lower()}{rel.replace('.', '_').replace('-', '_')}" if rel != "latest" else pub.lower()
|
|
29
|
+
if os.path.exists(dirname):
|
|
30
|
+
shutil.rmtree(dirname)
|
|
31
|
+
shutil.move(f"{pub.lower()}-repo/{next(os.scandir(f'{pub.lower()}-repo')).name}/{pub.lower()}", dirname)
|
|
32
|
+
shutil.rmtree(f"{pub.lower()}-repo")
|
|
33
|
+
os.remove(f"{pub.lower()}.zip")
|
|
34
|
+
print(f"\033[92m Installation complete!\033[0m")
|
|
35
|
+
try:
|
|
36
|
+
if getdep == "yes" or (getdep == "ask" and input(f"\033[94m Run 'getdep' on this new installation to get sub-dependencies? (Y/n) \033[0m").strip().lower() in ["y", "yes", "yeah", "true", "t", ""]):
|
|
37
|
+
print("\033[94m Installing sub-dependencies...\033[0m")
|
|
38
|
+
output: subprocess.CompletedProcess = subprocess.run(["python", __file__, "getdep", dirname], capture_output=True)
|
|
39
|
+
for line in output.stdout.decode().split("\n"):
|
|
40
|
+
print(f" {line}")
|
|
41
|
+
for line in output.stderr.decode().split("\n"):
|
|
42
|
+
if line.strip():
|
|
43
|
+
print(f"\033[91m {line}\033[0m")
|
|
44
|
+
except (KeyboardInterrupt, EOFError):
|
|
45
|
+
print()
|
|
46
|
+
exit(0)
|
|
47
|
+
except Exception:
|
|
48
|
+
for line in traceback.format_exc().split("\n"):
|
|
49
|
+
if line.strip():
|
|
50
|
+
print(f"\033[91m {line}\033[0m")
|
|
51
|
+
|
|
52
|
+
def main() -> None:
|
|
53
|
+
if len(sys.argv) == 1:
|
|
54
|
+
print("Usage: n2 <command> [args]")
|
|
55
|
+
print("Use 'n2 help' for a list of commands.")
|
|
56
|
+
sys.exit(0)
|
|
57
|
+
|
|
58
|
+
match sys.argv[1]:
|
|
59
|
+
case "get":
|
|
60
|
+
if len(sys.argv) == 2:
|
|
61
|
+
print("Usage: n2 get <publication> [release (latest by default)]")
|
|
62
|
+
sys.exit(1)
|
|
63
|
+
install(sys.argv[2], sys.argv[3] if len(sys.argv) > 3 else "latest", sys.argv[4] if len(sys.argv) > 4 else "ask")
|
|
64
|
+
case "getdep":
|
|
65
|
+
nitrodep_path: str = os.path.join(sys.argv[2] if len(sys.argv) > 2 else "", ".nitrodep")
|
|
66
|
+
if not os.path.isfile(nitrodep_path):
|
|
67
|
+
print(f"No dependency file found at '{nitrodep_path}'")
|
|
68
|
+
sys.exit(0)
|
|
69
|
+
with open(nitrodep_path) as file:
|
|
70
|
+
content: str = file.read()
|
|
71
|
+
if not content.strip():
|
|
72
|
+
print("\033[92mNo dependencies needed!\033[0m")
|
|
73
|
+
sys.exit(0)
|
|
74
|
+
else:
|
|
75
|
+
deps: list[tuple[str, str]] = [(line.split()[0].strip(), line.split()[1].strip() if len(line.split()) > 1 else "latest") for line in content.split("\n") if line.strip()]
|
|
76
|
+
print(f"Dependencies loaded: {len(deps)} ! {deps}")
|
|
77
|
+
for dep in deps:
|
|
78
|
+
install(*dep, getdep="yes")
|
|
79
|
+
case "readme":
|
|
80
|
+
with open(os.path.join(os.path.dirname(__file__), "README.md")) as file:
|
|
81
|
+
print(file.read())
|
|
82
|
+
case "help":
|
|
83
|
+
print("Usage: n2 <command> [args]")
|
|
84
|
+
print("Commands:")
|
|
85
|
+
print(" get <publication> [release (latest by default)] [get subdependencies? (y/n)] - Download a Wednesware publication from GitHub")
|
|
86
|
+
print(" getdep [path] - Smart-install all dependencies from a .nitrodep file.")
|
|
87
|
+
print(" readme - Show the README file")
|
|
88
|
+
print(" help - Show this help message")
|
|
89
|
+
case _:
|
|
90
|
+
print(f"Unknown command: {sys.argv[1]}")
|
|
91
|
+
print("Use 'n2 help' for a list of commands.")
|
|
92
|
+
|
|
93
|
+
if __name__ == "__main__":
|
|
94
|
+
main()
|
wwn-26.19/setup.cfg
ADDED
wwn-26.19/setup.py
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
from setuptools import setup, find_packages
|
|
2
|
+
|
|
3
|
+
setup(
|
|
4
|
+
name="wwn",
|
|
5
|
+
version="26.19",
|
|
6
|
+
py_modules=["cli"],
|
|
7
|
+
entry_points={
|
|
8
|
+
"console_scripts": [
|
|
9
|
+
"n2=nitrogen:main",
|
|
10
|
+
],
|
|
11
|
+
},
|
|
12
|
+
author="Wednesware",
|
|
13
|
+
author_email="wednesware@gmail.com",
|
|
14
|
+
description="Easy, ultra-light-weight installer for Wednesware publications. Built for single-use and multi-use installations.",
|
|
15
|
+
long_description=open("README.md", "r", encoding="utf-8").read(),
|
|
16
|
+
long_description_content_type="text/markdown",
|
|
17
|
+
url="https://github.com/wednesware/nitrogen",
|
|
18
|
+
packages=find_packages(),
|
|
19
|
+
install_requires=[],
|
|
20
|
+
classifiers=[
|
|
21
|
+
"Programming Language :: Python :: 3",
|
|
22
|
+
"License :: OSI Approved :: MIT License",
|
|
23
|
+
"Operating System :: OS Independent",
|
|
24
|
+
],
|
|
25
|
+
python_requires=">=3.12",
|
|
26
|
+
)
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: wwn
|
|
3
|
+
Version: 26.19
|
|
4
|
+
Summary: Easy, ultra-light-weight installer for Wednesware publications. Built for single-use and multi-use installations.
|
|
5
|
+
Home-page: https://github.com/wednesware/nitrogen
|
|
6
|
+
Author: Wednesware
|
|
7
|
+
Author-email: wednesware@gmail.com
|
|
8
|
+
Classifier: Programming Language :: Python :: 3
|
|
9
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
10
|
+
Classifier: Operating System :: OS Independent
|
|
11
|
+
Requires-Python: >=3.12
|
|
12
|
+
Description-Content-Type: text/markdown
|
|
13
|
+
License-File: LICENSE.md
|
|
14
|
+
Dynamic: author
|
|
15
|
+
Dynamic: author-email
|
|
16
|
+
Dynamic: classifier
|
|
17
|
+
Dynamic: description
|
|
18
|
+
Dynamic: description-content-type
|
|
19
|
+
Dynamic: home-page
|
|
20
|
+
Dynamic: license-file
|
|
21
|
+
Dynamic: requires-python
|
|
22
|
+
Dynamic: summary
|
|
23
|
+
|
|
24
|
+
# Wednesware Nitrogen
|
|
25
|
+
|
|
26
|
+
Easy, ultra-light-weight installer for Wednesware publications. Built for single-use and multi-use installations.
|
|
27
|
+
|
|
28
|
+
## /!\ This publication does not require Wednesware Magnesium to run.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|