Advertisement
Guest User

Untitled

a guest
May 27th, 2018
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. import app.pars
  2. from base64 import b64decode
  3.  
  4. class api:
  5.  
  6. def __init__(self, config):
  7. '''Read config'''
  8. self.user = config["auth"]["username"]
  9. self.password = (b64decode(config["auth"]["password"])).decode("utf-8")
  10. self.page_id = config["page"]["page_id"]
  11. self.space = config["page"]["space"]
  12. self.title = config["page"]["title"]
  13.  
  14. config = api({"auth": {
  15. "username": "msmirnov",
  16. "password": ""},
  17. "page": {
  18. "space": "SIEM",
  19. "title": "TEST",
  20. "page_id": "917899782"}})
  21.  
  22. config2 = api({"auth": {
  23. "username": "msmirnov",
  24. "password": ""},
  25. "page": {
  26. "space": "SIEM",
  27. "title": "TEST",
  28. "page_id": "918881867"}})
  29.  
  30. data = {"key": "get_all", "params":{}}
  31.  
  32. app.pars.return_param(data, config)
  33. app.pars.return_param(data, config2)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement