Skip to content

Commit

Permalink
fix: requirements, placeholder detection, ico file, code generation a…
Browse files Browse the repository at this point in the history
…nd excess image generation

fix: add icon in .ico format and fix requirements.txt file

fix: code generation and excess image generation

awd
  • Loading branch information
Axorax committed May 5, 2024
1 parent b85278a commit 99a144e
Show file tree
Hide file tree
Showing 13 changed files with 28 additions and 116 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Folders

.env/
env/
dist/
build/
Expand All @@ -10,4 +11,5 @@ test/
# Files

main.py
*.spec
*.spec
*.txt
Binary file added assets/icon.ico
Binary file not shown.
Binary file modified assets/image_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed assets/image_5.png
Binary file not shown.
Binary file removed assets/image_6.png
Binary file not shown.
Binary file removed assets/image_7.png
Binary file not shown.
1 change: 0 additions & 1 deletion build-cli.sh

This file was deleted.

7 changes: 7 additions & 0 deletions build.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
@echo off

if "%1" == "cli" (
pyinstaller --name="tkforge-cli" --onefile --paths=env/Lib/site-packages tkforge.py --icon=assets/icon.png
) else (
pyinstaller --name="TkForge" --onefile --paths=env/Lib/site-packages --add-data="assets;assets" gui.py --noconsole --icon=assets/icon.png
)
8 changes: 7 additions & 1 deletion build.sh
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
pyinstaller --name="TkForge" --onefile --paths=env/Lib/site-packages --add-data="assets:assets" gui.py --noconsole --icon=assets/icon.png
#!/bin/bash

if [ "$1" == "cli" ]; then
pyinstaller --name="tkforge-cli" --onefile --paths=env/Lib/site-packages tkforge.py --icon=assets/icon.png
else
pyinstaller --name="TkForge" --onefile --paths=env/Lib/site-packages --add-data="assets:assets" gui.py --noconsole --icon=assets/icon.png
fi
4 changes: 0 additions & 4 deletions core.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,10 +159,6 @@ def download(image_count):
entry_placeholder = True
elif type == 'textarea':
text_placeholder = True

if download_images:
image_count += 1
download(image_count)
elif type == 'button' and download_images:
image_count += 1
download(image_count)
Expand Down
12 changes: 0 additions & 12 deletions gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,6 @@ def get_placeholder(self): return self.p

# Figma token input

token_input_image = tk.PhotoImage(file=load_asset("image_6.png"))

canvas.create_image(541, 123, image=token_input_image)

