pep8 tweaks
This commit is contained in:
parent
a1eb155b14
commit
923e829068
4 changed files with 18 additions and 11 deletions
|
@ -1,9 +1,11 @@
|
|||
from util import hook
|
||||
|
||||
|
||||
def find_location(ip, api):
|
||||
import string
|
||||
import urllib
|
||||
response = urllib.urlopen("http://api.ipinfodb.com/v3/ip-city/?key="+api+"&ip="+ip).read()
|
||||
response = urllib.urlopen("http://api.ipinfodb.com/v3/ip-city/?key=" \
|
||||
+ api + "&ip=" + ip).read()
|
||||
response = response.split(";")
|
||||
give = {}
|
||||
give["country"] = response[4].title()
|
||||
|
@ -13,6 +15,7 @@ def find_location(ip, api):
|
|||
give["timezone"] = response[10].title()
|
||||
return give
|
||||
|
||||
|
||||
def timezone(ip):
|
||||
time = find_location(ip)["timezone"]
|
||||
time = time.replace(":", ".")
|
||||
|
|
Reference in a new issue