Skip to content

Commit

Permalink
Merge pull request #76 from WhenLifeHandsYouLemons/v1.9.3
Browse files Browse the repository at this point in the history
v1.9.3
  • Loading branch information
WhenLifeHandsYouLemons authored Apr 18, 2024
2 parents b681f97 + 6c5421a commit 675473d
Show file tree
Hide file tree
Showing 37 changed files with 206 additions and 55 deletions.
218 changes: 172 additions & 46 deletions Encryptext.pyw

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion builds/build_number.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4
33
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
4 changes: 4 additions & 0 deletions encryptext_installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ def appCreation():
icon_path,
"--add-data",
f"{icon_path};.",
"--add-data",
f"{getTrueFilename('ttkbootstrap')};ttkbootstrap",
"--add-data",
f"{getTrueFilename('tkinter')};tkinter",
"--name",
"encryptext",
"--collect-all",
Expand Down
2 changes: 1 addition & 1 deletion example_file.etx
Original file line number Diff line number Diff line change
@@ -1 +1 @@
gAAAAABl_Qs3QPAHmqBiTVb4K3zzE4fttfrh0XCeOs-u4K2E0P_XTgdPn4dcfVlv7q_791vtLn2RtQv1ncOvwVY0ifhPZKmFx7lE18cFC-7aXEpWAh1yGBfU8ktLmMPZbftUAynCmuIRUNf60LcQYkHRnvOZGCcYUiWhH9l7fL9VegDk72S9KGvo-03CToRBUrjNJYYwr7tw2K3Jt1VhzYyyt3gwBd09qG-N_oiPC2LPDROLEZC_ynxVjA-FrGGoVzVu8ny5AuQbqjzqpKZoAlmRBzUUy_YlF4ir07zM7FhltTRbGDaecMPq-NF5W1lfcIsFuhgdC4lfi78kng_YthGs73FPDnyvR1MCxROCmaA7iS5yt7JHw6nZ_y3IhbqGXda3KJ48ArOMZPKFqPwuYKrKJvFUU-oa1TD50IKqEkztXyxheu3an5Tw6E9YJsdqj4KIs9JnOfYxbjiI-xln5CpZ37Aql_LTu6YYncI7ryhZGA-f5vSoxk0tNXnGelBkRdE-Bvw8rfy_d4Tar8v8OpARw8VFvwGgrERsyKnVE9Bl5xm-CpVvUEny0uicT1538-1r9nx2j-56yWt_SWQnGOfKxvoEgcdIPUZguBt4B8Ursigi6EFFDM1jx5LxZTVExVyE3ucX3m8htvC7GIE_LGgSMTyQIxQiI7L3kSeFG4wrHrPK3yEbab51u9zerxH7D6sv-FGGGYBq
italic4@@@1.36@@@1.44@@@Arial@@@11^^^colour5@@@1.24@@@1.32@@@#b70000@@@Arial@@@11^^^colour6@@@1.0@@@5.0@@@#00b740@@@Arial@@@11^^^colour7@@@3.8@@@3.14@@@#0f21ff@@@Arial@@@11^^^size8@@@3.47@@@3.53@@@Arial@@@9^^^size9@@@3.54@@@3.58@@@Arial@@@18^^^normal10@@@4.33@@@4.40@@@Arial@@@11^^^bold3@@@3.62@@@3.65@@@Arial@@@11^^^bold2@@@4.33@@@4.40@@@Arial@@@11^^^bold1@@@4.23@@@4.29@@@Arial@@@11^^^bold0@@@1.11@@@1.14@@@Arial@@@11&&&This is an etx file! It has special formatting features! Try it out here!\n\nYou can bolden or italicise text. You can also colour text in any way you want.\nYou can even make text BIGGER or smaller!\n
2 changes: 1 addition & 1 deletion file2.etx
Original file line number Diff line number Diff line change
@@ -1 +1 @@
italic0@@@1.12@@@1.14@@@Arial@@@11&&&file number 10\n
italic0@@@1.13@@@1.15@@@Arial@@@11&&&file number *10*\n
31 changes: 25 additions & 6 deletions installer_creator.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
#!/usr/bin/python'

from os import rename, path, remove
from os import rename, path
from shutil import rmtree, copy
import hashlib
import PyInstaller.__main__

version = "1.9.2"
version = "1.9.3"
testing = False

def update_build_number():
def update_build_number() -> str:
with open("builds/build_number.txt", "r") as file:
build_number = int(file.read().strip())
build_number += 1
Expand Down Expand Up @@ -47,6 +47,14 @@ def modifyInstallerFile(add: bool) -> None:
file.write(installer_file)
file.truncate()

def changeDebug(file_name: str, debug: bool) -> None:
with open(f".venv/Lib/site-packages/ttkbootstrap/{file_name}", "r+") as file:
lines = file.read()
lines = f"debug = {debug}".join(lines.split(f"debug = {not debug}"))
file.seek(0)
file.write(lines)
file.truncate()

# Open the key.txt file and read in the key
with open("Original Files/key.txt", "r") as file:
key = file.read().strip()
Expand All @@ -56,20 +64,27 @@ def modifyInstallerFile(add: bool) -> None:
# Add hash and version
modifyInstallerFile(True)

# Open the ttkbootstrap's files and change debug to False
changeDebug("style.py", False)

try:
# Creates an executable file
PyInstaller.__main__.run([
'encryptext_installer.py',
'--onefile',
'--clean',
'--log-level',
'ERROR',
'INFO',
'--icon',
'app_icon.ico',
'--add-data',
'app_icon.ico;.',
'--add-data',
'Encryptext.pyw;.',
'--add-data',
'.venv/Lib/site-packages/ttkbootstrap;ttkbootstrap',
'--add-data',
'.venv/Lib/site-packages/tkinter;tkinter',
"--collect-all",
"tkinterweb",
"--collect-all",
Expand All @@ -83,10 +98,12 @@ def modifyInstallerFile(add: bool) -> None:
# Remove hash and version
modifyInstallerFile(False)

# Open the ttkbootstrap's files and change debug to True
changeDebug("style.py", True)

# Remove pyinstaller folders and files
rmtree("dist")
rmtree("build")
remove("encryptext_installer.spec")

exit()

Expand All @@ -101,7 +118,9 @@ def modifyInstallerFile(add: bool) -> None:
version = '.'.join(version.split('.')[0:-1])
rename(path.join("dist", "encryptext_installer.exe"), f"builds/release/encryptext_installer_v{version}_64bit.exe")

# Open the ttkbootstrap's files and change debug to True
changeDebug("style.py", True)

# Remove pyinstaller folders and files
rmtree("dist")
rmtree("build")
remove("encryptext_installer.spec")
2 changes: 2 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ markdown
PyInstaller
alive_progress
pywin32
pygments
ttkbootstrap

0 comments on commit 675473d

Please sign in to comment.