-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added text2qti_tk graphical application, plus Windows build scripts u…
…nder make_gui_exe/ (#27)
- Loading branch information
Showing
11 changed files
with
611 additions
and
168 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Create Standalone GUI Executable for Windows | ||
|
||
This directory contains scripts for creating a standalone GUI executable under | ||
Windows with PyInstaller. | ||
|
||
|
||
|
||
## Requirements | ||
|
||
* Windows | ||
* [conda](https://docs.conda.io/projects/conda/en/latest/user-guide/install/) | ||
|
||
|
||
|
||
## Directions | ||
|
||
If you do not already have a local copy of the text2qti source, download | ||
`make_tk_exe.bat` and `text2qti_tk.pyw`, and place them in the same directory. | ||
Double-click on `make_tk_exe.bat` to run it. Or open a command prompt, | ||
navigate to `make_gui_exe/` (or wherever the batch file is located), and run | ||
the batch file. Under PowerShell, run something like | ||
`cmd /c make_gui_exe.bat`. | ||
|
||
The batch file performs these steps: | ||
* Create a new conda environment for building the executable. | ||
* Activate the conda environment. | ||
* Install needed Python packages in the environment: bespon, markdown, | ||
pyinstaller, and text2qti. If the batch file detects that it is part of a | ||
local copy of the text2qti source, then this local version of text2qti will | ||
be used. Otherwise, text2qti will be installed from PyPI via pip. | ||
* Build executable `text2qti_tk_VERSION.exe` using PyInstaller. | ||
* Deactivate the conda environment. | ||
* Remove the conda environment. | ||
* Move the executable to the working directory. | ||
* Remove all temp files and build files. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
REM This is intended to be run with the .bat file directory as the working dir | ||
if not exist make_tk_exe.bat ( | ||
echo Missing make_tk_exe.bat in working directory | ||
pause | ||
exit | ||
) | ||
if not exist text2qti_tk.pyw ( | ||
echo Missing text2qti_tk.pyw in working directory | ||
pause | ||
exit | ||
) | ||
|
||
REM Create and activate a conda env for packaging the .exe | ||
call conda create -y --name make_text2qti_gui_exe python=3.8 --no-default-packages | ||
call conda activate make_text2qti_gui_exe | ||
REM List conda envs -- useful for debugging | ||
call conda info --envs | ||
REM Install dependencies | ||
pip install bespon | ||
pip install markdown | ||
pip install pyinstaller | ||
if exist ..\setup.py ( | ||
if exist ..\text2qti ( | ||
cd .. | ||
pip install . | ||
cd make_gui_exe | ||
) else ( | ||
pip install text2qti | ||
) | ||
) else ( | ||
pip install text2qti | ||
) | ||
REM Build .exe | ||
FOR /F "tokens=* USEBACKQ" %%g IN (`python -c "import text2qti; print(text2qti.__version__)"`) do (SET "TEXT2QTI_VERSION=%%g") | ||
pyinstaller -F --name text2qti_tk_%TEXT2QTI_VERSION% text2qti_tk.pyw | ||
REM Deactivate and delete conda env | ||
call conda deactivate | ||
call conda remove -y --name make_text2qti_gui_exe --all | ||
REM List conda envs -- useful for debugging | ||
call conda info --envs | ||
REM Cleanup | ||
move dist\text2qti_tk_%TEXT2QTI_VERSION%.exe text2qti_tk_%TEXT2QTI_VERSION%.exe | ||
rd /s /q "__pycache__" | ||
rd /s /q "build" | ||
rd /s /q "dist" | ||
del *.spec | ||
pause |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
import text2qti.gui.tk | ||
text2qti.gui.tk.main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Oops, something went wrong.