From 69d58eede2e9bf83aa1ed1d8fcf956efde494726 Mon Sep 17 00:00:00 2001 From: jesopo Date: Wed, 3 Oct 2018 13:22:37 +0100 Subject: Move src/Utils.py in to src/utils/, splitting functionality out in to modules of related functionality --- modules/translate.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'modules/translate.py') diff --git a/modules/translate.py b/modules/translate.py index b96a49a1..8570ae76 100644 --- a/modules/translate.py +++ b/modules/translate.py @@ -1,12 +1,12 @@ import json, re -from src import ModuleManager, Utils +from src import ModuleManager, utils URL_TRANSLATE = "http://translate.googleapis.com/translate_a/single" URL_LANGUAGES = "https://cloud.google.com/translate/docs/languages" REGEX_LANGUAGES = re.compile("(\w+)?:(\w+)? ") class Module(ModuleManager.BaseModule): - @Utils.hook("received.command.translate|tr") + @utils.hook("received.command.translate|tr") def translate(self, event): """ :help: Translate the provided phrase or the last line in thie current @@ -32,7 +32,7 @@ class Module(ModuleManager.BaseModule): target_language = language_match.group(2) phrase = phrase.split(" ", 1)[1] - data = Utils.get_url(URL_TRANSLATE, get_params={ + data = utils.http.get_url(URL_TRANSLATE, get_params={ "client": "gtx", "sl": source_language, "tl": target_language, "dt": "t", "q": phrase}) -- cgit v1.3.1-10-gc9f91