parameters: (self)
return_statement: return self.__serial_port_value
docstring: Check available Serial Ports and populates the port dictionary.
  
          Returns currently selected Serial Port value if available.
          Returns None if selected Serial Port is not available anymore.
  
          :return: Serial Port dictionary value
docstring_summary: Check available Serial Ports and populates the port dictionary.
docstring_tokens: Check available Serial Ports and populates the port dictionary .
function: def get_serial_port_flag(self):
          """Check available Serial Ports and populates the port dictionary.
  
          Returns currently selected Serial Port value if available.
          Returns None if selected Serial Port is not available anymore.
  
          :return: Serial Port dictionary value
          """
          self.populate_serial_port_list()
          if not self.__serial_ports:
              print('There are no available Serial Ports !!!')
              self.__serial_port_key = None
              self.__serial_port_value = None
              self.save_settings()
          elif self.__serial_port_value not in self.__serial_ports.values():
              print('The selected Serial Port is no longer available !!!')
              self.__serial_port_key = None
              self.__serial_port_value = None
              self.save_settings()
          elif self.__serial_ports[self.__serial_port_key] != \
                  self.__serial_port_value:
              # At this point the dictionary is not empty and the flag
              # (dictionary value) is present, but not with the right key.
              # So correct the key.
              for key, value in self.__serial_ports.items():
                  if self.__serial_port_value == value:
                      self.__serial_port_key = key
              # No need to save settings as only value saved and stays the same
          return self.__serial_port_value
function_tokens: def get_serial_port_flag ( self ) : self . populate_serial_port_list ( ) if not self . __serial_ports : print ( 'There are no available Serial Ports !!!' ) self . __serial_port_key = None self . __serial_port_value = None self . save_settings ( ) elif self . __serial_port_value not in self . __serial_ports . values ( ) : print ( 'The selected Serial Port is no longer available !!!' ) self . __serial_port_key = None self . __serial_port_value = None self . save_settings ( ) elif self . __serial_ports [ self . __serial_port_key ] != self . __serial_port_value : # At this point the dictionary is not empty and the flag # (dictionary value) is present, but not with the right key. # So correct the key. for key , value in self . __serial_ports . items ( ) : if self . __serial_port_value == value : self . __serial_port_key = key # No need to save settings as only value saved and stays the same return self . __serial_port_value