Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
Axorax committed Oct 23, 2024
1 parent 0176ac4 commit 7fde5e9
Show file tree
Hide file tree
Showing 6 changed files with 82 additions and 12 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
2 changes: 2 additions & 0 deletions README_zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ ParthJadhav 已经用 Tkinter Designer 完成了类似的工作,但我喜欢

首先,您需要从发布页面下载可执行文件。然后,您需要创建一个 Figma 标记并复制项目的网址。然后,打开应用程序,将令牌和项目的网址粘贴到应用程序中,点击按钮即可启动魔法!🪄

确保您的 Figma 项目使用框架。TkForge 会将框架内的内容转化为可运行的图形用户界面,并忽略任何不在框架内的内容。

在 Figma 项目中,确保为所有元素添加正确的名称。

## 🧿 可用名称
Expand Down
4 changes: 2 additions & 2 deletions build.bat
Original file line number Diff line number Diff line change
@@ -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
)
4 changes: 2 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
@@ -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
12 changes: 5 additions & 7 deletions core.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
68 changes: 68 additions & 0 deletions tkforge.iss
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 7fde5e9

Please sign in to comment.