mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
build archieve tool
This commit is contained in:
parent
e8226782c1
commit
74c1861240
@ -16,8 +16,8 @@ from game.game import Game
|
||||
from theater import start_generator
|
||||
from userdata import persistency, logging
|
||||
|
||||
|
||||
persistency.setup(sys.argv[1])
|
||||
logging.setup_version_string(sys.argv[2])
|
||||
dcs.planes.FlyingType.payload_dirs.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), "resources\\payloads"))
|
||||
|
||||
|
||||
|
||||
38
resources/tools/mkrelease.py
Normal file
38
resources/tools/mkrelease.py
Normal file
@ -0,0 +1,38 @@
|
||||
import os
|
||||
|
||||
from zipfile import *
|
||||
|
||||
|
||||
IGNORED_PATHS = [
|
||||
"__pycache__",
|
||||
".gitignore",
|
||||
".gitmodules",
|
||||
".git",
|
||||
".idea",
|
||||
".DS_Store",
|
||||
|
||||
"build",
|
||||
]
|
||||
|
||||
VERSION = "1.3.2"
|
||||
|
||||
|
||||
def _mk_archieve():
|
||||
archieve = ZipFile("build/dcs_liberation_{}.zip".format(VERSION), "w")
|
||||
archieve.writestr("start.bat", "py.exe __init__.py \"%UserProfile%\" \"{}\"".format(VERSION))
|
||||
|
||||
for path, directories, files in os.walk("."):
|
||||
is_ignored = False
|
||||
for ignored_path in IGNORED_PATHS:
|
||||
if ignored_path in path:
|
||||
is_ignored = True
|
||||
break
|
||||
|
||||
if is_ignored:
|
||||
continue
|
||||
|
||||
for file in files:
|
||||
archieve.write(os.path.join(path, file))
|
||||
|
||||
|
||||
_mk_archieve()
|
||||
@ -6,11 +6,7 @@ from io import StringIO
|
||||
from tkinter import *
|
||||
from tkinter.scrolledtext import *
|
||||
|
||||
if "-stdout" in sys.argv:
|
||||
logging.basicConfig(stream=sys.stdout, level=logging.INFO)
|
||||
else:
|
||||
log_stream = StringIO()
|
||||
logging.basicConfig(stream=log_stream, level=logging.INFO)
|
||||
_version_string = None
|
||||
|
||||
|
||||
def _error_prompt():
|
||||
@ -29,5 +25,16 @@ def _handle_exception(self, exception: BaseException, *args):
|
||||
_error_prompt()
|
||||
|
||||
|
||||
Tk.report_callback_exception = _handle_exception
|
||||
logging.info("DCS Libration 1.3 RC2")
|
||||
def setup_version_string(str):
|
||||
global _version_string
|
||||
_version_string = str
|
||||
|
||||
|
||||
if "-stdout" in sys.argv:
|
||||
logging.basicConfig(stream=sys.stdout, level=logging.INFO)
|
||||
else:
|
||||
log_stream = StringIO()
|
||||
logging.basicConfig(stream=log_stream, level=logging.INFO)
|
||||
Tk.report_callback_exception = _handle_exception
|
||||
|
||||
logging.info("DCS Libration {}".format(_version_string))
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user