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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ghosttrap-cli
3
- Version: 0.3.8
3
+ Version: 0.3.9
4
4
  Summary: Watch for errors streaming from ghosttrap.io
5
5
  Project-URL: Homepage, https://github.com/alex-rowley/ghosttrap-cli
6
6
  Requires-Python: >=3.10
@@ -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
- if f.read() != SKILL_CONTENT:
263
- _write_skill()
264
- print("ghosttrap skill file updated", file=sys.stderr)
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):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ghosttrap-cli
3
- Version: 0.3.8
3
+ Version: 0.3.9
4
4
  Summary: Watch for errors streaming from ghosttrap.io
5
5
  Project-URL: Homepage, https://github.com/alex-rowley/ghosttrap-cli
6
6
  Requires-Python: >=3.10
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "ghosttrap-cli"
7
- version = "0.3.8"
7
+ version = "0.3.9"
8
8
  description = "Watch for errors streaming from ghosttrap.io"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.10"
File without changes
File without changes