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/urbandictionary.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'modules/urbandictionary.py') diff --git a/modules/urbandictionary.py b/modules/urbandictionary.py index 2d5edd21..2f86ff6b 100644 --- a/modules/urbandictionary.py +++ b/modules/urbandictionary.py @@ -1,11 +1,11 @@ import json, re -from src import ModuleManager, Utils +from src import ModuleManager, utils URL_URBANDICTIONARY = "http://api.urbandictionary.com/v0/define" REGEX_DEFNUMBER = re.compile("-n(\d+) \S+") class Module(ModuleManager.BaseModule): - @Utils.hook("received.command.urbandictionary|ud", min_args=1) + @utils.hook("received.command.urbandictionary|ud", min_args=1) def ud(self, event): """ :help: Get the definition of a provided term from Urban Dictionary @@ -17,8 +17,8 @@ class Module(ModuleManager.BaseModule): if match: number = int(match.group(1)) term = term.split(" ", 1)[1] - page = Utils.get_url(URL_URBANDICTIONARY, get_params={"term": term}, - json=True) + page = utils.http.get_url(URL_URBANDICTIONARY, + get_params={"term": term}, json=True) if page: if len(page["list"]): if number > 0 and len(page["list"]) > number-1: -- cgit v1.3.1-10-gc9f91