Skip to content

Commit 8c12dca

Browse files
committed
Version 1.5.2
1 parent a4c2925 commit 8c12dca

File tree

7 files changed

+55
-9
lines changed

7 files changed

+55
-9
lines changed

Application/AppUI/App.py

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import ctypes # included library with Python install.
2+
import ErrorLogger as elog
23

34
def Mbox(title, text, style=0):
45
return ctypes.windll.user32.MessageBoxW(0, text, title, style)
@@ -247,10 +248,12 @@ def del1():
247248
a = 0
248249
if dsid.get() == '' or dsid.get() == 'Enter ID':
249250
Mbox('Invalid entry', 'Please enter ID. ')
251+
elog.createLog('deleting student acc','invalid ID entered')
250252
a += 1
251253
if (dsid.get() != '' and dsid.get() != 'Enter ID') and ((dsid.get(),) not in d20):
252254
Mbox('Invalid entry',
253255
'Please enter valid ID. ')
256+
elog.createLog('deleting student acc','invalid ID entered')
254257
a += 1
255258
else:
256259
if (a == 0) and ((dsid.get(),) in d20):
@@ -272,10 +275,12 @@ def del1():
272275
dbcon.commit()
273276
Mbox(
274277
'Message', 'Account deleted successfully.')
278+
elog.createLog('deleting student acc','Account Deleted successfully.')
275279
adminhome()
276280
except:
277281
Mbox(
278282
'Unexpected error', 'There was an error deleting that account\nPlease try again later.')
283+
elog.createLog('deleting student acc','Account Deletion unsuccessful.')
279284
adminhome()
280285

