From 203216d94d44586d1fe261b48039058c2917e71a Mon Sep 17 00:00:00 2001 From: jesopo Date: Wed, 4 Sep 2019 14:27:10 +0100 Subject: Switch more settings to FunctionSettings --- modules/location.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'modules/location.py') diff --git a/modules/location.py b/modules/location.py index 9f405383..1858a915 100644 --- a/modules/location.py +++ b/modules/location.py @@ -6,16 +6,10 @@ from src import ModuleManager, utils URL_OPENCAGE = "https://api.opencagedata.com/geocode/v1/json" -class LocationSetting(utils.Setting): - _func = None - def parse(self, value: str) -> typing.Any: - return self._func(value) - class Module(ModuleManager.BaseModule): def on_load(self): - setting = LocationSetting("location", "Set your location", - example="London, GB") - setting._func = self._get_location + setting = utils.FunctionSetting(self._get_location, "location", + "Set your location", example="London, GB") self.exports.add("set", setting) self.exports.add("get-location", self._get_location) -- cgit v1.3.1-10-gc9f91