pyscreeps-arena 0.3.2__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.
@@ -0,0 +1,31 @@
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
+
11
+ * 复制"src" "game" "build.py" 到指定目录
12
+
13
+ Returns:
14
+
15
+ """
16
+ if len(sys.argv) < 2:
17
+ print("Usage: pyarena new [project_path]")
18
+ return
19
+ project_path = sys.argv[1]
20
+ if not os.path.exists(project_path):
21
+ os.makedirs(project_path)
22
+ this_path = os.path.dirname(os.path.abspath(__file__))
23
+ extract_7z(os.path.join(this_path, 'project.7z'), project_path)
24
+ print("Project created at", project_path)
25
+
26
+
27
+ def extract_7z(file_path, output_dir):
28
+ with py7zr.SevenZipFile(file_path, mode='r') as archive:
29
+ archive.extractall(path=output_dir)
30
+
31
+
@@ -0,0 +1,7 @@
1
+ from pyscreeps_arena.compiler import Compiler
2
+
3
+ if __name__ == '__main__':
4
+ compiler = Compiler('src', 'library', 'build')
5
+
6
+ compiler.compile()
7
+ # compiler.clean()