def login(self, username: str='anonymous', password: str='-wpull-lib@'):
        '''Log in.

        Coroutine.
        '''
        yield from self._control_stream.write_command(Command('USER', username))

        reply = yield from self._control_stream.read_reply()

        if reply.code == ReplyCodes.user_logged_in_proceed:
            return

        self.raise_if_not_match(
            'Login username', ReplyCodes.user_name_okay_need_password, reply)

        yield from self._control_stream.write_command(Command('PASS', password))

        reply = yield from self._control_stream.read_reply()

        self.raise_if_not_match(
            'Login password', ReplyCodes.user_logged_in_proceed, reply)
def login ( self , username : str = 'anonymous' , password : str = '-wpull-lib@' ) : yield from self . _control_stream . write_command ( Command ( 'USER' , username ) ) reply = yield from self . _control_stream . read_reply ( ) if reply . code == ReplyCodes . user_logged_in_proceed : return self . raise_if_not_match ( 'Login username' , ReplyCodes . user_name_okay_need_password , reply ) yield from self . _control_stream . write_command ( Command ( 'PASS' , password ) ) reply = yield from self . _control_stream . read_reply ( ) self . raise_if_not_match ( 'Login password' , ReplyCodes . user_logged_in_proceed , reply )
Log in.

        Coroutine.