Skip to content

Commit 6594345

Browse files
committed
Merge pull request #14 from sevazhidkov/patch-7
Fix style errors found by PyLint
2 parents 7486bbf + 9894c85 commit 6594345

File tree

1 file changed

+15
-20
lines changed

1 file changed

+15
-20
lines changed

loklak.py

Lines changed: 15 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,8 @@
44
from __future__ import (absolute_import, division,
55
print_function, unicode_literals)
66

7-
import copy
8-
import math
9-
import sys
10-
import time
11-
from collections import namedtuple
12-
import requests
137
import json
8+
import requests
149

1510

1611
class Loklak(object):
@@ -66,17 +61,17 @@ def geocode(self, places=None):
6661
return_to_user = {}
6762
return json.dumps(return_to_user)
6863

69-
def map(self, latitude, longitude, width=500, height=500, zoom=8, text=""):
70-
"""Returns a map of size 500x500"""
71-
map_application = 'vis/map.png'
72-
params = {'text': text, 'mlat': latitude, 'mlon': longitude,\
73-
'width': width, 'height': height, 'zoom': zoom}
74-
return_to_user = requests.get(self.baseUrl + map_application, \
75-
params=params, stream=True)
76-
if return_to_user.status_code == 200:
77-
return return_to_user.raw.read()
78-
else:
79-
return ''
64+
def get_map(self, latitude, longitude, width=500, height=500, zoom=8, text=""):
65+
"""Returns a map of size 500x500"""
66+
map_application = 'vis/map.png'
67+
params = {'text': text, 'mlat': latitude, 'mlon': longitude,\
68+
'width': width, 'height': height, 'zoom': zoom}
69+
return_to_user = requests.get(self.baseUrl + map_application, \
70+
params=params, stream=True)
71+
if return_to_user.status_code == 200:
72+
return return_to_user.raw.read()
73+
else:
74+
return ''
8075

8176
def peers(self):
8277
"""Gives the peers of a user"""
@@ -118,8 +113,8 @@ def user(self, name=None, followers=None, following=None):
118113

119114
def settings(self):
120115
"""Gives the settings of the application"""
121-
settings_application = 'settings.json'
122-
url_to_give = 'http://localhost:9000/api/'+settings_application
116+
settings_application = 'api/settings.json'
117+
url_to_give = self.baseUrl + settings_application
123118
return_to_user = requests.get(url_to_give)
124119
if return_to_user.status_code == 200:
125120
return return_to_user.json()
@@ -181,7 +176,7 @@ def aggregations(self, query=None, since=None, until=None, fields=None, limit=No
181176
params['fields'] = field_string
182177
if limit:
183178
params['limit'] = self.limit
184-
if limit == None:
179+
if limit is None:
185180
limit = 6
186181
params['limit'] = self.limit
187182
params['count'] = 0

0 commit comments

Comments
 (0)