Advertisement
Guest User

Untitled

a guest
Jan 2nd, 2017
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.16 KB | None | 0 0
  1. def checkUserSadoTech(self,user="user",password="password"):
  2. cryptoUser = self.objCrypto.encrypt(user)
  3. cryptoPassword = self.objCrypto.encrypt(password)
  4.  
  5. ''' Change '/' in the encrypte for '<*-*>' '''
  6. cryptoUser = cryptoUser.replace('/', '<*-*>')
  7. cryptoPassword = cryptoPassword.replace('/', '<*-*>')
  8.  
  9. ''' Sent data to check user '''
  10. result = {"resp":False,"codError":0}
  11.  
  12. try:
  13. url = "http://104.238.135.123/sadotech/business_reports/api/seller_accounts/{}/{}/"
  14. print(url.format(cryptoUser,cryptoPassword))
  15. response = urllib2.urlopen(url.format(cryptoUser,cryptoPassword))
  16. #result = response.read()
  17. print(response.read())
  18. result = {"resp":True,"codError":0}
  19. except:
  20. print("Error peticion...")
  21. #result = json.dumps({'error': 'Error loading api provider'})
  22. pass
  23.  
  24. if True:
  25. ''' If check is True set and save data '''
  26. self.user.setUser(cryptoUser)
  27. self.user.setPassword(cryptoPassword)
  28. return result
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement