<commit_before><commit_msg>compile game to .exe in dist/<commit_after>import os
import shutil
import glob
import fnmatch
import py2exe
from distutils.core import setup

origIsSystemDLL = py2exe.build_exe.isSystemDLL

def isSystemDLL(pathname):
	if os.path.basename(pathname).lower() in ("sdl_ttf.dll", "libfreetype-6.dll"):
		return False
	return origIsSystemDLL(pathname)
py2exe.build_exe.isSystemDLL = isSystemDLL

dist_dir = os.path.join('dist')
data_dir = dist_dir

class Target:
	script = 'main.pyw'
	dest_base = 'layerswjhitcher'
	icon_resources = [(0, os.path.join('assets', 'icons', 'icon.ico'))]

setup(
	options = {'py2exe': {'dist_dir': dist_dir, 'bundle_files': 1, "compressed" : 1, "dll_excludes": ["w9xpopen.exe"]}},
	zipfile = None,
	windows = [Target],
)

data = []
for dirpath, dirnames, filenames in os.walk('assets'):
	data.extend(os.path.join(dirpath, fn) for fn in filenames)

for dirpath, dirnames, filenames in os.walk('maps'):
	data.extend(os.path.join(dirpath, fn) for fn in filenames)

dest = data_dir
for fname in data:
	dname = os.path.join(dest, fname)
	if not os.path.exists(os.path.dirname(dname)):
		os.makedirs(os.path.dirname(dname))
	if not os.path.isdir(fname):
		shutil.copy(fname, dname)
{'fraction_non_alphanumeric': 0.14530612244897959, 'fraction_numerical': 0.007346938775510204, 'mean_word_length': 5.4526315789473685, 'pattern_counts': {'":': 1, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3412382', 'n_tokens_mistral': 494, 'n_tokens_neox': 468, 'n_words': 107}