aboutsummaryrefslogtreecommitdiff
path: root/tools/test-map.py
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2022-11-27 16:19:49 -0800
committerAnton Tananaev <anton@traccar.org>2022-11-27 16:19:49 -0800
commit6142cf557dc130828c12dbfb25ab18eda4bc0f7d (patch)
treea8d3b981796f2e5dc68be9e401afa5d6297abbbb /tools/test-map.py
parent938872ff5e2fad867720ec9c971ea432ba623c2c (diff)
downloadtrackermap-server-6142cf557dc130828c12dbfb25ab18eda4bc0f7d.tar.gz
trackermap-server-6142cf557dc130828c12dbfb25ab18eda4bc0f7d.tar.bz2
trackermap-server-6142cf557dc130828c12dbfb25ab18eda4bc0f7d.zip
Update python scripts
Diffstat (limited to 'tools/test-map.py')
-rwxr-xr-xtools/test-map.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/test-map.py b/tools/test-map.py
index 5808c1fbb..362c95878 100755
--- a/tools/test-map.py
+++ b/tools/test-map.py
@@ -2,7 +2,7 @@
import urllib
import urllib2
-import httplib
+import http.client as httplib
import time
import random
import json
@@ -14,7 +14,7 @@ devices = 500
def login():
request = urllib2.Request(baseUrl + '/api/session')
- response = urllib2.urlopen(request, urllib.urlencode(user))
+ response = urllib2.urlopen(request, urllib.parse.urlencode(user))
return response.headers.get('Set-Cookie')
def add_device(cookie, unique_id):
@@ -29,7 +29,7 @@ def add_device(cookie, unique_id):
def send_message(conn, device_id):
params = (('id', device_id), ('lat', random.uniform(59, 61)), ('lon', random.uniform(29, 31)))
- conn.request('GET', '?' + urllib.urlencode(params))
+ conn.request('GET', '?' + urllib.parse.urlencode(params))
conn.getresponse().read()
cookie = login()