Add setting example in location.py

This commit is contained in:
jesopo 2019-05-23 11:49:57 +01:00
parent 34b7768d42
commit d8b625eaa9

View file

@ -5,7 +5,8 @@ URL_OPENCAGE = "https://api.opencagedata.com/geocode/v1/json"
class Module(ModuleManager.BaseModule): class Module(ModuleManager.BaseModule):
def on_load(self): def on_load(self):
self.exports.add("set", {"setting": "location", self.exports.add("set", {"setting": "location",
"help": "Set your location", "validate": self._get_location}) "help": "Set your location", "validate": self._get_location,
"example": "London, GB"})
def _get_location(self, s): def _get_location(self, s):
page = utils.http.request(URL_OPENCAGE, get_params={ page = utils.http.request(URL_OPENCAGE, get_params={