Skip to content

Commit a13516b

Browse files
committed
Release 2.7 GUI
1 parent 337eecd commit a13516b

File tree

3 files changed

+15
-10
lines changed

3 files changed

+15
-10
lines changed

.github/workflows/macos-build.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
2626
- name: Build macOS Executable
2727
run: |
28-
pyinstaller --onefile --windowed --add-data="index_database.tsv:." --add-data="header.tsv:." --add-data="EXAMPLE_PLATES.xlsx:." --add-data="ICON.ico:." --icon="ICON.ico" GenerateMiSeqManifest.py
28+
pyinstaller --onefile --windowed --codesign-identity "Developer ID Application: FabbriniMarco" --target-arch universal2 --add-data="index_database.tsv:." --add-data="header.tsv:." --add-data="EXAMPLE_PLATES.xlsx:." --add-data="ICON.ico:." --icon="ICON.ico" GenerateMiSeqManifest.py
2929
3030
- name: Upload Build Artifacts
3131
uses: actions/upload-artifact@v4

GenerateMiSeqManifest.exe

32 Bytes
Binary file not shown.

GenerateMiSeqManifest.py

+14-9
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import ttkbootstrap as ttk
55
from ttkbootstrap.constants import *
66
from tkinter import filedialog, messagebox
7+
import csv
78
import shutil
89

910
# Helper function to get the correct path to resources
@@ -60,26 +61,31 @@ def __init__(self, root):
6061

6162
def select_file(self):
6263
self.file_path = filedialog.askopenfilename(filetypes=[("Excel Files", "*.xlsx")])
63-
if self.file_path:
64-
messagebox.showinfo("File Selected", f"Selected File: {os.path.basename(self.file_path)}")
65-
64+
6665
def generate_manifest(self):
6766
project_name = self.project_name_entry.get()
6867
project_date = self.project_date_entry.get()
6968
n_plates = self.n_plates_entry.get()
70-
69+
7170
# Validate inputs
7271
if not project_name or not project_date or not n_plates or not self.file_path:
7372
messagebox.showerror("Error", "All fields and the Excel file must be provided!")
7473
return
75-
74+
7675
try:
7776
n_plates = int(n_plates)
7877
project_date = pd.to_datetime(project_date).strftime('%Y-%m-%d')
7978
except ValueError:
8079
messagebox.showerror("Error", "Invalid date or number of plates format.")
8180
return
82-
81+
82+
# Ask for output destination
83+
output_file = filedialog.asksaveasfilename(defaultextension=".csv", filetypes=[("CSV files", "*.csv")],
84+
initialfile=f"{project_name}_SampleSheet_{project_date}.csv")
85+
if not output_file:
86+
messagebox.showerror("Error", "Output destination must be specified!")
87+
return
88+
8389
# Process the header file
8490
try:
8591
header_lines = self.process_header_file(project_name, project_date)
@@ -90,9 +96,8 @@ def generate_manifest(self):
9096
# Run the manifest generation logic
9197
try:
9298
data_section = self.generate_manifest_logic(project_name, n_plates)
93-
file_name = f"{project_name}_SampleSheet_{project_date}.csv"
94-
self.write_manifest(header_lines, data_section, file_name)
95-
messagebox.showinfo("Success", f"Manifest generated successfully: {file_name}")
99+
self.write_manifest(header_lines, data_section, output_file)
100+
messagebox.showinfo("Success", f"Manifest generated successfully: {output_file}")
96101
except Exception as e:
97102
messagebox.showerror("Error", f"An error occurred: {str(e)}")
98103

0 commit comments

Comments
 (0)