-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
81 lines (66 loc) · 2.45 KB
/
setup.py
File metadata and controls
81 lines (66 loc) · 2.45 KB
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
"""Setup script for omniGames - initializes built-in games."""
import shutil
from pathlib import Path
# Paths
ROOT_DIR = Path(__file__).parent
OMNIGAMES_GAMES_DIR = ROOT_DIR / "omnigames" / "games"
GAMES_DIR = ROOT_DIR / "games"
def setup_builtin_games():
"""Copy built-in games to ./games directory."""
games_to_copy = ["snake", "tictactoe", "memory", "pong", "maze"]
for game_name in games_to_copy:
source_file = OMNIGAMES_GAMES_DIR / f"{game_name}.py"
game_folder = GAMES_DIR / game_name
target_file = game_folder / "main.py"
if source_file.exists() and game_folder.exists():
try:
shutil.copy(source_file, target_file)
print(f"✓ Copied {game_name} game to ./games/{game_name}/main.py")
except Exception as e:
print(f"✗ Error copying {game_name}: {e}")
else:
print(f"✗ Source or destination not found for {game_name}")
def verify_structure():
"""Verify the project structure is correct."""
required_files = [
"main.py",
"requirements.txt",
"README.md",
"omnigames/__init__.py",
"omnigames/core/__init__.py",
"omnigames/core/base_game.py",
"omnigames/core/database.py",
"omnigames/core/config.py",
"omnigames/core/game_manager.py",
"omnigames/ui/__init__.py",
"omnigames/ui/menu.py",
]
print("\nVerifying project structure:")
all_ok = True
for file_path in required_files:
full_path = ROOT_DIR / file_path
if full_path.exists():
print(f"✓ {file_path}")
else:
print(f"✗ {file_path} - MISSING")
all_ok = False
required_games = ["snake", "tictactoe", "memory", "pong", "maze"]
for game in required_games:
game_manifest = GAMES_DIR / game / "game.json"
game_main = GAMES_DIR / game / "main.py"
if game_manifest.exists() and game_main.exists():
print(f"✓ games/{game}/ (manifest + main.py)")
else:
print(f"✗ games/{game}/ - INCOMPLETE")
all_ok = False
return all_ok
if __name__ == "__main__":
print("omniGames Setup")
print("=" * 50)
# Setup games
setup_builtin_games()
# Verify structure
if verify_structure():
print("\n✓ All checks passed! Ready to run: python main.py")
else:
print("\n✗ Some files are missing. Please check the installation.")