psytricks 2.2.0a2__tar.gz → 2.2.0a6__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.
- {psytricks-2.2.0a2 → psytricks-2.2.0a6}/PKG-INFO +17 -10
- {psytricks-2.2.0a2 → psytricks-2.2.0a6}/README.md +11 -6
- {psytricks-2.2.0a2 → psytricks-2.2.0a6}/pyproject.toml +14 -7
- {psytricks-2.2.0a2 → psytricks-2.2.0a6}/src/psytricks/__init__.py +1 -1
- {psytricks-2.2.0a2 → psytricks-2.2.0a6}/src/psytricks/__ps1__/psytricks-lib.ps1 +1 -1
- {psytricks-2.2.0a2 → psytricks-2.2.0a6}/src/psytricks/decoder.py +6 -1
- {psytricks-2.2.0a2 → psytricks-2.2.0a6}/src/psytricks/mappings.py +4 -1
- {psytricks-2.2.0a2 → psytricks-2.2.0a6}/src/psytricks/wrapper.py +1 -1
- {psytricks-2.2.0a2 → psytricks-2.2.0a6}/LICENSE +0 -0
- {psytricks-2.2.0a2 → psytricks-2.2.0a6}/src/psytricks/__ps1__/psytricks-wrapper.ps1 +0 -0
- {psytricks-2.2.0a2 → psytricks-2.2.0a6}/src/psytricks/__ps1__/restricks-server.example.xml +0 -0
- {psytricks-2.2.0a2 → psytricks-2.2.0a6}/src/psytricks/__ps1__/restricks-server.ps1 +0 -0
- {psytricks-2.2.0a2 → psytricks-2.2.0a6}/src/psytricks/__ps1__/sampledata/GetAccessUsers.json +0 -0
- {psytricks-2.2.0a2 → psytricks-2.2.0a6}/src/psytricks/__ps1__/sampledata/GetMachineStatus.json +0 -0
- {psytricks-2.2.0a2 → psytricks-2.2.0a6}/src/psytricks/__ps1__/sampledata/GetSessions.json +0 -0
- {psytricks-2.2.0a2 → psytricks-2.2.0a6}/src/psytricks/cli.py +0 -0
- {psytricks-2.2.0a2 → psytricks-2.2.0a6}/src/psytricks/literals.py +0 -0
|
@@ -1,17 +1,19 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: psytricks
|
|
3
|
-
Version: 2.2.
|
|
3
|
+
Version: 2.2.0a6
|
|
4
4
|
Summary: PowerShell Python Citrix Tricks.
|
|
5
|
-
License: GPL-3.0-or-later
|
|
5
|
+
License-Expression: GPL-3.0-or-later
|
|
6
|
+
License-File: LICENSE
|
|
6
7
|
Author: Niko Ehrenfeuchter
|
|
7
8
|
Author-email: nikolaus.ehrenfeuchter@unibas.ch
|
|
8
9
|
Requires-Python: >=3.9,<4.0
|
|
9
|
-
Classifier: License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
|
|
10
10
|
Classifier: Programming Language :: Python :: 3
|
|
11
11
|
Classifier: Programming Language :: Python :: 3.9
|
|
12
12
|
Classifier: Programming Language :: Python :: 3.10
|
|
13
13
|
Classifier: Programming Language :: Python :: 3.11
|
|
14
14
|
Classifier: Programming Language :: Python :: 3.12
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
15
17
|
Requires-Dist: click (>=8.1.3,<9.0.0)
|
|
16
18
|
Requires-Dist: loguru (>=0.7.0,<0.8.0)
|
|
17
19
|
Requires-Dist: requests (>=2.30.0,<3.0.0)
|
|
@@ -51,8 +53,9 @@ PSyTricks ships with two options for the PowerShell layer:
|
|
|
51
53
|
|
|
52
54
|
NOTE: this `RESTful` claim is actually not entirely true. Or basically not at
|
|
53
55
|
all, it would be better called an `HTTP-JSON-RPC-API`. We'll still be using the
|
|
54
|
-
term `REST` for it as
|
|
55
|
-
are coming across this label.
|
|
56
|
+
term `REST` for it as the functionality of this package basically serves a very
|
|
57
|
+
similar purpose to what people think of when they are coming across this label.
|
|
58
|
+
Apologies, [Roy T. Fielding][www_rtf].
|
|
56
59
|
|
|
57
60
|
## 🤯 Are you serious?
|
|
58
61
|
|
|
@@ -64,7 +67,7 @@ Really? 🧐
|
|
|
64
67
|
Or, not sure if that's any better, implementing an HTTP REST API in plain
|
|
65
68
|
PowerShell?!? 🫣
|
|
66
69
|
|
|
67
|
-
### ✅ Yes
|
|
70
|
+
### ✅ Yes, we are
|
|
68
71
|
|
|
69
72
|
*And the package name was chosen to reflect this.*
|
|
70
73
|
|
|
@@ -73,9 +76,9 @@ at all* an issue for us. Abysmal, as in: for every wrapped call a full (new)
|
|
|
73
76
|
PowerShell process needs to be instantiated, usually taking something like 1-2
|
|
74
77
|
seconds. ⏳
|
|
75
78
|
|
|
76
|
-
The REST interface provides a much better performance, at the cost of
|
|
77
|
-
additional setup. If you're happy to take on this approach, the package
|
|
78
|
-
very smooth ride. 🎢🎡
|
|
79
|
+
The REST / HTTP-RPC interface provides a much better performance, at the cost of
|
|
80
|
+
some additional setup. If you're happy to take on this approach, the package
|
|
81
|
+
offers a very smooth ride. 🎢🎡
|
|
79
82
|
|
|
80
83
|
## 🛠🚧 Installation
|
|
81
84
|
|
|
@@ -121,6 +124,9 @@ Service Wrapper)][www_winsw] but you may choose anything you like to launch the
|
|
|
121
124
|
server process like NSSM, Scheduled Tasks 📅, homegrown dark magic 🪄🔮 or
|
|
122
125
|
others.
|
|
123
126
|
|
|
127
|
+
🧪 A more recent approach could be [Shawl][www_shawl] - let us know if you've
|
|
128
|
+
tried it and how it went!
|
|
129
|
+
|
|
124
130
|
To go with **WinSW** simply download the bundled version provided with each
|
|
125
131
|
[PSyTricks release][www_releases]. Just look for the `.zip` asset having `REST`
|
|
126
132
|
and `WinSW` in its name.
|
|
@@ -224,4 +230,5 @@ wrapper.set_maintenance(machine="vm42.vdi.example.xy", disable=False)
|
|
|
224
230
|
[www_winsw]: https://github.com/winsw/winsw
|
|
225
231
|
[www_releases]: https://github.com/imcf/psytricks/releases
|
|
226
232
|
[www_rtf]: https://roy.gbiv.com/untangled/2008/rest-apis-must-be-hypertext-driven
|
|
233
|
+
[www_shawl]: https://github.com/mtkennerly/shawl
|
|
227
234
|
|
|
@@ -29,8 +29,9 @@ PSyTricks ships with two options for the PowerShell layer:
|
|
|
29
29
|
|
|
30
30
|
NOTE: this `RESTful` claim is actually not entirely true. Or basically not at
|
|
31
31
|
all, it would be better called an `HTTP-JSON-RPC-API`. We'll still be using the
|
|
32
|
-
term `REST` for it as
|
|
33
|
-
are coming across this label.
|
|
32
|
+
term `REST` for it as the functionality of this package basically serves a very
|
|
33
|
+
similar purpose to what people think of when they are coming across this label.
|
|
34
|
+
Apologies, [Roy T. Fielding][www_rtf].
|
|
34
35
|
|
|
35
36
|
## 🤯 Are you serious?
|
|
36
37
|
|
|
@@ -42,7 +43,7 @@ Really? 🧐
|
|
|
42
43
|
Or, not sure if that's any better, implementing an HTTP REST API in plain
|
|
43
44
|
PowerShell?!? 🫣
|
|
44
45
|
|
|
45
|
-
### ✅ Yes
|
|
46
|
+
### ✅ Yes, we are
|
|
46
47
|
|
|
47
48
|
*And the package name was chosen to reflect this.*
|
|
48
49
|
|
|
@@ -51,9 +52,9 @@ at all* an issue for us. Abysmal, as in: for every wrapped call a full (new)
|
|
|
51
52
|
PowerShell process needs to be instantiated, usually taking something like 1-2
|
|
52
53
|
seconds. ⏳
|
|
53
54
|
|
|
54
|
-
The REST interface provides a much better performance, at the cost of
|
|
55
|
-
additional setup. If you're happy to take on this approach, the package
|
|
56
|
-
very smooth ride. 🎢🎡
|
|
55
|
+
The REST / HTTP-RPC interface provides a much better performance, at the cost of
|
|
56
|
+
some additional setup. If you're happy to take on this approach, the package
|
|
57
|
+
offers a very smooth ride. 🎢🎡
|
|
57
58
|
|
|
58
59
|
## 🛠🚧 Installation
|
|
59
60
|
|
|
@@ -99,6 +100,9 @@ Service Wrapper)][www_winsw] but you may choose anything you like to launch the
|
|
|
99
100
|
server process like NSSM, Scheduled Tasks 📅, homegrown dark magic 🪄🔮 or
|
|
100
101
|
others.
|
|
101
102
|
|
|
103
|
+
🧪 A more recent approach could be [Shawl][www_shawl] - let us know if you've
|
|
104
|
+
tried it and how it went!
|
|
105
|
+
|
|
102
106
|
To go with **WinSW** simply download the bundled version provided with each
|
|
103
107
|
[PSyTricks release][www_releases]. Just look for the `.zip` asset having `REST`
|
|
104
108
|
and `WinSW` in its name.
|
|
@@ -202,3 +206,4 @@ wrapper.set_maintenance(machine="vm42.vdi.example.xy", disable=False)
|
|
|
202
206
|
[www_winsw]: https://github.com/winsw/winsw
|
|
203
207
|
[www_releases]: https://github.com/imcf/psytricks/releases
|
|
204
208
|
[www_rtf]: https://roy.gbiv.com/untangled/2008/rest-apis-must-be-hypertext-driven
|
|
209
|
+
[www_shawl]: https://github.com/mtkennerly/shawl
|
|
@@ -1,11 +1,16 @@
|
|
|
1
|
-
[
|
|
2
|
-
|
|
1
|
+
[project]
|
|
2
|
+
name = "psytricks"
|
|
3
3
|
description = "PowerShell Python Citrix Tricks."
|
|
4
|
-
|
|
4
|
+
authors = [
|
|
5
|
+
{ name = "Niko Ehrenfeuchter", email = "nikolaus.ehrenfeuchter@unibas.ch" },
|
|
6
|
+
]
|
|
5
7
|
license = "GPL-3.0-or-later"
|
|
6
|
-
name = "psytricks"
|
|
7
8
|
readme = "README.md"
|
|
8
|
-
|
|
9
|
+
dynamic = []
|
|
10
|
+
version = "2.2.0-a.6"
|
|
11
|
+
|
|
12
|
+
[tool.poetry]
|
|
13
|
+
documentation = "https://imcf.one/apidocs/psytricks/psytricks.html"
|
|
9
14
|
|
|
10
15
|
[tool.poetry.urls]
|
|
11
16
|
"Changelog" = "https://github.com/imcf/psytricks/blob/main/CHANGELOG.md"
|
|
@@ -25,6 +30,9 @@ pylint = "^2.16.2"
|
|
|
25
30
|
[tool.poetry.scripts]
|
|
26
31
|
psytricks = "psytricks.cli:run_cli"
|
|
27
32
|
|
|
33
|
+
[tool.poetry.requires-plugins]
|
|
34
|
+
poetry-dynamic-versioning = { version = ">=1.0.0,<2.0.0", extras = ["plugin"] }
|
|
35
|
+
|
|
28
36
|
[tool.poetry-dynamic-versioning]
|
|
29
37
|
enable = false
|
|
30
38
|
style = "semver"
|
|
@@ -38,8 +46,7 @@ folders = [
|
|
|
38
46
|
|
|
39
47
|
[build-system]
|
|
40
48
|
build-backend = "poetry_dynamic_versioning.backend"
|
|
41
|
-
requires = ["poetry-core>=1.0.0", "poetry-dynamic-versioning"]
|
|
42
|
-
|
|
49
|
+
requires = ["poetry-core>=1.0.0", "poetry-dynamic-versioning>=1.0.0,<2.0.0"]
|
|
43
50
|
|
|
44
51
|
[tool.ruff.lint]
|
|
45
52
|
# exclude = [
|
|
@@ -46,7 +46,12 @@ def parse_powershell_json(json_dict):
|
|
|
46
46
|
ret[key] = datetime.fromtimestamp(int(epoch_ms[:10]))
|
|
47
47
|
elif key in by_keyword:
|
|
48
48
|
mapping = by_keyword[key]
|
|
49
|
-
|
|
49
|
+
try:
|
|
50
|
+
mapped_value = mapping[value]
|
|
51
|
+
except KeyError as err:
|
|
52
|
+
mapped_value = f"undefined-mapping-{value}"
|
|
53
|
+
log.error(f"No mapping for value '{value}' - using '{mapped_value}'!")
|
|
54
|
+
log.trace(err)
|
|
50
55
|
log.trace(f"{key}: {value} -> {mapped_value}")
|
|
51
56
|
ret[key] = mapped_value
|
|
52
57
|
else:
|
|
@@ -9,7 +9,8 @@ The dicts defined here can be used to map the numerical values back to their
|
|
|
9
9
|
descriptive names. The mapped names are corresponding to the ones described in
|
|
10
10
|
the official Citrix CVAD 2203 developer docs (all transformed to lowercase):
|
|
11
11
|
|
|
12
|
-
https://developer-docs.citrix.com/
|
|
12
|
+
https://developer-docs.citrix.com/en-us/citrix-virtual-apps-desktops-sdk/2203/
|
|
13
|
+
https://developer-docs.citrix.com/en-us/citrix-virtual-apps-desktops-sdk/2507/
|
|
13
14
|
"""
|
|
14
15
|
|
|
15
16
|
#######################################################################################
|
|
@@ -25,6 +26,8 @@ power_state = {
|
|
|
25
26
|
7: "turningoff",
|
|
26
27
|
8: "suspending",
|
|
27
28
|
9: "resuming",
|
|
29
|
+
10: "notsupported",
|
|
30
|
+
11: "virtualmachinenotfound",
|
|
28
31
|
}
|
|
29
32
|
"""A machine's *power status* (`Citrix.Broker.Admin.SDK.PowerState`).
|
|
30
33
|
|
|
@@ -88,7 +88,7 @@ class ResTricksWrapper:
|
|
|
88
88
|
@read_only.setter
|
|
89
89
|
def read_only(self, value: bool) -> None:
|
|
90
90
|
verb = "Enabling" if value else "Disabling"
|
|
91
|
-
log.debug(f"{verb}'read-only' mode.")
|
|
91
|
+
log.debug(f"{verb} 'read-only' mode.")
|
|
92
92
|
self._read_only = value
|
|
93
93
|
|
|
94
94
|
def connect(self):
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{psytricks-2.2.0a2 → psytricks-2.2.0a6}/src/psytricks/__ps1__/sampledata/GetAccessUsers.json
RENAMED
|
File without changes
|
{psytricks-2.2.0a2 → psytricks-2.2.0a6}/src/psytricks/__ps1__/sampledata/GetMachineStatus.json
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|