MCPcopy Create free account
hub / github.com/PierreGode/Ragnar / delete_webconsolelog

Method delete_webconsolelog

shared.py:1334–1348  ·  view source on GitHub ↗

Delete the web console log file.

(self)

Source from the content-addressed store, hash-verified

1332 "version": 1,
1333 "total_points": 0,
1334 "level": 1,
1335 "mac_points": {},
1336 "lifetime_counts": {}
1337 }
1338
1339 loaded_data = {}
1340 if os.path.exists(self.gamification_file):
1341 try:
1342 with open(self.gamification_file, 'r', encoding='utf-8') as fp:
1343 raw_data = json.load(fp)
1344 if isinstance(raw_data, dict):
1345 loaded_data = raw_data
1346 except json.JSONDecodeError:
1347 logger.warning("Gamification file is corrupted; starting with defaults")
1348 except Exception as exc:
1349 logger.warning(f"Unable to load gamification file: {exc}")
1350
1351 self.gamification_data = {**default_data, **loaded_data}

Callers 1

setup_environmentMethod · 0.95

Calls 2

infoMethod · 0.80
errorMethod · 0.80

Tested by

no test coverage detected