Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def checkUserSadoTech(self,user="user",password="password"):
- cryptoUser = self.objCrypto.encrypt(user)
- cryptoPassword = self.objCrypto.encrypt(password)
- ''' Change '/' in the encrypte for '<*-*>' '''
- cryptoUser = cryptoUser.replace('/', '<*-*>')
- cryptoPassword = cryptoPassword.replace('/', '<*-*>')
- ''' Sent data to check user '''
- result = {"resp":False,"codError":0}
- try:
- url = "http://104.238.135.123/sadotech/business_reports/api/seller_accounts/{}/{}/"
- print(url.format(cryptoUser,cryptoPassword))
- response = urllib2.urlopen(url.format(cryptoUser,cryptoPassword))
- #result = response.read()
- print(response.read())
- result = {"resp":True,"codError":0}
- except:
- print("Error peticion...")
- #result = json.dumps({'error': 'Error loading api provider'})
- pass
- if True:
- ''' If check is True set and save data '''
- self.user.setUser(cryptoUser)
- self.user.setPassword(cryptoPassword)
- return result
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement