From 10ef985a8a849a6bbfa8cbb63c2548e42ffb3957 Mon Sep 17 00:00:00 2001 From: jesopo Date: Sun, 30 Sep 2018 17:29:09 +0100 Subject: Switch to using docstring for usage, permission and require_mode --- modules/tfl.py | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) (limited to 'modules/tfl.py') diff --git a/modules/tfl.py b/modules/tfl.py index a1bdab4a..23c4cecf 100644 --- a/modules/tfl.py +++ b/modules/tfl.py @@ -46,10 +46,11 @@ class Module(ModuleManager.BaseModule): platform = m.group(2) return platform - @Utils.hook("received.command.tflbus", min_args=1, usage="") + @Utils.hook("received.command.tflbus", min_args=1) def bus(self, event): """ - Get bus due times for a TfL bus stop + :help: Get bus due times for a TfL bus stop + :usage: """ app_id = self.bot.config["tfl-api-id"] app_key = self.bot.config["tfl-api-key"] @@ -122,10 +123,11 @@ class Module(ModuleManager.BaseModule): else: event["stderr"].write("Bus ID '%s' unknown" % stop_id) - @Utils.hook("received.command.tflline", usage="") + @Utils.hook("received.command.tflline") def line(self, event): """ - Get line status for TfL underground lines + :help: Get line status for TfL underground lines + :usage: """ app_id = self.bot.config["tfl-api-id"] app_key = self.bot.config["tfl-api-key"] @@ -165,10 +167,11 @@ class Module(ModuleManager.BaseModule): else: event["stderr"].write("No results") - @Utils.hook("received.command.tflsearch", min_args=1, usage="") + @Utils.hook("received.command.tflsearch", min_args=1) def search(self, event): """ - Get a list of TfL stop IDs for a given name + :help: Get a list of TfL stop IDs for a given name + :usage: """ app_id = self.bot.config["tfl-api-id"] app_key = self.bot.config["tfl-api-key"] @@ -186,10 +189,11 @@ class Module(ModuleManager.BaseModule): else: event["stderr"].write("No results") - @Utils.hook("received.command.tflvehicle", min_args=1, usage="") + @Utils.hook("received.command.tflvehicle", min_args=1) def vehicle(self, event): """ - Get information for a given vehicle + :help: Get information for a given vehicle + :usage: """ app_id = self.bot.config["tfl-api-id"] app_key = self.bot.config["tfl-api-key"] @@ -206,11 +210,11 @@ class Module(ModuleManager.BaseModule): vehicle["vehicleId"], vehicle["lineName"], vehicle["destinationName"], vehicle["currentLocation"], vehicle["stationName"], vehicle["naptanId"], arrival_time, platform)) - @Utils.hook("received.command.tflservice", min_args=1, - usage="") + @Utils.hook("received.command.tflservice", min_args=1) def service(self, event): """ - Get service information and arrival estimates + :help: Get service information and arrival estimates + :usage: """ app_id = self.bot.config["tfl-api-id"] app_key = self.bot.config["tfl-api-key"] @@ -239,10 +243,11 @@ class Module(ModuleManager.BaseModule): a["expectedArrival"][11:16] ) for a in arrivals])) - @Utils.hook("received.command.tflstop", min_args=1, usage="") + @Utils.hook("received.command.tflstop", min_args=1) def stop(self, event): """ - Get information for a given stop + :help: Get information for a given stop + :usage: """ app_id = self.bot.config["tfl-api-id"] app_key = self.bot.config["tfl-api-key"] -- cgit v1.3.1-10-gc9f91