Skip to content
This repository has been archived by the owner on Jun 15, 2024. It is now read-only.
nh916 edited this page Jul 28, 2023 · 5 revisions

Excel Uploader Graphical User Interface (GUI)

The GUI will have a place for the user to enter their needed credentials to connect and upload to the CRIPT platform, show a loading screen and progress of what is being uploaded, and an error screen displaying the Excel errors for the user to fix.

Code

Excel uploader original code is located in src/python/ with minimal changes to all files except for what used to be called main.py, that is now refactored into a class called excel_uploader_main.py. All the python files including gui_main.py can use some refactoring to improve them for the future

The package being used to make the GUI is called eel. I am using html, css, bootstrap css, and plain JS to run it in Chrome app mode. The python file that controls the GUI is gui_main.py and all UI code is located in src/web/

Graphics

For the graphics I am downloading them from undraw.co, and placing them in src/web/assets/ The condensed CRIPT logo used for the executable icon is placed in src/assets/

I am using pyinstaller to compile the code into an executable.

How to compile to an executable

Windows

The way that I have used to compile in the past has been with the following steps

  1. Create and activate virtualenv
    1. python -m venv .\venv
    2. .\venv\Scripts\activate
  2. install dependencies from requirements.txt
    1. pip install -r requirements.txt
  3. compile code to executable
    1. cd .\src\
    2. python -m eel .\gui_main.py .\web\ --onefile --noconsole --name excel_uploader_gui_windows --icon=.\assets\logo_condensed.ico
      1. Note: If you are compiling multiple times and running into issues, please be sure to clean out anything that might have been cached that could cause issues. You can try clearing Chrome cache, deleting venv and reinstalling dependencies, remove any problematic files or folders from C:\Users\myusername\AppData\Local\Temp and using CCleaner

    3. This should create a build/ directory, dist/ directory and an excel_uploader_gui_windows.spec file
    4. The GUI executable is located in dist/excel_uploader_gui_windows.exe

Compile GUI Terminal Code

python -m eel .\gui_main.py .\web\ --onefile --noconsole --name excel_uploader_gui_windows --icon=.\assets\logo_condensed.ico

CI/CD

There is CD that will compile the GUI on 3 different OS (windows, Mac, Ubuntu) and spit out the fully compiled executable as an artifact that can be grabbed and put on the releases page and later linked to in the documentation.

Where to find CI/CD code

  • .github/workflows/pyinstaller_gui_mac.yaml
  • .github/workflows/pyinstaller_gui_ubuntu.yaml
  • .github/workflows/pyinstaller_gui_windows.yaml