Skip to content

Commit

Permalink
Fix compilation so that app + gui is included
Browse files Browse the repository at this point in the history
  • Loading branch information
Vuizur committed Aug 16, 2023
1 parent 14e1bda commit 1b9e889
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions russian_text_stresser/compile.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

def copy_folder(src: str, dst: str) -> None:
try:
shutil.copytree(src, dst)
shutil.copytree(src, dst, dirs_exist_ok=True)
except OSError as exc: # python >2.5
if exc.errno in (errno.ENOTDIR, errno.EINVAL):
shutil.copy(src, dst)
Expand All @@ -30,20 +30,21 @@ def copy_folder(src: str, dst: str) -> None:
SIMPLE_CASES_NAME = "simple_cases.pkl"

# subprocess.run(["pyinstaller", STRESSER_FOLDER + "/gui.spec", "--noconfirm"])
subprocess.run(["pyinstaller", "gui.spec", "--noconfirm"])
subprocess.run(["pyinstaller", "merged.spec", "--noconfirm"])
try:
shutil.rmtree(RELEASE_FOLDER_NAME)
except Exception as e:
print(e)
pass
copy_folder("dist/gui", RELEASE_FOLDER_NAME)
copy_folder("dist/app", RELEASE_FOLDER_NAME)
# copy_folder(SPACY_FOLDER_NAME, RELEASE_FOLDER_NAME + "/" + SPACY_FOLDER_NAME)
rename(
RELEASE_FOLDER_NAME + "/gui.exe", RELEASE_FOLDER_NAME + "/#Stress marker.exe"
)
# Make dir russian_text_stresser in release folder if it doesn't exist
if not os.path.exists(RELEASE_FOLDER_NAME + "/" + STRESSER_FOLDER):
os.mkdir(RELEASE_FOLDER_NAME + "/" + STRESSER_FOLDER)
os.makedirs(RELEASE_FOLDER_NAME + "/" + STRESSER_FOLDER)

shutil.copy(RUSSIAN_DICT_NAME, RELEASE_FOLDER_NAME + "/" + STRESSER_FOLDER)
shutil.copy(SIMPLE_CASES_NAME, RELEASE_FOLDER_NAME + "/" + STRESSER_FOLDER)
Expand Down

0 comments on commit 1b9e889

Please sign in to comment.