From 3cad53b5bd9e734f8f777e6e72bb7359e8a7ad1a Mon Sep 17 00:00:00 2001 From: James Lu Date: Sun, 13 Sep 2015 13:24:41 -0700 Subject: [PATCH] BonusLevel: distinguish between packs and levels in output --- BonusLevel/plugin.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/BonusLevel/plugin.py b/BonusLevel/plugin.py index 5ab8131..e4d0a04 100644 --- a/BonusLevel/plugin.py +++ b/BonusLevel/plugin.py @@ -56,9 +56,9 @@ class BonusLevel(callbacks.PluginRegexp): def _packid(self, irc, packid): url = 'http://www.bonuslevel.org/games/pack_-_%s.html' % packid - return self._fetch(irc, url) + return self._fetch(irc, url, itemname="Pack") - def _fetch(self, irc, url): + def _fetch(self, irc, url, itemname="Level"): self.log.debug('BonusLevel: fetching URL %s', url) data = utils.web.getUrl(url) soup = BeautifulSoup(data) @@ -71,7 +71,7 @@ class BonusLevel(callbacks.PluginRegexp): gamelink = linkobj["href"].replace('..', 'http://www.bonuslevel.org') title = linkobj.find("span", class_="gtitle").text author = div.ul.find_all('li')[1].a.text.strip() - s = format("Level %s by %s: %u", ircutils.bold(title), ircutils.bold(author), gamelink) + s = format("%s %s by %s: %u", itemname, ircutils.bold(title), ircutils.bold(author), gamelink) irc.reply(s) def levelSnarfer(self, irc, msg, match):