Skip to content

Commit

Permalink
fix: urllib3 -> requests
Browse files Browse the repository at this point in the history
  • Loading branch information
SevereCloud committed May 19, 2019
1 parent cacb8ba commit 059a790
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
14 changes: 3 additions & 11 deletions main.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
"""vk-api-schema to sanbox app."""
import json
import os
import shutil

import urllib3
import requests

import insomnia
import postman
Expand All @@ -16,21 +15,14 @@

def getVersion():
"""Return last version."""
user_agent = {'user-agent': 'urllib3'}
http = urllib3.PoolManager(headers=user_agent)
r = http.request('GET', TAGS_SCHEMA_URL, preload_content=False)

tags = json.loads(r.data.decode('utf-8'))
tags = requests.get(TAGS_SCHEMA_URL).json()
last_tag_name = tags[0]["name"].split(".")
return last_tag_name[0] + "." + last_tag_name[1]


def downloadSchema():
"""Return object schema."""
http = urllib3.PoolManager()
r = http.request('GET', JSON_SCHEMA_URL, preload_content=False)

return json.loads(r.data.decode('utf-8'))
return requests.get(JSON_SCHEMA_URL).json()


if __name__ == "__main__":
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
urllib3
requests

0 comments on commit 059a790

Please sign in to comment.