pyscreeps-arena 0.5.6.6__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pyscreeps_arena/__init__.py +51 -0
- pyscreeps_arena/build.py +7 -0
- pyscreeps_arena/compiler.py +1221 -0
- pyscreeps_arena/core/__init__.py +1 -0
- pyscreeps_arena/core/basic.py +72 -0
- pyscreeps_arena/core/config.py +19 -0
- pyscreeps_arena/core/const.py +28 -0
- pyscreeps_arena/core/core.py +132 -0
- pyscreeps_arena/core/main.py +9 -0
- pyscreeps_arena/core/utils.py +11 -0
- pyscreeps_arena/localization.py +146 -0
- pyscreeps_arena/project.7z +0 -0
- pyscreeps_arena/ui/P2PY.py +108 -0
- pyscreeps_arena/ui/__init__.py +10 -0
- pyscreeps_arena/ui/project_ui.py +214 -0
- pyscreeps_arena/ui/rs_icon.py +43 -0
- pyscreeps_arena-0.5.6.6.dist-info/METADATA +50 -0
- pyscreeps_arena-0.5.6.6.dist-info/RECORD +21 -0
- pyscreeps_arena-0.5.6.6.dist-info/WHEEL +5 -0
- pyscreeps_arena-0.5.6.6.dist-info/entry_points.txt +4 -0
- pyscreeps_arena-0.5.6.6.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import os
|
|
2
|
+
import sys
|
|
3
|
+
import shutil
|
|
4
|
+
import py7zr
|
|
5
|
+
from pyscreeps_arena.core import const, config
|
|
6
|
+
def CMD_NewProject():
|
|
7
|
+
"""
|
|
8
|
+
cmd:
|
|
9
|
+
pyscreeps-arena [project_path]
|
|
10
|
+
arena [project_path]
|
|
11
|
+
|
|
12
|
+
* 复制"src" "game" "build.py" 到指定目录
|
|
13
|
+
|
|
14
|
+
Returns:
|
|
15
|
+
|
|
16
|
+
"""
|
|
17
|
+
if len(sys.argv) < 2:
|
|
18
|
+
print("Usage: pyarena new [project_path]\n# or\narena new [project_path]")
|
|
19
|
+
return
|
|
20
|
+
project_path = sys.argv[1]
|
|
21
|
+
if not os.path.exists(project_path):
|
|
22
|
+
os.makedirs(project_path)
|
|
23
|
+
this_path = os.path.dirname(os.path.abspath(__file__))
|
|
24
|
+
extract_7z(os.path.join(this_path, 'project.7z'), project_path)
|
|
25
|
+
print("Project created at", project_path)
|
|
26
|
+
|
|
27
|
+
def CMD_OpenUI():
|
|
28
|
+
"""
|
|
29
|
+
cmd:
|
|
30
|
+
psaui
|
|
31
|
+
|
|
32
|
+
* 打开UI界面
|
|
33
|
+
|
|
34
|
+
Returns:
|
|
35
|
+
|
|
36
|
+
"""
|
|
37
|
+
try:
|
|
38
|
+
from pyscreeps_arena.ui.project_ui import run_project_creator
|
|
39
|
+
run_project_creator()
|
|
40
|
+
except ImportError as e:
|
|
41
|
+
print(f"错误: 无法导入UI模块 - {e}")
|
|
42
|
+
print("请确保已安装PyQt6: pip install PyQt6")
|
|
43
|
+
except Exception as e:
|
|
44
|
+
print(f"错误: 打开UI界面失败 - {e}")
|
|
45
|
+
|
|
46
|
+
def extract_7z(file_path, output_dir):
|
|
47
|
+
with py7zr.SevenZipFile(file_path, mode='r') as archive:
|
|
48
|
+
archive.extractall(path=output_dir)
|
|
49
|
+
|
|
50
|
+
if __name__ == '__main__':
|
|
51
|
+
CMD_OpenUI()
|