def _auth(uri):
 (user, password) = _get_credentials()
 if ((user is False) or (password is False)):
  return False
 basic = _HTTPBasicAuthHandler()
 basic.add_password(realm='Tomcat Manager Application', uri=uri, user=user, passwd=password)
 digest = _HTTPDigestAuthHandler()
 digest.add_password(realm='Tomcat Manager Application', uri=uri, user=user, passwd=password)
 return _build_opener(basic, digest)

def _auth ( uri ) : ( user , password ) = _get_credentials ( ) if ( ( user is False ) or ( password is False ) ) : return False basic = _HTTPBasicAuthHandler ( ) basic . add_password ( realm = 'Tomcat Manager Application' , uri = uri , user = user , passwd = password ) digest = _HTTPDigestAuthHandler ( ) digest . add_password ( realm = 'Tomcat Manager Application' , uri = uri , user = user , passwd = password ) return _build_opener ( basic , digest )
returns a authentication handler .