(self, readermode)
Partial initialization for the NNTP protocol.
        This instance method is extracted for supporting the test code.
Partial initialization for the NNTP protocol.
        This instance method is extracted for supporting the test code.
Partial initialization for the NNTP protocol . This instance method is extracted for supporting the test code .
def _base_init(self, readermode):
        """Partial initialization for the NNTP protocol.
        This instance method is extracted for supporting the test code.
        """
        self.debugging = 0
        self.welcome = self._getresp()

        # Inquire about capabilities (RFC 3977).
        self._caps = None
        self.getcapabilities()

        # 'MODE READER' is sometimes necessary to enable 'reader' mode.
        # However, the order in which 'MODE READER' and 'AUTHINFO' need to
        # arrive differs between some NNTP servers. If _setreadermode() fails
        # with an authorization failed error, it will set this to True;
        # the login() routine will interpret that as a request to try again
        # after performing its normal function.
        # Enable only if we're not already in READER mode anyway.
        self.readermode_afterauth = False
        if readermode and 'READER' not in self._caps:
            self._setreadermode()
            if not self.readermode_afterauth:
                # Capabilities might have changed after MODE READER
                self._caps = None
                self.getcapabilities()

        # RFC 4642 2.2.2: Both the client and the server MUST know if there is
        # a TLS session active.  A client MUST NOT attempt to start a TLS
        # session if a TLS session is already active.
        self.tls_on = False

        # Log in and encryption setup order is left to subclasses.
        self.authenticated = False
def _base_init ( self , readermode ) : self . debugging = 0 self . welcome = self . _getresp ( ) # Inquire about capabilities (RFC 3977). self . _caps = None self . getcapabilities ( ) # 'MODE READER' is sometimes necessary to enable 'reader' mode. # However, the order in which 'MODE READER' and 'AUTHINFO' need to # arrive differs between some NNTP servers. If _setreadermode() fails # with an authorization failed error, it will set this to True; # the login() routine will interpret that as a request to try again # after performing its normal function. # Enable only if we're not already in READER mode anyway. self . readermode_afterauth = False if readermode and 'READER' not in self . _caps : self . _setreadermode ( ) if not self . readermode_afterauth : # Capabilities might have changed after MODE READER self . _caps = None self . getcapabilities ( ) # RFC 4642 2.2.2: Both the client and the server MUST know if there is # a TLS session active.  A client MUST NOT attempt to start a TLS # session if a TLS session is already active. self . tls_on = False # Log in and encryption setup order is left to subclasses. self . authenticated = False