@@ -48,7 +48,7 @@ def CreateAuthorization(username, password, appid):
4848 headers = {'content-type': 'application/json;charset=utf-8'}
4949 print('############### Sending Authentication request message to TRKD ###############')
5050 authenResult = doSendRequest(authenURL, authenMsg, headers)
51- if authenResult is not None and authenResult.status_code == 200:
51+ if authenResult and authenResult.status_code == 200:
5252 print('Authen success')
5353 print('response status %s' % (authenResult.status_code))
5454 # get Token
@@ -90,7 +90,7 @@ def RetrieveIntraday(token, appid):
9090
9191 print('############### Sending Time Series Intraday request message to TRKD ###############')
9292 intradayResult = doSendRequest(intradayURL, intradayRequestMsg, headers)
93- if intradayResult is not None and intradayResult.status_code == 200:
93+ if intradayResult and intradayResult.status_code == 200:
9494 print('Time Series Intraday response message: ')
9595 print(intradayResult.json())
9696
@@ -106,5 +106,5 @@ def RetrieveIntraday(token, appid):
106106 token = CreateAuthorization(username, password, appid)
107107 print('Token = %s' % (token))
108108 # if authentiacation success, continue subscribing Time Series intraday
109- if token is not None :
109+ if token:
110110 RetrieveIntraday(token, appid)
0 commit comments