aboutsummaryrefslogtreecommitdiff
path: root/modules/books.py
diff options
context:
space:
mode:
authorGravatar jesopo2018-10-03 13:22:37 +0100
committerGravatar jesopo2018-10-03 13:22:37 +0100
commit69d58eede2e9bf83aa1ed1d8fcf956efde494726 (patch)
tree11aa30f2a357f3be23ad97315dae3df051455cbe /modules/books.py
parentAdd a way to not add a user automatically in IRCServer.get_user (diff)
signature
Move src/Utils.py in to src/utils/, splitting functionality out in to modules of
related functionality
Diffstat (limited to 'modules/books.py')
-rw-r--r--modules/books.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/modules/books.py b/modules/books.py
index e3642198..6555c156 100644
--- a/modules/books.py
+++ b/modules/books.py
@@ -1,5 +1,5 @@
import json, re
-from src import ModuleManager, Utils
+from src import ModuleManager, utils
URL_GOOGLEBOOKS = "https://www.googleapis.com/books/v1/volumes"
URL_BOOKINFO = "https://books.google.co.uk/books?id=%s"
@@ -9,7 +9,7 @@ class Module(ModuleManager.BaseModule):
_name = "ISBN"
def get_book(self, query, event):
- page = Utils.get_url(URL_GOOGLEBOOKS, get_params={
+ page = utils.http.get_url(URL_GOOGLEBOOKS, get_params={
"q": query, "country": "us"}, json=True)
if page:
if page["totalItems"] > 0:
@@ -36,7 +36,7 @@ class Module(ModuleManager.BaseModule):
else:
event["stderr"].write("Failed to load results")
- @Utils.hook("received.command.isbn", min_args=1)
+ @utils.hook("received.command.isbn", min_args=1)
def isbn(self, event):
"""
:help: Get book information from a provided ISBN
@@ -48,7 +48,7 @@ class Module(ModuleManager.BaseModule):
isbn = isbn.replace("-", "")
self.get_book("isbn:%s" % isbn, event)
- @Utils.hook("received.command.book", min_args=1)
+ @utils.hook("received.command.book", min_args=1)
def book(self, event):
"""
:help: Get book information from a provided title