⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.1
Server IP:
185.238.29.86
Server:
Linux server2 6.8.12-6-pve #1 SMP PREEMPT_DYNAMIC PMX 6.8.12-6 (2024-12-19T19:05Z) x86_64
Server Software:
nginx/1.18.0
PHP Version:
8.1.31
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
var
/
www
/
invoice
/
node_modules
/
flag-icon-css
/
View File Name :
flags.py
import os import json flags_dir = os.path.join("flags", "1x1") files = [] for (dirpath, dirnames, filenames) in os.walk(flags_dir): files.extend(filenames) break file_codes = [name.replace(".svg", "") for name in files] country_json = open("country.json") flags = json.load(country_json) flags.sort(key=lambda x: x["code"]) country_codes = [flag["code"] for flag in flags] with open("country.json", "w") as output: json.dump(flags, output, indent=2, sort_keys=True) all_good = True # Check if all files have names for code in file_codes: if code not in country_codes: print("Code not found in country.json:", code) all_good = False # Check if all countries have files for code in country_codes: if code not in file_codes: print("Flag icon not found for:", code) all_good = False if all_good: print("All flag icons and country.json are in sync.")