Skip to content

Commit

Permalink
Added setup.py for making builds
Browse files Browse the repository at this point in the history
  • Loading branch information
rsoric committed Aug 20, 2024
1 parent 44f1cb2 commit cf00fa3
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 2 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,7 @@
.idea/
__pycache__/
build.ps1
build
dist
main.spec
preview.png
4 changes: 2 additions & 2 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
import sys
import time

import pyperclip
# Import gui libraries and elements
from PySide6 import QtWidgets, QtGui
from PySide6.QtGui import QDragEnterEvent, QDropEvent
from PySide6.QtUiTools import QUiLoader
from PySide6.QtCore import QFile, Qt
from PySide6.QtWidgets import QLabel, QApplication, QFileDialog, QMessageBox
from droplabel import DropLabel
import clipboard

# Import custom .css for styling the GUI
from style import *
Expand Down Expand Up @@ -432,7 +432,7 @@ def change_dither_kernel(self):
self.load_image(self.selected_image)

def copy_code_to_clipboard(self):
pyperclip.copy(self.images[self.selected_image].resultString)
clipboard.copy(self.images[self.selected_image].resultString)
self.converting_label.setText("Copied!")
QApplication.processEvents()

Expand Down
Binary file modified preview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
43 changes: 43 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Build script using cx_freeze
# This script is automatically ran with the build.ps1 script

from cx_Freeze import setup, Executable
import os

# Retrieve the version number from your version.py or another source
version = "v1.0.0"

# Executable name with the version number
executable_name = f"Soldered Image Converter {version}.exe"

# Build options, including icon and other files
build_exe_options = {
"packages": ["os", "PySide6"],
"include_files": [
("img/icon.ico", "icon.ico"), # Ensures the icon is included
("img", "img"), # Include the img directory
("test_images", "test_images"),
"imageConverter.ui",
"LICENSE",
],
"include_msvcr": True,
}

# Define the executable, including the icon
executables = [
Executable(
"main.py",
base="Win32GUI", # Use Win32GUI for a Windows application without a console
target_name=executable_name,
icon="img/icon.ico", # Set the executable icon
)
]

# Setup call to package the application
setup(
name="Soldered Image Converter",
version=version,
description="Soldered Image Converter is a desktop application which converts .png, .jpg, or .bmp format pictures (up to 10 at a time) to C++ compatible Arduino/Dasduino code, which you can use for your Soldered Displays.",
options={"build_exe": build_exe_options},
executables=executables,
)

0 comments on commit cf00fa3

Please sign in to comment.