diff --git a/.gitignore b/.gitignore index 0b843705..22ca50b2 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,5 @@ .idea/smartapi-python.iml build/* smartapi_python.egg-info -dist/* \ No newline at end of file +dist/* +.vscode/* diff --git a/SmartApi/smartConnect.py b/SmartApi/smartConnect.py index 272633fc..527b04f7 100644 --- a/SmartApi/smartConnect.py +++ b/SmartApi/smartConnect.py @@ -55,7 +55,7 @@ class SmartConnect(object): try: - clientPublicIp= " " + get('https://api.ipify.org').text + clientPublicIp= " " + get('https://checkip.amazonaws.com').text if " " in clientPublicIp: clientPublicIp=clientPublicIp.replace(" ","") hostname = socket.gethostname() @@ -245,7 +245,8 @@ def generateSession(self,clientCode,password,totp): return user else: - return loginResultObject + raise Exception(loginResultObject) + def terminateSession(self,clientCode): logoutResponseObject=self._postRequest("api.logout",{"clientcode":clientCode}) return logoutResponseObject