<commit_before># OneShot Save Utility
# https://github.com/hunternet93/oneshot-save-utility

# ===========
# UI Settings
# ===========

bgcolor = '#13041B'
textcolor = '#FFFFAA'
highlightcolor = '#888844'
font = ('vgasys', 14)


# ===============
# Initial imports
# ===============

from rubymarshal.reader import load as rb_load
from rubymarshal.writer import write as rb_write

import platform
import base64
import shutil
import psutil
import os

if platform.python_version_tuple()[0] == '2':
    from Tkinter import *
    import tkMessageBox as tkmessagebox
else:
    from tkinter import *
    import tkinter.messagebox as tkmessagebox


# =========================================
# Find and initalize the OneShot directory
# =========================================

# MacOS support has not been tested!

if platform.system() == 'Windows':
    dirpath = os.path.join(os.path.expandvars('%appdata%'), 'OneShot')
    oneshot_process = 'oneshot.exe'
if platform.system() == 'Linux':
    dirpath = os.path.join(os.path.expanduser('~'), '.local', 'share', 'Oneshot')
    oneshot_process = 'oneshot'
if platform.system() == 'Darwin': # MacOS
    dirpath = os.path.join(os.path.expanduser('~'), 'Library', 'Preferences', 'Oneshot')
    oneshot_process = 'oneshot'

psettingspath = os.path.join(dirpath, 'p-settings.dat')

if not os.path.exists(psettingspath):
    tkmessagebox.showerror('OneShot not initialized', "OneShot's settings have not been initialized. Please start a new OneShot game, save and exit OneShot, then restart OneShot Save Utility.")
    quit()

archivepath = os.path.join(dirpath, 'OneShot Save Utility Archive')
if not os.path.exists(archivepath): os.makedirs(archivepath)
<commit_msg>Drop Python 2 support<commit_after># OneShot Save Utility
# https://github.com/hunternet93/oneshot-save-utility

# ===========
# UI Settings
# ===========

bgcolor = '#13041B'
textcolor = '#FFFFAA'
highlightcolor = '#888844'
font = ('vgasys', 14)


# ===============
# Initial imports
# ===============

from rubymarshal.reader import load as rb_load
from rubymarshal.writer import write as rb_write

import platform
import base64
import shutil
import psutil
import os

from tkinter import *
import tkinter.messagebox as tkmessagebox


# =========================================
# Find and initalize the OneShot directory
# =========================================

# MacOS support has not been tested!

if platform.system() == 'Windows':
    dirpath = os.path.join(os.path.expandvars('%appdata%'), 'OneShot')
    oneshot_process = 'oneshot.exe'
if platform.system() == 'Linux':
    dirpath = os.path.join(os.path.expanduser('~'), '.local', 'share', 'Oneshot')
    oneshot_process = 'oneshot'
if platform.system() == 'Darwin': # MacOS
    dirpath = os.path.join(os.path.expanduser('~'), 'Library', 'Preferences', 'Oneshot')
    oneshot_process = 'oneshot'

psettingspath = os.path.join(dirpath, 'p-settings.dat')

if not os.path.exists(psettingspath):
    tkmessagebox.showerror('OneShot not initialized', "OneShot's settings have not been initialized. Please start a new OneShot game, save and exit OneShot, then restart OneShot Save Utility.")
    quit()

archivepath = os.path.join(dirpath, 'OneShot Save Utility Archive')
if not os.path.exists(archivepath): os.makedirs(archivepath)

{'fraction_non_alphanumeric': 0.19781553398058252, 'fraction_numerical': 0.011225728155339806, 'mean_word_length': 5.174157303370786, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, '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': '5275972', 'n_tokens_mistral': 1090, 'n_tokens_neox': 1030, 'n_words': 272}