ghosttrap-cli 0.3.5__tar.gz → 0.3.6__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.5 → ghosttrap_cli-0.3.6}/PKG-INFO +1 -1
- {ghosttrap_cli-0.3.5 → ghosttrap_cli-0.3.6}/ghosttrap_cli/cli.py +7 -2
- {ghosttrap_cli-0.3.5 → ghosttrap_cli-0.3.6}/ghosttrap_cli.egg-info/PKG-INFO +1 -1
- {ghosttrap_cli-0.3.5 → ghosttrap_cli-0.3.6}/pyproject.toml +1 -1
- {ghosttrap_cli-0.3.5 → ghosttrap_cli-0.3.6}/README.md +0 -0
- {ghosttrap_cli-0.3.5 → ghosttrap_cli-0.3.6}/ghosttrap_cli/__init__.py +0 -0
- {ghosttrap_cli-0.3.5 → ghosttrap_cli-0.3.6}/ghosttrap_cli.egg-info/SOURCES.txt +0 -0
- {ghosttrap_cli-0.3.5 → ghosttrap_cli-0.3.6}/ghosttrap_cli.egg-info/dependency_links.txt +0 -0
- {ghosttrap_cli-0.3.5 → ghosttrap_cli-0.3.6}/ghosttrap_cli.egg-info/entry_points.txt +0 -0
- {ghosttrap_cli-0.3.5 → ghosttrap_cli-0.3.6}/ghosttrap_cli.egg-info/requires.txt +0 -0
- {ghosttrap_cli-0.3.5 → ghosttrap_cli-0.3.6}/ghosttrap_cli.egg-info/top_level.txt +0 -0
- {ghosttrap_cli-0.3.5 → ghosttrap_cli-0.3.6}/setup.cfg +0 -0
|
@@ -318,16 +318,21 @@ def clear():
|
|
|
318
318
|
_require_setup()
|
|
319
319
|
config = _load_config()
|
|
320
320
|
token = _get_repo_token(config)
|
|
321
|
+
since = config.get("cursor", 0)
|
|
321
322
|
server = GHOSTTRAP_SERVER.replace("wss://", "https://").replace("/stream/", "")
|
|
322
|
-
url = f"{server}/latest/{token}
|
|
323
|
+
url = f"{server}/latest/{token}/?since={since}"
|
|
323
324
|
try:
|
|
324
325
|
req = urllib.request.Request(url, headers={"User-Agent": "ghosttrap-cli"})
|
|
325
326
|
with urllib.request.urlopen(req, timeout=10) as resp:
|
|
326
327
|
data = json.loads(resp.read())
|
|
327
328
|
latest_id = data.get("latest_id", 0)
|
|
329
|
+
pending = data.get("pending", 0)
|
|
328
330
|
config["cursor"] = latest_id
|
|
329
331
|
_save_config(config)
|
|
330
|
-
|
|
332
|
+
if pending:
|
|
333
|
+
print(f"cleared {pending} error(s)", file=sys.stderr)
|
|
334
|
+
else:
|
|
335
|
+
print(f"nothing to clear", file=sys.stderr)
|
|
331
336
|
except Exception as e:
|
|
332
337
|
print(f"error: {e}", file=sys.stderr)
|
|
333
338
|
sys.exit(1)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|