From 7fde5e9a371c7016a8ed9dfcb839321200aa57ec Mon Sep 17 00:00:00 2001 From: Axorax Date: Wed, 23 Oct 2024 20:59:41 +0600 Subject: [PATCH] update --- README.md | 4 +++- README_zh.md | 2 ++ build.bat | 4 ++-- build.sh | 4 ++-- core.py | 12 ++++------ tkforge.iss | 68 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 82 insertions(+), 12 deletions(-) create mode 100644 tkforge.iss diff --git a/README.md b/README.md index 929e13b..c69c661 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,9 @@ Something like this has already been done by ParthJadhav with Tkinter Designer b ## ✨ Usage Guide -First, you need to download the executable from the releases page. Then, you need to create a Figma token and copy the url of your project. Then, open the app and paste the token and url of your project into the app and click the button to start the magic! 🪄 +First, you need to download the executable from the releases page. Next, you need to create a Figma token and copy the url of your project. Then, open the app and paste the token and url of your project into the app and click the button to start the magic! 🪄 + +Make sure your Figma project uses frames. TkForge turns the content inside frames into working GUI's and ignores anything that is not in a frame. In the Figma project, make sure to add proper names for all of your elements. diff --git a/README_zh.md b/README_zh.md index a9d175f..b2e8fcd 100644 --- a/README_zh.md +++ b/README_zh.md @@ -44,6 +44,8 @@ ParthJadhav 已经用 Tkinter Designer 完成了类似的工作,但我喜欢 首先,您需要从发布页面下载可执行文件。然后,您需要创建一个 Figma 标记并复制项目的网址。然后,打开应用程序,将令牌和项目的网址粘贴到应用程序中,点击按钮即可启动魔法!🪄 +确保您的 Figma 项目使用框架。TkForge 会将框架内的内容转化为可运行的图形用户界面,并忽略任何不在框架内的内容。 + 在 Figma 项目中,确保为所有元素添加正确的名称。 ## 🧿 可用名称 diff --git a/build.bat b/build.bat index 966ff1c..9c85b92 100644 --- a/build.bat +++ b/build.bat @@ -1,7 +1,7 @@ @echo off if "%1" == "cli" ( - pyinstaller --name="tkforge-cli" --onefile --paths=env/Lib/site-packages tkforge.py --icon=assets/icon.png + pyinstaller --name="tkforge-cli" --onefile --strip --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 + pyinstaller --name="TkForge" --onefile --strip --paths=env/Lib/site-packages --add-data="assets;assets" gui.py --noconsole --icon=assets/icon.png ) diff --git a/build.sh b/build.sh index 15d6957..b5d015f 100644 --- a/build.sh +++ b/build.sh @@ -1,7 +1,7 @@ #!/bin/bash if [ "$1" == "cli" ]; then - pyinstaller --name="tkforge-cli" --onefile --paths=env/Lib/site-packages tkforge.py --icon=assets/icon.png + pyinstaller --name="tkforge-cli" --onefile --strip --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 + pyinstaller --name="TkForge" --onefile --strip --paths=env/Lib/site-packages --add-data="assets:assets" gui.py --noconsole --icon=assets/icon.png fi diff --git a/core.py b/core.py index 52bd0b1..a852a8d 100644 --- a/core.py +++ b/core.py @@ -176,13 +176,11 @@ def download(name): threads = [] for frame in frames: - # if frame["type"] != "FRAME": - # return - - thread = threading.Thread(target=parse_frame, args=(frame, frame_count,)) - threads.append(thread) - thread.start() - frame_count = frame_count + 1; + if frame["type"] == "FRAME": + thread = threading.Thread(target=parse_frame, args=(frame, frame_count,)) + threads.append(thread) + thread.start() + frame_count = frame_count + 1; for thread in threads: thread.join() diff --git a/tkforge.iss b/tkforge.iss new file mode 100644 index 0000000..13f38f2 --- /dev/null +++ b/tkforge.iss @@ -0,0 +1,68 @@ +#define Name "TkForge" +#define Version "2.1.0" +#define Author "Axorax" +#define URL "https://github.com/axorax/tkforge" +#define ExeName "TkForge.exe" + +[Setup] +AppId={{2817A8C8-9721-4DF0-A238-6F1A0B6E24B8} +Name={#Name} +AppVersion={#Version} +;AppVerName={#Name} {#Version} +AppPublisher={#Author} +AppPublisherURL={#URL} +AppSupportURL={#URL} +AppUpdatesURL={#URL} +DefaultDirName={autopf}\{#Name} +ArchitecturesAllowed=x64compatible +ArchitecturesInstallIn64BitMode=x64compatible +DisableProgramGroupPage=yes +PrivilegesRequired=lowest +OutputBaseFilename=TkForge-setup +SetupIconFile=assets\icon.ico +Compression=lzma +SolidCompression=yes +WizardStyle=modern + +[Languages] +Name: "english"; MessagesFile: "compiler:Default.isl" +Name: "armenian"; MessagesFile: "compiler:Languages\Armenian.isl" +Name: "brazilianportuguese"; MessagesFile: "compiler:Languages\BrazilianPortuguese.isl" +Name: "bulgarian"; MessagesFile: "compiler:Languages\Bulgarian.isl" +Name: "catalan"; MessagesFile: "compiler:Languages\Catalan.isl" +Name: "corsican"; MessagesFile: "compiler:Languages\Corsican.isl" +Name: "czech"; MessagesFile: "compiler:Languages\Czech.isl" +Name: "danish"; MessagesFile: "compiler:Languages\Danish.isl" +Name: "dutch"; MessagesFile: "compiler:Languages\Dutch.isl" +Name: "finnish"; MessagesFile: "compiler:Languages\Finnish.isl" +Name: "french"; MessagesFile: "compiler:Languages\French.isl" +Name: "german"; MessagesFile: "compiler:Languages\German.isl" +Name: "hebrew"; MessagesFile: "compiler:Languages\Hebrew.isl" +Name: "hungarian"; MessagesFile: "compiler:Languages\Hungarian.isl" +Name: "icelandic"; MessagesFile: "compiler:Languages\Icelandic.isl" +Name: "italian"; MessagesFile: "compiler:Languages\Italian.isl" +Name: "japanese"; MessagesFile: "compiler:Languages\Japanese.isl" +Name: "korean"; MessagesFile: "compiler:Languages\Korean.isl" +Name: "norwegian"; MessagesFile: "compiler:Languages\Norwegian.isl" +Name: "polish"; MessagesFile: "compiler:Languages\Polish.isl" +Name: "portuguese"; MessagesFile: "compiler:Languages\Portuguese.isl" +Name: "russian"; MessagesFile: "compiler:Languages\Russian.isl" +Name: "slovak"; MessagesFile: "compiler:Languages\Slovak.isl" +Name: "slovenian"; MessagesFile: "compiler:Languages\Slovenian.isl" +Name: "spanish"; MessagesFile: "compiler:Languages\Spanish.isl" +Name: "turkish"; MessagesFile: "compiler:Languages\Turkish.isl" +Name: "ukrainian"; MessagesFile: "compiler:Languages\Ukrainian.isl" + +[Tasks] +Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked + +[Files] +Source: "dist\{#ExeName}"; DestDir: "{app}"; Flags: ignoreversion + +[Icons] +Name: "{autoprograms}\{#Name}"; Filename: "{app}\{#ExeName}" +Name: "{autodesktop}\{#Name}"; Filename: "{app}\{#ExeName}"; Tasks: desktopicon + +[Run] +Filename: "{app}\{#ExeName}"; Description: "{cm:LaunchProgram,{#StringChange(Name, '&', '&&')}}"; Flags: nowait postinstall skipifsilent +