Skip to content

Commit 100affc

Browse files
Fixed critical program issues
- Closed #80 - The program now packages the *ttkbootstrap* and *tkinter* modules as folders for it to access rather than let *pyinstaller* handle the package imports. - Moved update feature to the top of the program so even program with failing imports can still be used to update to a different version. - *ttk* is now imported from *ttkbootstrap* instead of *tk*. - Added return and parameter types to `installer_creator.py` - Added *ttkbootstrap* to python requirements file. - Added all v1.9.3 installer builds and the release build.
1 parent 520100f commit 100affc

33 files changed

Lines changed: 54 additions & 24 deletions

Encryptext.pyw

Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,25 +7,13 @@
77
"""
88
Imports
99
"""
10+
# Main imports
11+
# This allows the update to happen at least even if the other imports don't work
1012
import sys
1113
from os.path import abspath, join, expanduser
1214
# from os import getenv #! DOESN'T SEEM TO WORK IN EXE MODE
13-
import json
1415
from random import choice, randint
1516
from string import ascii_letters, digits
16-
import tkinter as tk
17-
from tkinter import font
18-
from tkinter import ttk
19-
from tkinter import filedialog
20-
from tkinter import messagebox
21-
from tkinter import colorchooser
22-
from traceback import format_exc, print_exc # For the error messages when in exe form
23-
from webbrowser import open_new # For opening the help page
24-
from cryptography.fernet import Fernet # For encryption features
25-
# For Markdown preview features
26-
import tkinterweb
27-
from markdown import markdown
28-
from ttkbootstrap import Style
2917

3018
# Used for getting files when using one-file mode .exe format
3119
def getTrueFilename(filename):
@@ -58,6 +46,24 @@ elif len(arguments) == 2:
5846
print(("".join([choice(possible_characters) for i in range(randint(15, 45))]), "".join([choice(possible_characters) for i in range(randint(15, 45))]), "".join([choice(possible_characters) for i in range(randint(15, 45))]), Fernet.generate_key().decode()))
5947
sys.exit(0)
6048

49+
# Other imports
50+
import json
51+
import tkinter as tk
52+
from tkinter import font
53+
from tkinter import filedialog
54+
from tkinter import messagebox
55+
from tkinter import colorchooser
56+
from traceback import format_exc, print_exc # For the error messages when in exe form
57+
from webbrowser import open_new # For opening the help page
58+
from cryptography.fernet import Fernet # For encryption features
59+
# For Markdown preview features
60+
import tkinterweb
61+
from markdown import markdown
62+
# Weird import method for ttkbootstrap
63+
if not debug:
64+
sys.path.append(getTrueFilename("ttkbootstrap"))
65+
import ttkbootstrap as ttk
66+
6167
try:
6268
settings_path = join(expanduser("~"), ".encryptext", "settings.json")
6369
with open(settings_path, "r", encoding="utf-8") as file:
@@ -438,9 +444,9 @@ Window Settings
438444
"""
439445
# Create the window and configure the background for theme changes
440446
if settings["otherSettings"]["theme"] == "light":
441-
styles = Style(theme="cosmo")
447+
styles = ttk.Style(theme="cosmo")
442448
else:
443-
styles = Style(theme="darkly")
449+
styles = ttk.Style(theme="darkly")
444450

445451
# root = tk.Tk()
446452
root = styles.master

builds/build_number.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
4
1+
30
21.8 MB
Binary file not shown.
21.4 MB
Binary file not shown.
21.6 MB
Binary file not shown.
21.9 MB
Binary file not shown.
21.9 MB
Binary file not shown.
21.9 MB
Binary file not shown.
21.9 MB
Binary file not shown.
21.7 MB
Binary file not shown.

0 commit comments

Comments
 (0)