1818import tksheet
1919
2020is_windows : bool = platform .system () == "Windows"
21- is_windows_10 : bool = is_windows and platform .release () == "10"
22- if is_windows_10 :
21+ is_windows_10_or_11 : bool = is_windows and platform .release () == "10"
22+ if is_windows_10_or_11 :
2323 # noinspection PyUnresolvedReferences
2424 import win10toast
2525
@@ -73,7 +73,7 @@ def __init__(self, window: Tk) -> None:
7373 f'Call Boundary ({ self .units_str } )' , f'Put Boundary ({ self .units_str } )' , 'Call ITM' , 'Put ITM' )
7474 self .session : requests .Session = requests .Session ()
7575 self .cookies : Dict [str , str ] = {}
76- self .toaster : win10toast .ToastNotifier = win10toast .ToastNotifier () if is_windows_10 else None
76+ self .toaster : win10toast .ToastNotifier = win10toast .ToastNotifier () if is_windows_10_or_11 else None
7777 self .get_icon ()
7878 self .login_win (window )
7979
@@ -147,7 +147,7 @@ def get_icon(self) -> None:
147147 print (err , sys .exc_info ()[0 ], "17" )
148148 self .load_nse_icon = False
149149 return
150- if is_windows_10 :
150+ if is_windows_10_or_11 :
151151 try :
152152 icon_ico_raw : requests .Response = requests .get (self .url_icon_ico ,
153153 headers = self .headers , stream = True )
@@ -248,12 +248,12 @@ def get_config(self) -> None:
248248 self .save_oc : bool = self .config_parser .getboolean ('main' , 'save_oc' )
249249 try :
250250 self .notifications : bool = self .config_parser .getboolean ('main' , 'notifications' ) \
251- if is_windows_10 else False
251+ if is_windows_10_or_11 else False
252252 except (configparser .NoOptionError , ValueError ) as err :
253253 print (err , sys .exc_info ()[0 ], "0" )
254254 self .create_config (attribute = "notifications" )
255255 self .notifications : bool = self .config_parser .getboolean ('main' , 'notifications' ) \
256- if is_windows_10 else False
256+ if is_windows_10_or_11 else False
257257 try :
258258 self .auto_stop : bool = self .config_parser .getboolean ('main' , 'auto_stop' )
259259 except (configparser .NoOptionError , ValueError ) as err :
@@ -922,7 +922,7 @@ def main_win(self) -> None:
922922 accelerator = "(Ctrl+O)" , command = self .toggle_save_oc )
923923 self .options .add_command (label = f"Notifications: { 'On' if self .notifications else 'Off' } " ,
924924 accelerator = "(Ctrl+N)" , command = self .toggle_notifications ,
925- state = NORMAL if is_windows_10 else DISABLED )
925+ state = NORMAL if is_windows_10_or_11 else DISABLED )
926926 self .options .add_command (label = f"Stop automatically at 3:30pm: { 'On' if self .auto_stop else 'Off' } " ,
927927 accelerator = "(Ctrl+K)" , command = self .toggle_auto_stop )
928928 self .options .add_command (label = f"Warn Late Server Updates: { 'On' if self .warn_late_update else 'Off' } " ,
@@ -941,7 +941,7 @@ def main_win(self) -> None:
941941 self .root .bind ('<Control-s>' , self .export )
942942 self .root .bind ('<Control-b>' , self .toggle_live_export )
943943 self .root .bind ('<Control-o>' , self .toggle_save_oc )
944- self .root .bind ('<Control-n>' , self .toggle_notifications ) if is_windows_10 else None
944+ self .root .bind ('<Control-n>' , self .toggle_notifications ) if is_windows_10_or_11 else None
945945 self .root .bind ('<Control-k>' , self .toggle_auto_stop )
946946 self .root .bind ('<Control-w>' , self .toggle_warn_late_update )
947947 self .root .bind ('<Control-u>' , self .toggle_updates )
0 commit comments