-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
240 additions
and
58 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,4 +1,23 @@ | ||
|
||
$APP_SCRIPT='pytouch3.py' | ||
$ICON='pytouch3.ico' | ||
$IMG_DATA="pytouch3.png;." | ||
|
||
python3 -m pyinstaller --add-data 'pytouch3.png:.' $APP_SCRIPT | ||
$VER=$(git describe) | ||
$ZIPFILE="pytouch3-win64-$VER.zip" | ||
|
||
Write-Host -Fore Cyan "Building archive for PyTouch Cube $VER`n" | ||
Write-Host -Fore Cyan ":: Running PyInstaller..." | ||
pyinstaller --noconfirm --add-data=$IMG_DATA --windowed --icon=$ICON $APP_SCRIPT | ||
|
||
if (Test-Path dist/$ZIPFILE) | ||
{ | ||
Write-Host -Fore Cyan ":: Removing previous archive..." | ||
Remove-Item dist/$ZIPFILE | ||
} | ||
Push-Location dist/pytouch3 | ||
Write-Host -Fore Cyan ":: Compressing archive..." | ||
7z a -bb0 "-x!opengl32sw.dll" "-x!qt5qml*.dll" "-xr!qwebgl.dll" "-xr!qminimal.dll" "-xr!qoffscreen.dll" ..\$ZIPFILE * | ||
Pop-Location | ||
|
||
Write-Host -Fore Cyan ":: Done!" |
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,39 @@ | ||
from pprint import pprint | ||
|
||
from PyQt5.QtCore import QDir, Qt | ||
from PyQt5.QtWidgets import QComboBox | ||
from qasync import asyncSlot | ||
|
||
from labels import tapes | ||
from labelmaker.comms import list_printer_devices | ||
from util import * | ||
from .types import * | ||
|
||
|
||
class TapeModel(QStandardItemModel): | ||
def __init__(self, parent: QWidget): | ||
super().__init__(parent) | ||
self.colors: List[Tuple[Color, Color]] = [] | ||
|
||
def add_tape(self, label, fg, bg): | ||
self.colors.append((fg, bg)) | ||
self.appendRow(QStandardItem(label)) | ||
|
||
|
||
class TapeSelect(QComboBox): | ||
def __init__(self, parent: QWidget): | ||
super().__init__(parent) | ||
if hasattr(self, 'setPlaceholderText'): | ||
self.setPlaceholderText('Select tape type') | ||
self.model = TapeModel(self) | ||
for label, fg, bg in tapes: | ||
self.model.add_tape(label, fg, bg) | ||
self.setModel(self.model) | ||
|
||
index = self.findText('TZe-231,', Qt.MatchStartsWith) | ||
if index > 0: | ||
self.setCurrentIndex(index) | ||
|
||
def get_colors(self, index: int): | ||
return self.model.colors[index] | ||
|
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
Oops, something went wrong.