From 456947095cad7d939a381ff7a2c7f8da106d9606 Mon Sep 17 00:00:00 2001 From: Thinkseal <132022649+Thinkseal@users.noreply.github.com> Date: Thu, 3 Oct 2024 12:44:23 -0400 Subject: [PATCH 01/17] added gui file --- versions/gui_gui.py | 135 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 135 insertions(+) create mode 100644 versions/gui_gui.py diff --git a/versions/gui_gui.py b/versions/gui_gui.py new file mode 100644 index 0000000..bb367bd --- /dev/null +++ b/versions/gui_gui.py @@ -0,0 +1,135 @@ +import pyperclip +import sys +import os +from tkinter import * +from tkinter import ttk +from functools import partial +from PIL import Image, ImageTk +sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) +from library.TextConverter import TextConverter +converter = TextConverter() + +def copy_to_clipboard(text): + pyperclip.copy(text.get()) + +def add_text(text_input): + ttk.Label( text=converter.reverse_text(text_input.get())).grid(row=2,column=2) + ttk.Label( text=converter.text_flip(text_input.get())).grid(row=4,column=2) + ttk.Label( text=converter.enchant_text(text_input.get())).grid(row=5,column=2) + +def add_copy_buttons(): + ttk.Button(root, text="copy", command=partial(copy_to_clipboard, translate_text),).grid(row=2, column=1) + +root = Tk() +root.title("Translator") +ico = Image.open('images/icon.ico') +ttk.Label( text="Enter text to translate:").grid(column=0, row=0) +translate_text = Entry(root) +translate_text.grid(row=1, column=0) +photo = ImageTk.PhotoImage(ico) +root.wm_iconphoto(False, photo) + +# +#ttk.Button(frm, text="Enchant text", ).grid(column=2, row=1) +#ttk.Button(frm, text="Change case", ).grid(column=0, row=2) +#ttk.Button(frm, text="Convert to leetspeak", ).grid(column=1, row=2) +#ttk.Button(frm, text="Scramble text", ).grid(column=2, row=2) +#ttk.Button(frm, text="Convert to Pig Latin", ).grid(column=0, row=3) +#ttk.Button(frm, text="Caesar cipher", ).grid(column=1, row=3) +#ttk.Button(frm, text="ASCII art", ).grid(column=2, row=3) +#ttk.Button(frm, text="Border text", ).grid(column=0, row=4) +#ttk.Button(frm, text="Zalgo text", ).grid(column=1, row=4) +#ttk.Button(frm, text="Morse code", ).grid(column=2, row=4) +#ttk.Button(frm, text="Binary text", ).grid(column=0, row=5) +#ttk.Button(frm, text="Shadow text", ).grid(column=1, row=5) +#ttk.Button(frm, text="Scroll text", ).grid(column=2, row=5) +#ttk.Button(frm, text="Generate QR code", ).grid(column=0, row=6) +#ttk.Button(frm, text="Text to emoticons", ).grid(column=1, row=6) +#ttk.Button(frm, text="Nerd mode", ).grid(column=2, row=6) +#ttk.Button(frm, text="exit", ).grid(column=2, row=7) + +ttk.Label( text="Reversed text:").grid(row=2,column=0) +ttk.Label( text="Fliped text:").grid(row=4,column=0) +ttk.Label( text="Enchanted text:").grid(row=5,column=0) + +ttk.Button(root, text="Submit", command=partial(add_text, translate_text),).grid(row=1, column=1) +add_copy_buttons() +root.mainloop() + +def main(): + while True: + choice = input("Enter your choice (0-18): ") + text = input("Enter the text to convert: ") + if choice == '4': + case = input("Enter 'upper' or 'lower': ") + result = converter.case_switch(text, case) + mode = 'case' + elif choice == '5': + result = converter.leetspeak(text) + mode = 'leetspeak' + elif choice == '6': + result = converter.scramble_text(text) + mode = 'scramble' + elif choice == '7': + result = converter.piglatin(text) + mode = 'piglatin' + elif choice == '8': + shift = int(input("Enter the shift value: ")) + result = converter.caesar_cipher(text, shift) + mode = 'caesar' + elif choice == '9': + result = converter.ascii_art(text) + mode = 'ascii' + elif choice == '10': + result = converter.border_text(text) + mode = 'border' + elif choice == '11': + result = converter.zalgo_text(text) + mode = 'zalgo' + elif choice == '12': + result = converter.morse_code(text) + mode = 'morse' + elif choice == '13': + result = converter.binary_text(text) + mode = 'binary' + elif choice == '14': + result = converter.text_shadow(text) + mode = 'shadow' + elif choice == '15': + converter.scroll_text(text) + input("\nPress any key to continue...") + os.system("clear") + continue + elif choice == '16': + filename = input("Enter the filename for the QR code: ") + result = converter.qr_code(text, filename) + mode = 'qr' + elif choice == '17': + result = converter.text_to_emoticons(text) + mode = 'emoticons' + elif choice == '18': + result = converter.nerd_mode(text) + mode = 'nerd' + else: + print("Invalid choice. Please try again.") + continue + + if isinstance(result, dict): + for key, value in result.items(): + print(f"{key}: {value}") + elif result: + print(result) + + if mode != 'qr': + copy_choice = input("Do you want to copy the result to clipboard? (y/n): ").lower() + if copy_choice == 'y': + if isinstance(result, dict): + copy_to_clipboard(str(result)) + else: + copy_to_clipboard(result) + + if mode != 'qr': + save_choice = input("Do you want to save the result to a history file? (y/n): ").lower() + if save_choice == 'y': + save_message = converter.save_result(result, mode) + print(save_message) \ No newline at end of file From 940d5390369b9db0ff44afab60b4683398284e66 Mon Sep 17 00:00:00 2001 From: Thinkseal <132022649+Thinkseal@users.noreply.github.com> Date: Thu, 3 Oct 2024 12:46:34 -0400 Subject: [PATCH 02/17] Update gui_gui.py to remove some leftover code from previous tests and the non-GUI version of this --- versions/gui_gui.py | 98 --------------------------------------------- 1 file changed, 98 deletions(-) diff --git a/versions/gui_gui.py b/versions/gui_gui.py index bb367bd..fc05f8a 100644 --- a/versions/gui_gui.py +++ b/versions/gui_gui.py @@ -1,6 +1,5 @@ import pyperclip import sys -import os from tkinter import * from tkinter import ttk from functools import partial @@ -29,25 +28,6 @@ def add_copy_buttons(): photo = ImageTk.PhotoImage(ico) root.wm_iconphoto(False, photo) -# -#ttk.Button(frm, text="Enchant text", ).grid(column=2, row=1) -#ttk.Button(frm, text="Change case", ).grid(column=0, row=2) -#ttk.Button(frm, text="Convert to leetspeak", ).grid(column=1, row=2) -#ttk.Button(frm, text="Scramble text", ).grid(column=2, row=2) -#ttk.Button(frm, text="Convert to Pig Latin", ).grid(column=0, row=3) -#ttk.Button(frm, text="Caesar cipher", ).grid(column=1, row=3) -#ttk.Button(frm, text="ASCII art", ).grid(column=2, row=3) -#ttk.Button(frm, text="Border text", ).grid(column=0, row=4) -#ttk.Button(frm, text="Zalgo text", ).grid(column=1, row=4) -#ttk.Button(frm, text="Morse code", ).grid(column=2, row=4) -#ttk.Button(frm, text="Binary text", ).grid(column=0, row=5) -#ttk.Button(frm, text="Shadow text", ).grid(column=1, row=5) -#ttk.Button(frm, text="Scroll text", ).grid(column=2, row=5) -#ttk.Button(frm, text="Generate QR code", ).grid(column=0, row=6) -#ttk.Button(frm, text="Text to emoticons", ).grid(column=1, row=6) -#ttk.Button(frm, text="Nerd mode", ).grid(column=2, row=6) -#ttk.Button(frm, text="exit", ).grid(column=2, row=7) - ttk.Label( text="Reversed text:").grid(row=2,column=0) ttk.Label( text="Fliped text:").grid(row=4,column=0) ttk.Label( text="Enchanted text:").grid(row=5,column=0) @@ -55,81 +35,3 @@ def add_copy_buttons(): ttk.Button(root, text="Submit", command=partial(add_text, translate_text),).grid(row=1, column=1) add_copy_buttons() root.mainloop() - -def main(): - while True: - choice = input("Enter your choice (0-18): ") - text = input("Enter the text to convert: ") - if choice == '4': - case = input("Enter 'upper' or 'lower': ") - result = converter.case_switch(text, case) - mode = 'case' - elif choice == '5': - result = converter.leetspeak(text) - mode = 'leetspeak' - elif choice == '6': - result = converter.scramble_text(text) - mode = 'scramble' - elif choice == '7': - result = converter.piglatin(text) - mode = 'piglatin' - elif choice == '8': - shift = int(input("Enter the shift value: ")) - result = converter.caesar_cipher(text, shift) - mode = 'caesar' - elif choice == '9': - result = converter.ascii_art(text) - mode = 'ascii' - elif choice == '10': - result = converter.border_text(text) - mode = 'border' - elif choice == '11': - result = converter.zalgo_text(text) - mode = 'zalgo' - elif choice == '12': - result = converter.morse_code(text) - mode = 'morse' - elif choice == '13': - result = converter.binary_text(text) - mode = 'binary' - elif choice == '14': - result = converter.text_shadow(text) - mode = 'shadow' - elif choice == '15': - converter.scroll_text(text) - input("\nPress any key to continue...") - os.system("clear") - continue - elif choice == '16': - filename = input("Enter the filename for the QR code: ") - result = converter.qr_code(text, filename) - mode = 'qr' - elif choice == '17': - result = converter.text_to_emoticons(text) - mode = 'emoticons' - elif choice == '18': - result = converter.nerd_mode(text) - mode = 'nerd' - else: - print("Invalid choice. Please try again.") - continue - - if isinstance(result, dict): - for key, value in result.items(): - print(f"{key}: {value}") - elif result: - print(result) - - if mode != 'qr': - copy_choice = input("Do you want to copy the result to clipboard? (y/n): ").lower() - if copy_choice == 'y': - if isinstance(result, dict): - copy_to_clipboard(str(result)) - else: - copy_to_clipboard(result) - - if mode != 'qr': - save_choice = input("Do you want to save the result to a history file? (y/n): ").lower() - if save_choice == 'y': - save_message = converter.save_result(result, mode) - print(save_message) \ No newline at end of file From be5707b69d7e5f1d88ea421e36f296055b6c42b2 Mon Sep 17 00:00:00 2001 From: Thinkseal <132022649+Thinkseal@users.noreply.github.com> Date: Thu, 3 Oct 2024 18:24:06 -0400 Subject: [PATCH 03/17] made code more readable --- versions/gui_gui.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/versions/gui_gui.py b/versions/gui_gui.py index fc05f8a..324dbff 100644 --- a/versions/gui_gui.py +++ b/versions/gui_gui.py @@ -22,16 +22,16 @@ def add_copy_buttons(): root = Tk() root.title("Translator") ico = Image.open('images/icon.ico') -ttk.Label( text="Enter text to translate:").grid(column=0, row=0) -translate_text = Entry(root) -translate_text.grid(row=1, column=0) photo = ImageTk.PhotoImage(ico) root.wm_iconphoto(False, photo) +ttk.Label( text="Enter text to translate:").grid(column=0, row=0) +translate_text = Entry(root) +translate_text.grid(row=1, column=0) ttk.Label( text="Reversed text:").grid(row=2,column=0) ttk.Label( text="Fliped text:").grid(row=4,column=0) ttk.Label( text="Enchanted text:").grid(row=5,column=0) - ttk.Button(root, text="Submit", command=partial(add_text, translate_text),).grid(row=1, column=1) add_copy_buttons() + root.mainloop() From 87d8cb918c007be4f526708be505a79368abbfbb Mon Sep 17 00:00:00 2001 From: Thinkseal <132022649+Thinkseal@users.noreply.github.com> Date: Thu, 3 Oct 2024 19:09:20 -0400 Subject: [PATCH 04/17] removed import sys --- versions/gui_gui.py | 1 - 1 file changed, 1 deletion(-) diff --git a/versions/gui_gui.py b/versions/gui_gui.py index 324dbff..811997e 100644 --- a/versions/gui_gui.py +++ b/versions/gui_gui.py @@ -1,5 +1,4 @@ import pyperclip -import sys from tkinter import * from tkinter import ttk from functools import partial From 64c33319f06feb1ef4d973ae5350b10d96798169 Mon Sep 17 00:00:00 2001 From: Thinkseal <132022649+Thinkseal@users.noreply.github.com> Date: Thu, 3 Oct 2024 19:13:04 -0400 Subject: [PATCH 05/17] re added import sys because find and replaced did not show the one time it was used --- versions/gui_gui.py | 1 + 1 file changed, 1 insertion(+) diff --git a/versions/gui_gui.py b/versions/gui_gui.py index 811997e..324dbff 100644 --- a/versions/gui_gui.py +++ b/versions/gui_gui.py @@ -1,4 +1,5 @@ import pyperclip +import sys from tkinter import * from tkinter import ttk from functools import partial From b97f3b82800e4988f6eb538c28d4d1c1d61ddfd8 Mon Sep 17 00:00:00 2001 From: Thinkseal <132022649+Thinkseal@users.noreply.github.com> Date: Thu, 3 Oct 2024 19:13:53 -0400 Subject: [PATCH 06/17] same thing for os --- versions/gui_gui.py | 1 + 1 file changed, 1 insertion(+) diff --git a/versions/gui_gui.py b/versions/gui_gui.py index 324dbff..65c01c2 100644 --- a/versions/gui_gui.py +++ b/versions/gui_gui.py @@ -1,4 +1,5 @@ import pyperclip +import os import sys from tkinter import * from tkinter import ttk From 97cde9a7ebb5a7478f50d7ee79afad0a1fe88e3b Mon Sep 17 00:00:00 2001 From: KTrain <69028025+KTrain5169@users.noreply.github.com> Date: Fri, 25 Oct 2024 20:46:06 +1000 Subject: [PATCH 07/17] Tell CI to build the GUI script as well --- .github/workflows/build.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bc4a608..a988843 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -41,6 +41,9 @@ jobs: - name: PyInstaller (CLI) run: pyinstaller --icon=images/icon.ico versions/cli_args.py + - name: PyInstaller (GUI) + run: pyinstaller --icon=images/icon.ico versions/gui_gui.py + - name: Upload Builds uses: actions/upload-artifact@v4 with: From 6a90599e2c1f7621c26dbce985069029d6938d6b Mon Sep 17 00:00:00 2001 From: KTrain <69028025+KTrain5169@users.noreply.github.com> Date: Sat, 26 Oct 2024 12:57:15 +1000 Subject: [PATCH 08/17] Update build.yml to include the translator ico --- .github/workflows/build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1809349..1149711 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -36,13 +36,13 @@ jobs: pip install pyinstaller - name: PyInstaller (Terminal GUI) - run: pyinstaller --icon=images/icon.ico versions/terminal_gui.py + run: pyinstaller versions/terminal_gui.py --icon=images/icon.ico - name: PyInstaller (CLI) - run: pyinstaller --icon=images/icon.ico versions/cli_args.py + run: pyinstaller versions/cli_args.py --icon=images/icon.ico - name: PyInstaller (GUI) - run: pyinstaller --icon=images/icon.ico versions/gui_gui.py + run: pyinstaller versions/gui_gui.py --icon=images/icon.ico --add-data "images/icon.ico;images" - name: Upload Builds uses: actions/upload-artifact@v4 From 383492b5c4550658011fa20d15facf7fb4e3f188 Mon Sep 17 00:00:00 2001 From: Thinkseal <132022649+Thinkseal@users.noreply.github.com> Date: Sun, 27 Oct 2024 13:28:27 -0400 Subject: [PATCH 09/17] Add files via upload --- images/content_copy.png | Bin 0 -> 4624 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 images/content_copy.png diff --git a/images/content_copy.png b/images/content_copy.png new file mode 100644 index 0000000000000000000000000000000000000000..53bfca39ec57855c7a7278d1fb62552fd8486435 GIT binary patch literal 4624 zcmeHLdsGuw8Xq4kF&0}3R*JNaQICS1WM&fbm?p?0lw=_o0p+o-IGLG*(IgX-kp$`+ zT@?{u)kSNCrCsfAsk^SLQt&Netx8+9)RtBhtuG#e)%w84-Xw^4w&(2eob7+)oXO1G z?{|OS_x--_-jkc<#^i)RVW<#-pg_G&n*#2`yq91A_`VQvwhY`3<)>xvDWn^AI5{(G zWnezf!N81%HA9f+dz-N#@CYh+XelgSu<#sOd}e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__`qQTsJkDRjaGz-1aCZ*ltq)KP!BFIxV#+SXBwZOxyt~HJl+}{|5=HF; z^w?&=JpUNjzQArM>D~^zL<150mY=R-{FW|YxYx-G>Dwz;uUs#rzzczUyQ^2O7gFGb zz`fn|f0Il2>_ElX!OtK!I4(Iaj|&G!tpTRQ1g-DT1>KLUo)4Y|I&_&X2pSaRz4}0# zHiv-00A6p154a|L9U3cGGG|}~I8RsUwJ~YBW3As*+k;|)Ydadx#avvg8#%Z(ro0Re z{BvP(-$}4AG$NvAP`k0c|LynIyn>WR2X9yw9euKP@aJoi%129si^i<;xL3v=PjCI< zvFl39Ms88)ox&KjAXXrrmXSRF_T=c{$`!wpeR4%~acnNpTK~AxwcT{+)wZT7=RcC= zXss8Re}wRFx7L&4d%ta*v8=wmfBKG<1;Tsx=T!Z1&Y?QYlN_(ZBKwW6T&(acB%>Zr zikvlk)vbs3srG4D$+6HW1z*LFO4zmVPIC1(rLX0F{UmA_HMOQ-dF18Vj6s!4w^c@A z^2A+9ADmI%+E;WUZ`2sJBy(l>nDxm*q~J;Fqot*SH{~nl-FqLe_<6&Qy6NG99qBI> z2iAtXA9O_?q-ILb9Sv01e%$mR`@|LbVe$=iQ_wU^V`XXQ7pG6xyuJ6-@U(NU{5^#(?hv8!0YS{nNF&i{{_6WB1(c_^^LeO~CD0=h!`_%(}bnkyl$rww*l} ztsVB|y0nVj>89&12Nu2BtXw(%v!v8hXMVZA$G!AHXzS2|)QpoqrCWA|Z?i7jmt4Jm ohUDO$Pg_@?ZrQ2~B@~ literal 0 HcmV?d00001 From 7ac7ed4de266a6068d67bb0f140b59e8826b321c Mon Sep 17 00:00:00 2001 From: Thinkseal <132022649+Thinkseal@users.noreply.github.com> Date: Sun, 27 Oct 2024 13:32:06 -0400 Subject: [PATCH 10/17] Update gui_gui.py --- versions/gui_gui.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/versions/gui_gui.py b/versions/gui_gui.py index 65c01c2..0cfa49b 100644 --- a/versions/gui_gui.py +++ b/versions/gui_gui.py @@ -9,22 +9,25 @@ from library.TextConverter import TextConverter converter = TextConverter() -def copy_to_clipboard(text): - pyperclip.copy(text.get()) +def FlipedTextCopy(text): + pyperclip.copy(converter.reverse_text(converter.text_flip(text.get()))) def add_text(text_input): - ttk.Label( text=converter.reverse_text(text_input.get())).grid(row=2,column=2) - ttk.Label( text=converter.text_flip(text_input.get())).grid(row=4,column=2) - ttk.Label( text=converter.enchant_text(text_input.get())).grid(row=5,column=2) + ttk.Label( text=converter.reverse_text(text_input.get()),justify="left").grid(sticky = W,row=2,column=2) + ttk.Label( text=converter.text_flip(text_input.get()),justify="left").grid(sticky = W,row=4,column=2) + ttk.Label( text=converter.enchant_text(text_input.get()),justify="left").grid(sticky = W,row=5,column=2) def add_copy_buttons(): - ttk.Button(root, text="copy", command=partial(copy_to_clipboard, translate_text),).grid(row=2, column=1) + ttk.Button(root, command=partial(FlipedTextCopy, translate_text), image = copy_icon).grid(row=2, column=1) root = Tk() root.title("Translator") ico = Image.open('images/icon.ico') photo = ImageTk.PhotoImage(ico) root.wm_iconphoto(False, photo) +root.geometry("600x300") +copy_icon = Image.open('images/content_copy.png') +copy_icon = ImageTk.PhotoImage(copy_icon) ttk.Label( text="Enter text to translate:").grid(column=0, row=0) translate_text = Entry(root) From b3fe26a3090df60c6b40829b54cc86cac8828c59 Mon Sep 17 00:00:00 2001 From: Thinkseal <132022649+Thinkseal@users.noreply.github.com> Date: Mon, 28 Oct 2024 18:27:16 -0400 Subject: [PATCH 11/17] window now changes with input size --- versions/gui_gui.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/versions/gui_gui.py b/versions/gui_gui.py index 0cfa49b..04fbf96 100644 --- a/versions/gui_gui.py +++ b/versions/gui_gui.py @@ -13,6 +13,8 @@ def FlipedTextCopy(text): pyperclip.copy(converter.reverse_text(converter.text_flip(text.get()))) def add_text(text_input): + x_size=int(9*len(text_input.get())+300) + root.geometry(f"{x_size}x{300}") ttk.Label( text=converter.reverse_text(text_input.get()),justify="left").grid(sticky = W,row=2,column=2) ttk.Label( text=converter.text_flip(text_input.get()),justify="left").grid(sticky = W,row=4,column=2) ttk.Label( text=converter.enchant_text(text_input.get()),justify="left").grid(sticky = W,row=5,column=2) @@ -25,7 +27,7 @@ def add_copy_buttons(): ico = Image.open('images/icon.ico') photo = ImageTk.PhotoImage(ico) root.wm_iconphoto(False, photo) -root.geometry("600x300") +root.geometry("300x300") copy_icon = Image.open('images/content_copy.png') copy_icon = ImageTk.PhotoImage(copy_icon) From ed256204ae5a37784f1179debbd68b8629794697 Mon Sep 17 00:00:00 2001 From: Thinkseal <132022649+Thinkseal@users.noreply.github.com> Date: Wed, 13 Nov 2024 18:08:05 -0500 Subject: [PATCH 12/17] Add files via upload --- images/content_copy.png | Bin 4624 -> 4837 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/images/content_copy.png b/images/content_copy.png index 53bfca39ec57855c7a7278d1fb62552fd8486435..b974cad5dd562f9d2157cd4ce63775793be37f2a 100644 GIT binary patch delta 1277 zcmVchCvvS?jV0ZM9~%pD~LE`s7`jVB965RMW_&Jg;pI*F8zWg z4M~cNqu^R_@ME#+;Nq;SgR3A2etTAdF$e5tNvz&xv9hp5yBtKEB??c$W9MKSx+8m<;d<#0h_<8y4{f z@yw>BbKWP8u(G5OpA%0SbV1@ruFEdJaV|OR=a~^Bo0%t$5DTR)mb;jh4V8GBII5@` z<@<9kE1b7DtJOMd-;=*ERM1wIxlVHoDJ)_MA_T~&qk<|d#Aww>F_EGDq=$dh@r&e= z$yEU(#{z0lAvu2VKlt6PS&V;Axk;fU(DP#3ALBspF3@V&_V=-Ew@!e-GjOGK{Iw=9 z`$>AEqeYK^!ENB;x}(W^z~v4w@}x_KH8eUfG%YYSIxsLI3LqdLcx`YxO>bmrW_d(mbY(pvGB7eUIx#Ui zF*8&#HaaylIxsXXFg3H01`h#~yarq(W;8c9VK*^1EiyG?FfBAQVmK{1HDNFt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EZ+y&4c}vL z8a(Cb&f#WCX(zY$@uLJj#0T_o*lD+7SzgZf@HOY`A@0=JKtvbMlT@s>S7PZ84U7`& zIE^d0OjFI%_W8GWhx!`r6@yb)%;i^SwJE1;h`mm`m1-}*x2^4v((I-<4La5@OXrF| TX!R#n00000NkvXXu0mjfQ)M8K From f05d8ce0c279626f400924bd7b31b7a18e6d175f Mon Sep 17 00:00:00 2001 From: Thinkseal <132022649+Thinkseal@users.noreply.github.com> Date: Wed, 13 Nov 2024 18:10:00 -0500 Subject: [PATCH 13/17] Update gui_gui.py --- versions/gui_gui.py | 93 ++++++++++++++++++++++++++++++++++++--------- 1 file changed, 75 insertions(+), 18 deletions(-) diff --git a/versions/gui_gui.py b/versions/gui_gui.py index 04fbf96..382bbb2 100644 --- a/versions/gui_gui.py +++ b/versions/gui_gui.py @@ -8,36 +8,93 @@ sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) from library.TextConverter import TextConverter converter = TextConverter() +text_lable_column=0 +copy_button_column=1 +text_output_column=2 -def FlipedTextCopy(text): - pyperclip.copy(converter.reverse_text(converter.text_flip(text.get()))) +def copy_to_clipboard(text): + pyperclip.copy(text['text']) -def add_text(text_input): - x_size=int(9*len(text_input.get())+300) - root.geometry(f"{x_size}x{300}") - ttk.Label( text=converter.reverse_text(text_input.get()),justify="left").grid(sticky = W,row=2,column=2) - ttk.Label( text=converter.text_flip(text_input.get()),justify="left").grid(sticky = W,row=4,column=2) - ttk.Label( text=converter.enchant_text(text_input.get()),justify="left").grid(sticky = W,row=5,column=2) +def add_text(*args): + x_size=int(8.5*len(translate_text.get())+240) + root.geometry(f"{x_size}x{380}") + new_text = translate_text.get() + reversed_text['text'] = converter.reverse_text(new_text) + flipped_text['text'] = converter.text_flip(new_text) + enchanted_text['text'] = converter.enchant_text(new_text) + capitalized_text['text'] = converter.case_switch(new_text, "upper") + lowercased_text['text'] = converter.case_switch(new_text, "lower") + leetspeak_text['text'] = converter.leetspeak(new_text) + scrambled_text['text'] = converter.scramble_text(new_text) + piglatin_text['text'] = converter.piglatin(new_text) + zalgo_text['text'] = converter.zalgo_text(new_text) + emoticons_text['text'] = converter.text_to_emoticons(new_text) def add_copy_buttons(): - ttk.Button(root, command=partial(FlipedTextCopy, translate_text), image = copy_icon).grid(row=2, column=1) + ttk.Button(root, command=partial(copy_to_clipboard, reversed_text), image = copy_icon).grid(sticky = W, row=1, column=copy_button_column) + ttk.Button(root, command=partial(copy_to_clipboard, flipped_text), image = copy_icon).grid(sticky = W, row=2, column=copy_button_column) + ttk.Button(root, command=partial(copy_to_clipboard, enchanted_text), image = copy_icon).grid(sticky = W, row=3, column=copy_button_column) + ttk.Button(root, command=partial(copy_to_clipboard, capitalized_text), image = copy_icon).grid(sticky = W, row=4, column=copy_button_column) + ttk.Button(root, command=partial(copy_to_clipboard, capitalized_text), image = copy_icon).grid(sticky = W, row=5, column=copy_button_column) + ttk.Button(root, command=partial(copy_to_clipboard, leetspeak_text), image = copy_icon).grid(sticky = W, row=6, column=copy_button_column) + ttk.Button(root, command=partial(copy_to_clipboard, scrambled_text), image = copy_icon).grid(sticky = W, row=7, column=copy_button_column) + ttk.Button(root, command=partial(copy_to_clipboard, piglatin_text), image = copy_icon).grid(sticky = W, row=8, column=copy_button_column) + ttk.Button(root, command=partial(copy_to_clipboard, zalgo_text), image = copy_icon).grid(sticky = W, row=9, column=copy_button_column) + ttk.Button(root, command=partial(copy_to_clipboard, emoticons_text), image = copy_icon).grid(sticky = W, row=10, column=copy_button_column) root = Tk() root.title("Translator") ico = Image.open('images/icon.ico') photo = ImageTk.PhotoImage(ico) root.wm_iconphoto(False, photo) -root.geometry("300x300") +root.geometry("240x380") copy_icon = Image.open('images/content_copy.png') copy_icon = ImageTk.PhotoImage(copy_icon) -ttk.Label( text="Enter text to translate:").grid(column=0, row=0) -translate_text = Entry(root) -translate_text.grid(row=1, column=0) -ttk.Label( text="Reversed text:").grid(row=2,column=0) -ttk.Label( text="Fliped text:").grid(row=4,column=0) -ttk.Label( text="Enchanted text:").grid(row=5,column=0) -ttk.Button(root, text="Submit", command=partial(add_text, translate_text),).grid(row=1, column=1) -add_copy_buttons() +translate_text = StringVar() +translate_text.trace_add("write", add_text) +input_widget = ttk.Entry(root, textvariable=translate_text) +input_widget.grid(row=0, column=0, columnspan=2) + +ttk.Label(text="Reversed text:").grid(row=1,column=text_lable_column) +reversed_text = ttk.Label(justify="left") +reversed_text.grid(row=1, column=text_output_column, sticky = W) + +ttk.Label(text="Flipped text:").grid(row=2,column=text_lable_column) +flipped_text = ttk.Label(justify="left") +flipped_text.grid(row=2, column=text_output_column, sticky = W) + +ttk.Label(text="Enchanted text:").grid(row=3,column=text_lable_column) +enchanted_text = ttk.Label(justify="left") +enchanted_text.grid(row=3, column=text_output_column, sticky = W) + +ttk.Label(text="Capitalized text:").grid(row=4,column=text_lable_column) +capitalized_text = ttk.Label(justify="left") +capitalized_text.grid(row=4, column=text_output_column, sticky = W) + +ttk.Label(text="Lowercased text:").grid(row=5,column=text_lable_column) +lowercased_text = ttk.Label(justify="left") +lowercased_text.grid(row=5, column=text_output_column, sticky = W) +ttk.Label(text="Leetspeak text:").grid(row=6,column=text_lable_column) +leetspeak_text = ttk.Label(justify="left") +leetspeak_text.grid(row=6, column=text_output_column, sticky = W) + +ttk.Label(text="Scrambled text:").grid(row=7,column=text_lable_column) +scrambled_text = ttk.Label(justify="left") +scrambled_text.grid(row=7, column=text_output_column, sticky = W) + +ttk.Label(text="piglatin text:").grid(row=8,column=text_lable_column) +piglatin_text = ttk.Label(justify="left") +piglatin_text.grid(row=8, column=text_output_column, sticky = W) + +ttk.Label(text="zalgo text:").grid(row=9,column=text_lable_column) +zalgo_text = ttk.Label(justify="left") +zalgo_text.grid(row=9, column=text_output_column, sticky = W) + +ttk.Label(text="emoticons text:").grid(row=10,column=text_lable_column) +emoticons_text = ttk.Label(justify="left") +emoticons_text.grid(row=10, column=text_output_column, sticky = W) + +add_copy_buttons() root.mainloop() From daad999afeba2fc6cde5f9f68db118b3193fdcd9 Mon Sep 17 00:00:00 2001 From: Thinkseal <132022649+Thinkseal@users.noreply.github.com> Date: Wed, 13 Nov 2024 21:35:09 -0500 Subject: [PATCH 14/17] Update gui_gui.py --- versions/gui_gui.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/versions/gui_gui.py b/versions/gui_gui.py index 382bbb2..86dec6e 100644 --- a/versions/gui_gui.py +++ b/versions/gui_gui.py @@ -16,9 +16,9 @@ def copy_to_clipboard(text): pyperclip.copy(text['text']) def add_text(*args): - x_size=int(8.5*len(translate_text.get())+240) - root.geometry(f"{x_size}x{380}") new_text = translate_text.get() + x_size=int(8.5*len(new_text)+240) + root.geometry(f"{x_size}x{380}") reversed_text['text'] = converter.reverse_text(new_text) flipped_text['text'] = converter.text_flip(new_text) enchanted_text['text'] = converter.enchant_text(new_text) From abe5fb1acbefc8e3f2e31fa712e34337a4b614c7 Mon Sep 17 00:00:00 2001 From: Thinkseal <132022649+Thinkseal@users.noreply.github.com> Date: Wed, 13 Nov 2024 21:38:15 -0500 Subject: [PATCH 15/17] Update gui_gui.py --- versions/gui_gui.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/versions/gui_gui.py b/versions/gui_gui.py index 86dec6e..fac1e02 100644 --- a/versions/gui_gui.py +++ b/versions/gui_gui.py @@ -18,7 +18,7 @@ def copy_to_clipboard(text): def add_text(*args): new_text = translate_text.get() x_size=int(8.5*len(new_text)+240) - root.geometry(f"{x_size}x{380}") + root.geometry(f"{x_size}x{350}") reversed_text['text'] = converter.reverse_text(new_text) flipped_text['text'] = converter.text_flip(new_text) enchanted_text['text'] = converter.enchant_text(new_text) @@ -47,7 +47,7 @@ def add_copy_buttons(): ico = Image.open('images/icon.ico') photo = ImageTk.PhotoImage(ico) root.wm_iconphoto(False, photo) -root.geometry("240x380") +root.geometry("240x350") copy_icon = Image.open('images/content_copy.png') copy_icon = ImageTk.PhotoImage(copy_icon) From f67422a175845e8e8e015867451726513f263cc8 Mon Sep 17 00:00:00 2001 From: Thinkseal <132022649+Thinkseal@users.noreply.github.com> Date: Wed, 13 Nov 2024 22:52:36 -0500 Subject: [PATCH 16/17] Update gui_gui.py --- versions/gui_gui.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/versions/gui_gui.py b/versions/gui_gui.py index fac1e02..3fa8303 100644 --- a/versions/gui_gui.py +++ b/versions/gui_gui.py @@ -56,43 +56,43 @@ def add_copy_buttons(): input_widget = ttk.Entry(root, textvariable=translate_text) input_widget.grid(row=0, column=0, columnspan=2) -ttk.Label(text="Reversed text:").grid(row=1,column=text_lable_column) +ttk.Label(text="Reversed:").grid(row=1,column=text_lable_column) reversed_text = ttk.Label(justify="left") reversed_text.grid(row=1, column=text_output_column, sticky = W) -ttk.Label(text="Flipped text:").grid(row=2,column=text_lable_column) +ttk.Label(text="Flipped:").grid(row=2,column=text_lable_column) flipped_text = ttk.Label(justify="left") flipped_text.grid(row=2, column=text_output_column, sticky = W) -ttk.Label(text="Enchanted text:").grid(row=3,column=text_lable_column) +ttk.Label(text="Enchanted:").grid(row=3,column=text_lable_column) enchanted_text = ttk.Label(justify="left") enchanted_text.grid(row=3, column=text_output_column, sticky = W) -ttk.Label(text="Capitalized text:").grid(row=4,column=text_lable_column) +ttk.Label(text="Capitalized:").grid(row=4,column=text_lable_column) capitalized_text = ttk.Label(justify="left") capitalized_text.grid(row=4, column=text_output_column, sticky = W) -ttk.Label(text="Lowercased text:").grid(row=5,column=text_lable_column) +ttk.Label(text="Lowercased:").grid(row=5,column=text_lable_column) lowercased_text = ttk.Label(justify="left") lowercased_text.grid(row=5, column=text_output_column, sticky = W) -ttk.Label(text="Leetspeak text:").grid(row=6,column=text_lable_column) +ttk.Label(text="Leetspeak:").grid(row=6,column=text_lable_column) leetspeak_text = ttk.Label(justify="left") leetspeak_text.grid(row=6, column=text_output_column, sticky = W) -ttk.Label(text="Scrambled text:").grid(row=7,column=text_lable_column) +ttk.Label(text="Scrambled:").grid(row=7,column=text_lable_column) scrambled_text = ttk.Label(justify="left") scrambled_text.grid(row=7, column=text_output_column, sticky = W) -ttk.Label(text="piglatin text:").grid(row=8,column=text_lable_column) +ttk.Label(text="piglatin:").grid(row=8,column=text_lable_column) piglatin_text = ttk.Label(justify="left") piglatin_text.grid(row=8, column=text_output_column, sticky = W) -ttk.Label(text="zalgo text:").grid(row=9,column=text_lable_column) +ttk.Label(text="zalgo:").grid(row=9,column=text_lable_column) zalgo_text = ttk.Label(justify="left") zalgo_text.grid(row=9, column=text_output_column, sticky = W) -ttk.Label(text="emoticons text:").grid(row=10,column=text_lable_column) +ttk.Label(text="emoticons:").grid(row=10,column=text_lable_column) emoticons_text = ttk.Label(justify="left") emoticons_text.grid(row=10, column=text_output_column, sticky = W) From b86bd76e142fa595f30e997e5e1f2f695aa58779 Mon Sep 17 00:00:00 2001 From: KTrain <69028025+KTrain5169@users.noreply.github.com> Date: Sat, 16 Nov 2024 12:27:23 +1000 Subject: [PATCH 17/17] fix build workflow failing due to syntax adding to release workflow later --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1149711..9970e7d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -42,7 +42,7 @@ jobs: run: pyinstaller versions/cli_args.py --icon=images/icon.ico - name: PyInstaller (GUI) - run: pyinstaller versions/gui_gui.py --icon=images/icon.ico --add-data "images/icon.ico;images" + run: pyinstaller versions/gui_gui.py --icon=images/icon.ico --add-data "images/icon.ico:images" - name: Upload Builds uses: actions/upload-artifact@v4