3636from pydetex ._gui_settings import Settings as _Settings
3737
3838
39+ # noinspection PyTypeChecker
3940class SettingsWindow (object ):
4041 """
4142 Settings window.
@@ -416,7 +417,7 @@ def _save(self) -> None:
416417 self .close ()
417418
418419
419- # noinspection PyProtectedMember
420+ # noinspection PyProtectedMember,PyTypeChecker
420421class DictionaryGUI (object ):
421422 """
422423 Dictionary gui.
@@ -562,9 +563,7 @@ def _process_out_key(event: 'tk.Event') -> Optional['tk.Event']:
562563 :param event: Event
563564 :return: Event
564565 """
565- # noinspection PyUnresolvedReferences
566- if event .char == '' :
567- return event
566+ return event if event .char == '' else None
568567
569568 def _get_word (self ) -> str :
570569 """
@@ -633,7 +632,7 @@ def _process(word: str):
633632 self ._query_thread (key , _process , self ._meaning , self ._get_word ())
634633 data = self ._query_output_pop (key )
635634 if data is None :
636- return
635+ return None
637636 style , mean , wiki = data
638637 if mean == '' :
639638 return self ._write (self ._cfg .lang ('dictionary_no_results' ))
@@ -648,6 +647,7 @@ def _process(word: str):
648647 self ._text_out .insert ('end' , f'{ self ._cfg .lang ("dictionary_wikipedia" )} :\n ' , 'italic' )
649648 self ._text_out .insert ('end' , f'{ wiki } ' , 'normal' )
650649 self ._text_out ['state' ] = tk .DISABLED
650+ return None
651651
652652 def _synonym (self ) -> None :
653653 """
@@ -666,16 +666,16 @@ def _process(word: str):
666666 self ._query_thread (key , _process , self ._synonym , self ._get_word ())
667667 syn = self ._query_output_pop (key )
668668 if syn is None :
669- return
670- if len (syn ) == 0 :
669+ return None
670+ elif len (syn ) == 0 :
671671 return self ._write (self ._cfg .lang ('dictionary_no_results' ))
672- self ._write (', ' .join (syn ))
672+ return self ._write (', ' .join (syn ))
673673
674674 def _antonym (self ) -> None :
675675 """
676676 Word aynonym.
677677 """
678- key = 'antonym'
678+ key : str = 'antonym'
679679
680680 def _process (word : str ):
681681 self ._query_output [key ] = self ._dictionary .antonym (self ._lang , word )
@@ -685,10 +685,10 @@ def _process(word: str):
685685 self ._query_thread (key , _process , self ._antonym , self ._get_word ())
686686 ant = self ._query_output_pop (key )
687687 if ant is None :
688- return
689- if len (ant ) == 0 :
688+ return None
689+ elif len (ant ) == 0 :
690690 return self ._write (self ._cfg .lang ('dictionary_no_results' ))
691- self ._write (', ' .join (ant ))
691+ return self ._write (', ' .join (ant ))
692692
693693 def _write (self , text : str ) -> None :
694694 """
@@ -727,7 +727,7 @@ def close(self) -> None:
727727 self .root .destroy ()
728728
729729
730- # noinspection PyShadowingNames,PyMissingOrEmptyDocstring
730+ # noinspection PyShadowingNames,PyMissingOrEmptyDocstring,PyTypeChecker
731731class RichText (tk .Text ):
732732 """
733733 Rich text.
@@ -1191,6 +1191,7 @@ def center_window(root: 'tk.Tk', window_size: Union[Tuple[int, int], List[int]])
11911191 (root .winfo_screenheight () - window_size [1 ]) / 2 ))
11921192
11931193
1194+ # noinspection PyTypeChecker
11941195def make_label_ttk (
11951196 master : Union ['tk.Tk' , 'tk.Frame' ],
11961197 h : int ,
@@ -1225,6 +1226,7 @@ def make_label_ttk(
12251226 return labelvar
12261227
12271228
1229+ # noinspection PyTypeChecker
12281230def make_label (
12291231 master : Union ['tk.Tk' , 'tk.Frame' ],
12301232 h : Union [int , float ],
0 commit comments