ghosttrap-cli 0.3.8__tar.gz → 0.3.9__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.
- {ghosttrap_cli-0.3.8 → ghosttrap_cli-0.3.9}/PKG-INFO +1 -1
- {ghosttrap_cli-0.3.8 → ghosttrap_cli-0.3.9}/ghosttrap_cli/cli.py +14 -3
- {ghosttrap_cli-0.3.8 → ghosttrap_cli-0.3.9}/ghosttrap_cli.egg-info/PKG-INFO +1 -1
- {ghosttrap_cli-0.3.8 → ghosttrap_cli-0.3.9}/pyproject.toml +1 -1
- {ghosttrap_cli-0.3.8 → ghosttrap_cli-0.3.9}/README.md +0 -0
- {ghosttrap_cli-0.3.8 → ghosttrap_cli-0.3.9}/ghosttrap_cli/__init__.py +0 -0
- {ghosttrap_cli-0.3.8 → ghosttrap_cli-0.3.9}/ghosttrap_cli.egg-info/SOURCES.txt +0 -0
- {ghosttrap_cli-0.3.8 → ghosttrap_cli-0.3.9}/ghosttrap_cli.egg-info/dependency_links.txt +0 -0
- {ghosttrap_cli-0.3.8 → ghosttrap_cli-0.3.9}/ghosttrap_cli.egg-info/entry_points.txt +0 -0
- {ghosttrap_cli-0.3.8 → ghosttrap_cli-0.3.9}/ghosttrap_cli.egg-info/requires.txt +0 -0
- {ghosttrap_cli-0.3.8 → ghosttrap_cli-0.3.9}/ghosttrap_cli.egg-info/top_level.txt +0 -0
- {ghosttrap_cli-0.3.8 → ghosttrap_cli-0.3.9}/setup.cfg +0 -0
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import argparse
|
|
4
4
|
import asyncio
|
|
5
|
+
import hashlib
|
|
5
6
|
import json
|
|
6
7
|
import os
|
|
7
8
|
import subprocess
|
|
@@ -11,6 +12,13 @@ import urllib.request
|
|
|
11
12
|
|
|
12
13
|
import websockets
|
|
13
14
|
|
|
15
|
+
KNOWN_SKILL_HASHES = {
|
|
16
|
+
"aeda67bc5971bd8af4d7ebe819ebcce5acead562fa618227a1798b4b5ae7143e", # v0.2.0
|
|
17
|
+
"0f2d2f4105e393fc69084d404d5a8154ba5d97fd23f92810c51345e3dc68e9a0", # v0.3.0
|
|
18
|
+
"8564b65b8ab5c63283cda1706e30ca62bc4e111d33ba8918220f4b556ad01da1", # v0.3.1..v0.3.3
|
|
19
|
+
"5759b2e0dc8ca47c3801915fd688cc8da878a7ab8d405f5183ffd7e8c8df4c55", # v0.3.4..v0.3.7
|
|
20
|
+
}
|
|
21
|
+
|
|
14
22
|
__version__ = "0.3.0"
|
|
15
23
|
|
|
16
24
|
GHOSTTRAP_SERVER = "wss://ghosttrap.io/stream/"
|
|
@@ -259,9 +267,12 @@ def _refresh_skill_if_stale():
|
|
|
259
267
|
if not os.path.exists(SKILL_FILE):
|
|
260
268
|
return
|
|
261
269
|
with open(SKILL_FILE) as f:
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
270
|
+
content = f.read()
|
|
271
|
+
if content == SKILL_CONTENT:
|
|
272
|
+
return
|
|
273
|
+
if hashlib.sha256(content.encode()).hexdigest() in KNOWN_SKILL_HASHES:
|
|
274
|
+
_write_skill()
|
|
275
|
+
print("ghosttrap skill file updated", file=sys.stderr)
|
|
265
276
|
|
|
266
277
|
|
|
267
278
|
async def setup(server_url, token):
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|