aboutsummaryrefslogtreecommitdiff
path: root/modules/location.py
diff options
context:
space:
mode:
authorGravatar jesopo2019-09-04 14:27:10 +0100
committerGravatar jesopo2019-09-04 14:27:10 +0100
commit203216d94d44586d1fe261b48039058c2917e71a (patch)
tree1403235606ca63cb18051a9026e7d39cafbc5296 /modules/location.py
parentswitch throttle.py to use FunctionSetting (diff)
signature
Switch more settings to FunctionSettings
Diffstat (limited to 'modules/location.py')
-rw-r--r--modules/location.py10
1 files changed, 2 insertions, 8 deletions
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)