|
| 1 | +"""OS detection utilities for identifying legacy operating systems.""" |
| 2 | + |
1 | 3 | import platform |
2 | 4 | import subprocess |
3 | 5 | import json |
4 | 6 | from datetime import datetime |
5 | 7 |
|
6 | 8 | def detect_legacy_os_badges(): |
| 9 | + """Detects legacy operating systems and awards NFT badges based on the OS environment. |
| 10 | + |
| 11 | + This function scans the system for indicators of legacy operating systems |
| 12 | + (DOS, MacOS, BeOS, Windows 3.x, Windows 95) by checking for characteristic |
| 13 | + files and directories. When legacy OS indicators are found, it generates |
| 14 | + NFT badge data representing the detected system. |
| 15 | + |
| 16 | + Returns: |
| 17 | + dict: A dictionary containing a "badges" key with a list of NFT badge |
| 18 | + dictionaries. Each badge contains: |
| 19 | + - nft_id: Unique badge identifier |
| 20 | + - title: Human-readable badge title |
| 21 | + - class: Badge category (e.g., "OS Relic") |
| 22 | + - description: Description of the badge |
| 23 | + - emotional_resonance: Emotional context for the badge |
| 24 | + - symbol: Emoji symbol representing the badge |
| 25 | + - visual_anchor: Visual description |
| 26 | + - rarity: Badge rarity level |
| 27 | + - soulbound: Whether the badge is soulbound |
| 28 | + """ |
7 | 29 | detected_os = platform.system() |
8 | 30 | badges = [] |
9 | 31 |
|
@@ -76,4 +98,4 @@ def detect_legacy_os_badges(): |
76 | 98 | output = detect_legacy_os_badges() |
77 | 99 | with open("relic_rewards.json", "w") as f: |
78 | 100 | json.dump(output, f, indent=4) |
79 | | - print(f"Legacy OS badges awarded: {[b['title'] for b in output['badges']]}") |
| 101 | + print(f"Legacy OS badges awarded: {[b[title] for b in output[badges]]}") |
0 commit comments