From a8daf48ee6a88199ae80f3fcdedf005faa812694 Mon Sep 17 00:00:00 2001 From: Jason Kane Date: Sat, 1 Jun 2024 10:50:57 -0700 Subject: [PATCH] iterating installation a bit --- .gitignore | 2 ++ config.json.default | 11 +++++++++++ dirty.bat | 3 ++- fresh.bat | 3 +++ pyproject.toml | 21 +++++++++++---------- src/coh_npc_voices/sidekick.py | 34 ++++++++++++++++++---------------- windows_installation.iss | 6 ++++-- 7 files changed, 51 insertions(+), 29 deletions(-) create mode 100644 config.json.default diff --git a/.gitignore b/.gitignore index 35be858..76e1378 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,8 @@ clip_library/ clip_library_saved/ raw_data/ +venv_backup/ +cache/ eleven_labs.key config.json diff --git a/config.json.default b/config.json.default new file mode 100644 index 0000000..91ba1fb --- /dev/null +++ b/config.json.default @@ -0,0 +1,11 @@ +{ + "npc_engine_primary": "Windows TTS", + "npc_engine_secondary": "Windows TTS", + "npc_engine_normalize": false, + "player_engine_primary": "Windows TTS", + "player_engine_secondary": "Windows TTS", + "player_engine_normalize": false, + "system_engine_primary": "Windows TTS", + "system_engine_secondary": "Windows TTS", + "system_engine_normalize": false +} \ No newline at end of file diff --git a/dirty.bat b/dirty.bat index d977579..39ca676 100644 --- a/dirty.bat +++ b/dirty.bat @@ -1,2 +1,3 @@ rmdir /s /q venv -rename venv_backup venv \ No newline at end of file +rename venv_backup venv +copy /Y config.json.backup config.json \ No newline at end of file diff --git a/fresh.bat b/fresh.bat index 14937ba..efb494e 100644 --- a/fresh.bat +++ b/fresh.bat @@ -1,5 +1,8 @@ powershell Invoke-PS2EXE .\win_install.ps1 .\win_install.exe rename venv venv_backup +copy /Y config.json config.json.backup +copy /Y config.json.default config.json + py -m venv --clear venv copy /Y win_venv_mover\activate.bat venv\Scripts\activate.bat copy /Y win_venv_mover\Activate.ps1 venv\Scripts\Activate.ps1 diff --git a/pyproject.toml b/pyproject.toml index d0ddda9..a06443a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "coh_npc_voices" -version = "1.1.0" +version = "2.0.0" authors = [ { name="Jason Kane" }, ] @@ -16,19 +16,20 @@ classifiers = [ "Operating System :: Microsoft :: Windows" ] dependencies = [ + "alembic", + "elevenlabs", + "google-cloud-texttospeech", + "matplotlib", + "pyfiglet", "pypiwin32", + "setuptools", + "sqlalchemy-utils", + "sqlalchemy", "tts @ git+https://github.com/DeepHorizons/tts@master#11cabe8", - "voicebox-tts[google-cloud-tts]", - "google-cloud-texttospeech", "voicebox-tts", + "voicebox-tts[elevenlabs]", + "voicebox-tts[google-cloud-tts]", "wheel", - "setuptools", - "matplotlib", - "sqlalchemy", - "sqlalchemy-utils", - "alembic", - "elevenlabs", - "voicebox-tts[elevenlabs]" ] [build-system] diff --git a/src/coh_npc_voices/sidekick.py b/src/coh_npc_voices/sidekick.py index cbca9ad..6e82c4d 100644 --- a/src/coh_npc_voices/sidekick.py +++ b/src/coh_npc_voices/sidekick.py @@ -1,30 +1,28 @@ """ There is more awesome to be had. """ +import ctypes import logging -from logging.config import dictConfig -import matplotlib.dates as md import multiprocessing -from datetime import datetime, timedelta +import os import sys import tkinter as tk +from datetime import datetime, timedelta +from logging.config import dictConfig from tkinter import ttk -from sqlalchemy import func, select -import models + +import engines +import matplotlib.dates as md import matplotlib.dates as mdates -import matplotlib.pyplot as pyplot -import voice_editor +import models import npc_chatter import numpy as np import settings -import engines - -from matplotlib.figure import Figure -from matplotlib.backends.backend_tkagg import ( - FigureCanvasTkAgg -) +import voice_editor +from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg +from matplotlib.figure import Figure +from sqlalchemy import func, select -import ctypes # this unlinks us from python so windows will # use our icon instead of the python icon in the # taskbar. @@ -487,8 +485,12 @@ def change_elevenlabs_key(self, a, b, c): h.write(self.elevenlabs_key.get()) def get_elevenlabs_key(self): - with open('eleven_labs.key', 'r') as h: - value = h.read() + keyfile = 'eleven_labs.key' + value = None + + if os.path.exists(keyfile): + with open(keyfile, 'r') as h: + value = h.read() return value def change_default_engine(self, a, b, c): diff --git a/windows_installation.iss b/windows_installation.iss index 0914025..ba56fcc 100644 --- a/windows_installation.iss +++ b/windows_installation.iss @@ -3,11 +3,11 @@ #define SourcePath "\\?\Volume{cc498e86-0000-0000-0000-602200000000}\Users\jason\Desktop\coh_npc_voices" #define MyAppName "Sidekick" -#define MyAppVersion "1.0" +#define MyAppVersion "2.0" #define MyAppPublisher "Jason Kane" #define MyAppURL "https://github.com/jason-kane/coh_npc_voices" #define MyAppExeName "Sidekick.bat" -#define MyAppIcon "sidekick.ico +#define MyAppIcon "sidekick.ico" [Setup] ; NOTE: The value of AppId uniquely identifies this application. Do not use the same AppId value in installers for other applications. @@ -42,10 +42,12 @@ Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{ Source: "{#SourcePath}\{#MyAppExeName}"; DestDir: "{app}"; Flags: ignoreversion Source: "{#SourcePath}\aliases.json"; DestDir: "{app}"; Flags: ignoreversion Source: "{#SourcePath}\all_npcs.json"; DestDir: "{app}"; Flags: ignoreversion +Source: "{#SourcePath}\config.json"; DestDir: "{app}"; Flags: ignoreversion Source: "{#SourcePath}\sidekick.ico"; DestDir: "{app}"; Flags: ignoreversion Source: "{#SourcePath}\requirements.txt"; DestDir: "{app}"; Flags: ignoreversion Source: "{#SourcePath}\win_install.exe"; DestDir: "{app}"; Flags: ignoreversion Source: "{#SourcePath}\src\coh_npc_voices\__init__.py"; DestDir: "{app}\src\coh_npc_voices\"; Flags: ignoreversion +Source: "{#SourcePath}\src\coh_npc_voices\audio.py"; DestDir: "{app}\src\coh_npc_voices\"; Flags: ignoreversion Source: "{#SourcePath}\src\coh_npc_voices\db.py"; DestDir: "{app}\src\coh_npc_voices\"; Flags: ignoreversion Source: "{#SourcePath}\src\coh_npc_voices\effects.py"; DestDir: "{app}\src\coh_npc_voices\"; Flags: ignoreversion Source: "{#SourcePath}\src\coh_npc_voices\engines.py"; DestDir: "{app}\src\coh_npc_voices\"; Flags: ignoreversion