(self, username=None, password=None)
return success
Login with the Sat-IP HTTP server
Login with the Sat-IP HTTP server
Login with the Sat - IP HTTP server
def login(self, username=None, password=None):
        """Login with the Sat-IP HTTP server"""
        self._assert_addr()
        # Cache the credentials to allow auto reconnection
        if (username is not None):
            self.username = username
        if (password is not None):
            self.password = password

        url = self.base_url + "/cgi-bin/login.cgi"
        self.session = requests.Session()
        r = self.session.post(url,
                              data={
                                  'cmd': 'login',
                                  'username': self.username,
                                  'password': self.password
                              })
        r.raise_for_status()

        success = "Error" not in r.text
        if (not success):
            logger.debug("Login response:")
            logger.debug(r.text)

        return success
def login ( self , username = None , password = None ) : self . _assert_addr ( ) # Cache the credentials to allow auto reconnection if ( username is not None ) : self . username = username if ( password is not None ) : self . password = password url = self . base_url + "/cgi-bin/login.cgi" self . session = requests . Session ( ) r = self . session . post ( url , data = { 'cmd' : 'login' , 'username' : self . username , 'password' : self . password } ) r . raise_for_status ( ) success = "Error" not in r . text if ( not success ) : logger . debug ( "Login response:" ) logger . debug ( r . text ) return success