def __init__(self, address, user, password, callback=None): self.callback = callback self.logger = logging.getLogger(__name__) try: if Address.validate(address): self.client = Client(url="http://" + address + "/Services/API?wsdl", faults=True).service self.client.login(user, password) else: self.callback("Invalid Address supplied", True) except Exception, e: self.callback("%s" % e, False) self.callback( "Could not initialize BAM client, check service is running and credentials are correct.", True)