token_input = TkForge_Entry(
bd=0,
bg="#f5f5f5",
Expand All @@ -97,10 +93,6 @@ def get_placeholder(self): return self.p

# File URL input

file_input_image = tk.PhotoImage(file=load_asset("image_7.png"))

canvas.create_image(541, 205, image=file_input_image)

file_input = TkForge_Entry(
bd=0,
bg="#f5f5f5",
Expand All @@ -113,10 +105,6 @@ def get_placeholder(self): return self.p

# Output path textbox

outpath_input_image = tk.PhotoImage(file=load_asset("image_5.png"))

canvas.create_image(525, 286, image=outpath_input_image)

outpath_input = TkForge_Entry(
bd=0,
bg="#f5f5f5",
Expand Down
90 changes: 5 additions & 85 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,86 +1,6 @@
aiohttp==3.8.4
aiosignal==1.3.1
altgraph==0.17.3
async-timeout==4.0.2
asyncio==3.4.3
attrs==23.1.0
blinker==1.6.2
bottle==0.12.25
cachetools==5.3.2
certifi==2021.5.30
cffi==1.15.1
chardet==4.0.0
charset-normalizer==3.2.0
click==8.1.6
clr-loader==0.2.5
certifi==2024.2.2
charset-normalizer==3.3.2
colorama==0.4.6
colorharmonies==1.0.5
colour==0.1.5
contourpy==1.2.0
CTkMessagebox==2.5
customtkinter==5.2.2
cx-Freeze==6.15.5
cx-Logging==3.1.0
cycler==0.12.1
darkdetect==0.8.0
discord-protos==0.0.2
discord.py-self @ git+https://github.com/pc111c/discord.py-self.git@e16f555c9e78411b1511fee2273448083d07ab63
distro==1.9.0
Flask==2.3.2
flaskwebgui==1.0.6
fonttools==4.49.0
frozenlist==1.3.3
google-api-core==2.15.0
google-api-python-client==2.112.0
google-auth==2.26.1
google-auth-httplib2==0.2.0
googleapis-common-protos==1.62.0
httplib2==0.22.0
idna==2.10
importlib-resources==6.1.1
itsdangerous==2.1.2
Jinja2==3.0.1
kiwisolver==1.4.5
lief==0.13.2
loguru==0.7.2
MarkupSafe==2.0.1
matplotlib==3.8.3
multidict==6.0.4
numpy==1.26.4
oauth2client==4.1.3
packaging==23.2
pathvalidate==3.2.0
pefile==2023.2.7
pillar-youtube-upload==0.3.0
pillow==10.2.0
protobuf==4.25.1
proxy-tools==0.1.0
psutil==5.9.5
pyasn1==0.5.1
pyasn1-modules==0.3.0
pycparser==2.21
pyinstaller==6.2.0
pyinstaller-hooks-contrib==2023.6
pyparsing==3.1.1
pyperclip==1.8.2
python-dateutil==2.8.2
pythonnet==3.0.1
pytube @ git+https://github.com/pishiko/pytube.git@42a7d8322dd7749a9e950baf6860d115bbeaedfc
pywebview==4.2.2
pywin32-ctypes==0.2.2
requests==2.25.1
rsa==4.9
scikit-build==0.17.6
scrapetube==2.5.1
six==1.16.0
tomli==2.0.1
tqdm==4.65.0
typing_extensions==4.7.1
tzdata==2024.1
tzlocal==5.2
uritemplate==4.1.1
urllib3==1.26.6
Werkzeug==2.3.6
win32-setctime==1.1.0
yarl==1.9.2
zipp==3.15.0
idna==3.7
requests==2.31.0
urllib3==2.2.1
18 changes: 6 additions & 12 deletions tk.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,33 +35,27 @@ def image(i, c):
'''

def textbox(i, c, p=False):
p = f''',\n placeholder="{i['placeholder']}",''' if p else ","
s = f''',\n placeholder="{i['placeholder']}",''' if p else ","
return f'''
textbox_image_{c} = tk.PhotoImage(file=load_asset("{i["image"]}"))
canvas.create_image({int(i['x'] + i['width'] / 2)}, {int(i['y'] + i['height'] / 2)}, image=textbox_image_{c})
textbox_{c} = {"TkForge_Entry" if p else "tk.Entry"}(
bd=0,
bg="{i["background"]}",
fg="{i['foreground']}"{p}
fg="{i['foreground']}"{s}
insertbackground="{i['foreground']}",
highlightthickness=0
)
textbox_{c}.place(x={i["x"]}, y={i["y"]}, width={i["width"]}, height={i["height"]})
'''

def textarea(i, c, p=False):
p = f''',\n placeholder="{i['placeholder']}",''' if p else ","
s = f''',\n placeholder="{i['placeholder']}",''' if p else ","
return f'''
textarea_image_{c} = tk.PhotoImage(file=load_asset("{i["image"]}"))
canvas.create_image({int(i['x'] + i['width'] / 2)}, {int(i['y'] + i['height'] / 2)}, image=textarea_image_{c})
textarea_{c} = {"TkForge_Text" if p else "tk.Text"}(
bd=0,
bg="{i["background"]}",
fg="{i["foreground"]}"{p}
fg="{i["foreground"]}"{s}
insertbackground="{i['foreground']}",
highlightthickness=0
)
Expand Down

0 comments on commit 99a144e

Please sign in to comment.