-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_check.py
More file actions
29 lines (23 loc) · 793 Bytes
/
Copy pathtest_check.py
File metadata and controls
29 lines (23 loc) · 793 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import asyncio
async def test():
args = ['us-gundrak']
query = " ".join(args).strip()
parts = query.split("-")
valid_versions = ['retail', 'classic', 'classic-era', 'sod']
if parts[0].lower() in valid_versions:
version = parts.pop(0).lower()
if version == 'sod':
version = 'classic-era'
else:
version = 'retail'
if len(parts) < 2:
print("Invalid format.")
return
region = parts.pop(0).lower()
valid_regions = ['us', 'eu', 'kr', 'tw']
if region not in valid_regions:
print(f"Invalid region '{region}'.")
return
search_term = "-".join(parts).lower()
print(f"version: {version}, region: {region}, search_term: {search_term}")
asyncio.run(test())