aboutsummaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorGravatar jesopo2019-09-07 15:17:30 +0100
committerGravatar jesopo2019-09-07 15:17:30 +0100
commit4c2c4a501c7b3213f45608c9ee610b193f1cdc0b (patch)
treea97b395727f77cec4839a90ea3f794dad5e5bb5a /modules
parent477 should check that we're *not* in a channel before trying rejoin (diff)
return quote category even if =quote isnt present
Diffstat (limited to 'modules')
-rw-r--r--modules/quotes.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/modules/quotes.py b/modules/quotes.py
index 2e972a2b..48ef8661 100644
--- a/modules/quotes.py
+++ b/modules/quotes.py
@@ -5,9 +5,12 @@ from src import ModuleManager, utils
class Module(ModuleManager.BaseModule):
def category_and_quote(self, s):
- if "=" in s:
- return [part.strip() for part in s.split("=", 1)]
- return None, None
+ category, sep, quote = s.partition("=")
+ category = category.strip()
+
+ if not sep:
+ return category, None
+ return category, quote.strip()
def _get_quotes(self, server, category):
return server.get_setting("quotes-%s" % category, [])