281286
bt(f2, text='delete', bd=0, bg='#000000', fg='#CF3327', font=('SF Pro Display', 12), activebackground='#000000', command=del1).place(
@@ -302,16 +307,19 @@ def del2():
302307
if daid.get() == '' or daid.get() == 'Enter ID':
303308
Mbox('Invalid entry', 'Please enter ID. ')
304309
a += 1
310+
elog.createLog('deleting admin acc','invalid ID entered')
305311
if (daid.get() != '' and daid.get() != 'Enter ID') and ((daid.get(),) not in d21):
306312
Mbox('Invalid entry',
307313
'Please enter valid ID. ')
308314
a += 1
315+
elog.createLog('deleting admin acc','invalid ID entered')
309316
else:
310317
if (a == 0) and ((daid.get(),) in d21):
311318
if (daid.get() == aid.get()):
312319
Mbox(
313320
'Message', 'Please login from another ID to delete this one.'
314321
)
322+
elog.createLog('deleting admin acc','attempt to delete the account which is logged in.')
315323
adminhome()
316324
else:
317325
try:
@@ -320,10 +328,12 @@ def del2():
320328
dbcon.commit()
321329
Mbox(
322330
'Message', 'Account deleted successfully.')
331+
elog.createLog('deleting admin acc','Account Deletion Successful.')
323332
adminhome()
324333
except:
325334
Mbox(
326335
'Unexpected error', 'There was an error deleting that account\nPlease try again later.')
336+
elog.createLog('deleting admin acc','Account Deletion Unsuccessful.')
327337
adminhome()
328338

329339
bt(f2, text='delete', bd=0, bg='#000000', fg='#CF3327', font=('SF Pro Display', 12), activebackground='#000000', command=del2).place(
@@ -478,44 +488,54 @@ def nstudent_save():
478488
if sg != 0:
479489
Mbox(
480490
'Invalid entry', 'Please enter data in all fields before saving.')
491+
elog.createLog('student profile edit','empty fields before saving.')
481492
if sg == 0:
482493
if s12.get().startswith('Saiit') == False or s != 0:
483494
Mbox(
484495
"Invalid entry", "Please enter valid ID.\nIt should start with 'Saiit',\nand should have a relevant unique number suffixed")
496+
elog.createLog('student profile edit','New ID disobeys ID-constraints.')
485497
e += 1
486498
if a != 0:
487499
Mbox(
488500
'Invalid entry', 'Names cannot contain numbers, please try again.')
501+
elog.createLog('student profile edit','numeric value entered in name.')
489502
e += 1
490503
if len(s2.get()) != 10 or len(s9.get()) != 10 or len(s11.get()) != 10 or b != 0:
491504
Mbox(
492505
'Invalid entry', 'Phone number is invalid, please try again.')
506+
elog.createLog('student profile edit','Invalid Phone number.')
493507
e += 1
494508
if s3.get() not in l: # year checked.
495509
Mbox(
496510
'Invalid entry', ' Please check year. ')
511+
elog.createLog('student profile edit','Invalid Year.')
497512
e += 1
498513
if s4.get().startswith('S') == False or ad != 0: # admission number checked
499514
Mbox(
500515
'Invalid entry', "Admission number is not valid,\nIt can only begin with a 'S'\nPlease try again.")
516+
elog.createLog('student profile edit','empty fields before saving.')
501517
e += 1
502518
if d != 0:
503519
Mbox(
504520
'Invalid entry', 'Course is not valid, please try again.')
521+
elog.createLog('student profile edit','Invalid Course details.')
505522
e += 1
506523
if s6.get() not in l2: # blood group checked.
507524
Mbox(
508525
'Invalid entry', 'Please check blood group and try again.')
526+
elog.createLog('student profile edit','Incorrect blood group details entered.')
509527
e += 1
510528
# gender checked.
511529
if s7.get() not in ['male', 'female', 'Male', 'Female', 'M', 'F', 'm', 'f']:
512530
Mbox(
513531
'Invalid entry', 'Please check gender and try again.')
532+
elog.createLog('student profile edit','gender information invalid.')
514533
e += 1
515534
else:
516535
if tuple(sget) in d11:
517536
Mbox('Repeated entry',
518537
'This record already exists. ')
538+
elog.createLog('student profile edit','Account with similar records found.')
519539
if tuple(sget) not in d11 and e == 0:
520540
try:
521541
dbcur.execute("insert into sprofile values('{}','{}','{}','{}','{}','{}','{}','{}','{}','{}','{}','{}')"
@@ -547,13 +567,15 @@ def nstudent_save():
547567
dbcon.commit()
548568
Mbox(
549569
'Message', 'Account added successfully.')
570+
elog.createLog('student profile saving','Account added successfully.')
550571
Mbox('Message', 'Since this will be a new account, therefore all other data branches such as password,assignments,attendance,etc are also not set-up.\n'
551572
'For now, all information regarding academics including credentials has been set to NULL.\n'
552573
'You can change this in the future. ')
553574
adminhome()
554575
except:
555576
Mbox(
556577
'Unexpected error', 'Please check all fields or try again later.')
578+
elog.createLog('student profile saving','Account addition Unsuccessful.')
557579

558580
b41 = bt(f12, image=p51, bd=0, font=('SF Pro Display', 15), bg='#000000',
559581
fg='#249ADF', activebackground='#000000', command=nstudent_save)
@@ -631,6 +653,7 @@ def nadmin_save():
631653
c += 1
632654
if c != 0:
633655
Mbox('Entry error', 'Please fill all fields.')
656+
elog.createLog('admin profile creation','empty fields before saving.')
634657
if c == 0:
635658
if (tid.get().startswith('Taiit') == False):
636659
a += 1
@@ -645,25 +668,30 @@ def nadmin_save():
645668
if a != 0:
646669
Mbox(
647670
'Entry error', 'Please check all fields and try again.')
671+
elog.createLog('admin profile creation','Invalid information in fields.')
648672
if a == 0:
649673
if napass.get() != cnapass.get():
650674
Mbox(
651675
'Key error', 'Entered paswords do not match.\nPlease try again.')
676+
elog.createLog('admin profile creation','Passwords not matching.')
652677
if napass.get() == cnapass.get():
653678
if tuple(a1get) in d12:
654679
Mbox('Repeated entry',
655680
'This record already exists.')
681+
elog.createLog('admin profile creation','Account with similar records has been found.')
656682
if tuple(a1get) not in d12:
657683
try:
658684
dbcur.execute('insert into adminlogin values("{}","{}","{}")'.format(
659685
tid.get(), cnapass.get(), phno.get()))
660686
dbcon.commit()
661687
Mbox(
662688
'Message', 'Account added successfully.')
689+
elog.createLog('admin profile creation','Account added successfully.')
663690
adminhome()
664691
except:
665692
Mbox(
666693
'Unexpected error', 'Please check all fields or try again later.')
694+
elog.createLog('admin profile creation','Account addition Unsuccessful.')
667695

668696
b43 = bt(f13, image=p51, bd=0, font=('SF Pro Display', 15), bg='#000000',
669697
fg='#249ADF', activebackground='#000000', command=nadmin_save)
@@ -707,6 +735,7 @@ def go():
707735
d2 = dbcur.fetchall()
708736
if fid.get() == '':
709737
Mbox('Empty entry', ' Please enter ID. ')
738+
elog.createLog('password reset','empty fields before proceeding.')
710739
if (fid.get(),) not in d2 and fid.get() != '':
711740
Mbox(
712741
'Invalid entry', ' Incorrect ID. \nPlease try again')
@@ -3801,8 +3830,10 @@ def reverse2(a):
38013830
except:
38023831
Mbox(
38033832
'Database Error', 'There was some problem with the associated database, Please try again later')
3833+
elog.createLog('Database error CRITICAL','Database response with login details NEGATIVE.')
38043834
else:
38053835
main()
38063836
except:
38073837
Mbox('Unexpected error', "There was an unexpected error, we're trying to solve it. Please close the app and start it again.")
3838+
elog.createLog('Main UI startup issue CRITICAL','Main UI start NEGATIVE and program unexpectedly stopped.')
38083839

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,10 @@ def openLogFile():
1313
def closeLogFile():
1414
LogFile.close()
1515

16-
def createLog(type='Not Specified',Log='Unexpected System Brick and Stop.'):
16+
def createLog(type='App Executed',Log='Proceeding to Start Screen.'):
1717

1818
openLogFile()
1919

2020
LogFile.write("{}, {} , {} , {}\n".format(CurDate,CurTime,type,Log))
2121

2222
closeLogFile()
23-
24-
createLog()

Application/AppUI/Start.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import ctypes # included library with Python install.
2+
import ErrorLogger as elog
23

34
def Mbox(title, text, style=0):
45
return ctypes.windll.user32.MessageBoxW(0, text, title, style)
@@ -56,10 +57,11 @@ def close():
5657
win1.after(2700, wipe)
5758
win1.after(3100, dot1)
5859
win1.after(3500, dot2)
60+
elog.createLog('Successful startup','The app started successfully and has proceeded to run the Main UI.')
5961

6062
win1.after(3900, close)
6163

6264
win1.mainloop()
6365
except:
6466
Mbox("Runtime Error",'There was an issue during the startup of the App. Please Try Again later while we fix this.')
65-
67+
elog.createLog('Start Screen Error','The Start Screen Didnt appear and error message prompted after which program unexpectedly stopped.')
814 Bytes
Binary file not shown.
2.68 KB
Binary file not shown.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ so i used images wherever possible.
99
This contains almost all dynamic features making it shine above most projects:
1010

1111
* Supports Two-Factor-authentication
12-
* Has built in software update system, so we need not install the newer one everytime, we can just update the existing software
12+
* Has built in software update Service, so we need not install the newer one everytime, we can just update the existing software
1313
* Best in class Graphics design
1414
* Built-in dark mode
1515
* Dynamic dark mode to be added soon
Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,20 @@
1-
||-------DATE-------||-------Time-------||-------LogType-------||------------------------Log------------------------||
1+
||--DATE--||--Time--||------LogType------||------------------------Log----------------------------------------------------------------------------------------------------------------------------------------------------||
22
**********************************************************************************************************************
3-
4-
'{}','{}',LogType----------,Log------------
5-
2021-11-15, 14:31:35 , Not Specified , Unexpected System Brick and Stop.
3+
4+
2021-11-15, 15:22:19 , Successful startup , The app started successfully and has proceeded to run the main UI.
5+
2021-11-15, 15:22:38 , Start Screen Error , The Start Screen Didnt appear and error message prompted after which program unexpectedly stopped.
6+
2021-11-15, 15:22:54 , Start Screen Error , The Start Screen Didnt appear and error message prompted after which program unexpectedly stopped.
7+
2021-11-15, 15:23:07 , Successful startup , The app started successfully and has proceeded to run the main UI.
8+
2021-11-15, 15:23:32 , Successful startup , The app started successfully and has proceeded to run the Main UI.
9+
2021-11-15, 15:23:45 , Successful startup , The app started successfully and has proceeded to run the Main UI.
10+
2021-11-15, 15:24:02 , Start Screen Error , The Start Screen Didnt appear and error message prompted after which program unexpectedly stopped.
11+
2021-11-15, 15:24:11 , Start Screen Error , The Start Screen Didnt appear and error message prompted after which program unexpectedly stopped.
12+
2021-11-15, 15:27:17 , Successful startup , The app started successfully and has proceeded to run the Main UI.
13+
2021-11-15, 15:47:50 , Successful startup , The app started successfully and has proceeded to run the Main UI.
14+
2021-11-15, 15:47:50 , Main UI startup issue CRITICAL , Main UI start NEGATIVE and program unexpectedly stopped.
15+
2021-11-15, 15:48:44 , Successful startup , The app started successfully and has proceeded to run the Main UI.
16+
2021-11-15, 15:48:44 , Main UI startup issue CRITICAL , Main UI start NEGATIVE and program unexpectedly stopped.
17+
2021-11-15, 15:49:01 , Successful startup , The app started successfully and has proceeded to run the Main UI.
18+
2021-11-15, 15:49:12 , Successful startup , The app started successfully and has proceeded to run the Main UI.
19+
2021-11-15, 15:49:23 , Start Screen Error , The Start Screen Didnt appear and error message prompted after which program unexpectedly stopped.
20+
2021-11-15, 15:49:30 , Successful startup , The app started successfully and has proceeded to run the Main UI.

0 commit comments

Comments
 (0)