diff --git a/BasicUtilities.py b/BasicUtilities.py index f059545..d7ca8ad 100644 --- a/BasicUtilities.py +++ b/BasicUtilities.py @@ -1,7 +1,7 @@ -print('Basic Utilities Release 2.19.1 (c) 2021 Enderbyte Programs. All rights reserved.') +print('Basic Utilities Release 2.19.3 (c) 2021 Enderbyte Programs. All rights reserved.') print('Starting Up') -SYSVERSION = '2.19.1' - +SYSVERSION = '2.19.3' +from plyer import notification from tkinter import * iopqwe = 0 from tkinter import messagebox @@ -195,8 +195,8 @@ def save(): except: Tk().withdraw() messagebox.showerror('notpad','Error. Did you make sure to \n\ - Make sure to save as first?\n\ - Make sure I have write perms in the output directory') + Make sure to save as first?\n\ + Make sure I have write perms in the output directory') else: file.write(txt.get('1.0','end-1c')) file.close() @@ -296,16 +296,28 @@ def terminat(): global txt global prevsavedata global pid + global istr data = txt.get('1.0','end-1c') if data == prevsavedata: istr = False forcekillnl() else: Tk().withdraw() - x = messagebox.askyesno('Text Editor','You have unsaved work. Are you sure you want to exit now?') + x = messagebox.askyesnocancel('Text Editor','You have unsaved work. Do you want to save before closing?') if x == True: - istr = False - forcekillnl() + if prevsavedata == '': + saveas() + if prevsavedata == '': + donothing = 0 + else: + forcekillnl() + else: + save() + forcekillnl() + elif x == False: + + forcekill() + def scanautosave(): try: @@ -656,8 +668,11 @@ def terminat(): forcekillnl() else: Tk().withdraw() - x = messagebox.askyesno('Text Editor','You have unsaved work. Are you sure you want to exit now?') + x = messagebox.askyesnocancel('Text Editor','You have unsaved work. Do you want to save before closing?') if x == True: + save() + forcekillnl() + elif x == False: forcekillnl() def scanautosave(): @@ -1258,9 +1273,14 @@ def runfile(filename): print(sysslash) if reqins == True: SYSVERNUM = version.parse(SYSVERDATA[0:6]) - SYSVERSION = version.parse(SYSVERSION) + SYSVERSION = version.parse("2.19.3") if SYSVERNUM > SYSVERSION: - print('A new update is available. Run the "update" command for more details') + notification.notify( + title='BU Update', + message='A new update ('+SYSVERDATA[0:6]+') is available. Run the command "update" to download.', + app_icon='bu.ico', + timeout=10 +) log('Found new update') nua = True while xae == True: @@ -2008,15 +2028,15 @@ def ckill(): messagebox.showerror('Error','Basic utilities is not able to access this folder.') elif command == 'stat': - print('lines: 5151') - print('print statements: 842') - print('Variables: 1383') - print('comparisons 391') - print('Exception handling loops 226') + print('lines: 5259') + print('print statements: 846') + print('Variables: 1402') + print('comparisons 401') + print('Exception handling loops 229') print('While loops 48') print('For loop 48') print('Commands: 133') - print('Libraries Imported 17') + print('Libraries Imported 19') print('files utilized 93') print('Tkinter windows used 81') diff --git a/compile.bat b/compile.bat index ae4a10a..5b159bc 100644 --- a/compile.bat +++ b/compile.bat @@ -1 +1 @@ -.\pyinstaller --noconfirm --icon=bu.ico --version-file=versionfile.txt BasicUtilities.py +.\pyinstaller --noconfirm --icon=bu.ico --version-file=versionfile.txt --hidden-import plyer.platforms.win.notification BasicUtilities.py diff --git a/error.vbs b/error.vbs index 407cc58..33c6089 100644 --- a/error.vbs +++ b/error.vbs @@ -1 +1 @@ -x = MsgBox("Your computer has an error",0+16,"Legit Windows") \ No newline at end of file +t = MsgBox("Your computer has an error",0+16,"Legit Windows") \ No newline at end of file diff --git a/gameboard.jpg b/gameboard.jpg new file mode 100644 index 0000000..b223c09 Binary files /dev/null and b/gameboard.jpg differ