Skip to content

Commit 3796d53

Browse files
authored
Add files via upload
1 parent a772796 commit 3796d53

11 files changed

Lines changed: 317 additions & 230 deletions

data_input_checks_tk.py

Lines changed: 27 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -45,24 +45,33 @@ def check_combo_input(combo_data):
4545
if user_input.strip() == '':
4646
combo_good = False
4747
combo_msg = 'Must be Entered'
48-
49-
elif 'int greater than' in combo_data[2]:
50-
51-
if user_input.strip() == '':
48+
49+
elif 'int ' or 'float' in combo_data[2]:
50+
51+
try:
52+
float(user_input)
53+
except:
5254
combo_good = False
53-
combo_msg = 'Must be Entered'
54-
55+
combo_msg = 'Must be numeric'
56+
5557
if combo_good:
56-
if 'equal' in combo_data[2]: #handle equal greater than or equal to
58+
if 'int greater than' in combo_data[2]:
5759

58-
if int(user_input) < int(combo_data[2].split()[-1]):
59-
combo_good = False
60-
combo_msg = f'Should be an Integer Greater than or Equal to {int(combo_data[2].split()[-1])}'
61-
else:
62-
if int(user_input) <= int(combo_data[2].split()[-1]):
60+
if user_input.strip() == '':
6361
combo_good = False
64-
combo_msg = f'Should be an Integer Greater than {int(combo_data[2].split()[-1])}'
65-
62+
combo_msg = 'Must be Entered'
63+
64+
if combo_good:
65+
if 'equal' in combo_data[2]: #handle equal greater than or equal to
66+
67+
if int(user_input) < int(combo_data[2].split()[-1]):
68+
combo_good = False
69+
combo_msg = f'Should be an Integer Greater than or Equal to {int(combo_data[2].split()[-1])}'
70+
else:
71+
if int(user_input) <= int(combo_data[2].split()[-1]):
72+
combo_good = False
73+
combo_msg = f'Should be an Integer Greater than {int(combo_data[2].split()[-1])}'
74+
6675
return combo_good, combo_msg
6776
def check_entry_input(entry_data):
6877

@@ -86,13 +95,17 @@ def check_entry_input(entry_data):
8695
entry_good = False
8796

8897
if 'int ' in entry_data[2]:
98+
8999
if user_input.strip() != '':
90100
try:
91101
user_input = int(user_input)
92102
except:
93103
entry_good = False
104+
entry_msg = 'Enter a'
94105
else:
95106
entry_good = False
107+
entry_msg = 'Must be Numeric'
108+
96109

97110
# If data good to this point, check if it is the right range
98111
if entry_good:

eel_comparison_frontend_tk.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,8 @@ def gen_final_layout(self):
355355
for part in self.w.bom:
356356
w.bom[part] = self.w.bom[part]
357357

358-
self.update_component(w, 'edit')
358+
if not canceled:
359+
self.update_component(w, 'edit')
359360

360361
def update_treeviews(self):
361362

eel_frontend_tk.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -365,13 +365,13 @@ def setup_widgets(self):
365365
row = 2
366366
gui_styles_tk.create_multiple_labels(self.details_frame, labels, row, 2, 20, 2, 2)
367367

368-
self.title_entry=Entry(self.details_frame, width=20)
368+
self.title_entry=Entry(self.details_frame, width=60)
369369
self.title_entry.grid(row=2,column=3,padx=2, pady=2,sticky = 'NSEW')
370370
self.data_checks['Title'] = ['title', self.title_entry, self.orig_title]
371371
if self.mode == 'edit':
372372
self.title_entry.insert(0, self.parent_page.backend.title)
373373

374-
self.description_entry=Entry(self.details_frame, width=20)
374+
self.description_entry=Entry(self.details_frame, width=60)
375375
self.description_entry.grid(row=3,column=3,padx=2, pady=2,sticky = 'NSEW')
376376

377377
if self.mode == 'edit':

emergency_equip_frontend_tk.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -448,12 +448,16 @@ def cleanup(self,button):
448448

449449
if data_good:
450450

451-
self.attach_type = self.type_combo.get()
452-
self.attach_part_no = self.pn_entry.get()
453-
self.attach_qty = self.qty_entry.get()
454-
455-
self.attaching_hardware.append([len(self.attaching_hardware)+1, self.attach_type, self.attach_part_no, self.attach_qty])
456-
self.top.destroy()
451+
#check part number is entered
452+
if self.pn_entry.get() == '':
453+
tkinter.messagebox.showerror(master=self.top, title='Error', message='Part Number Must be Entered')
454+
else:
455+
self.attach_type = self.type_combo.get()
456+
self.attach_part_no = self.pn_entry.get()
457+
self.attach_qty = self.qty_entry.get()
458+
459+
self.attaching_hardware.append([len(self.attaching_hardware)+1, self.attach_type, self.attach_part_no, self.attach_qty])
460+
self.top.destroy()
457461

458462
else:
459463
tkinter.messagebox.showerror(master=self.top, title='Error', message=msg)

file_menu.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def save(event=None, mainapp=None):
2929

3030
def save_as(mainapp):
3131

32-
mainapp.save_file = r'C:\Users\domhn\Documents\Python\Pycabin_Tkinter\V0.18\test.json'
32+
mainapp.save_file = r'C:\Users\domhn\Documents\Python\Pycabin_Tkinter\V0.20\test.json'
3333
#mainapp.save_file = r'C:\Users\domhnall.morrisey.WOODGROUP\Downloads\PYCabin_Tk-master\PYCabin_Tk-master\test.json'
3434
write_save_file(mainapp)
3535

@@ -105,7 +105,7 @@ def write_save_file(mainapp):
105105

106106
def load(event=None, mainapp=None):
107107

108-
with open(r'C:\Users\domhn\Documents\Python\Pycabin_Tkinter\V0.18\test.json') as f:
108+
with open(r'C:\Users\domhn\Documents\Python\Pycabin_Tkinter\V0.20\test.json') as f:
109109
#with open(r'C:\Users\domhnall.morrisey.WOODGROUP\Downloads\PYCabin_Tk-master\PYCabin_Tk-master\test.json') as f:
110110
data = json.load(f)
111111

0 commit comments

Comments
 (0)