diff options
author | kongr45gpen <electrovesta@gmail.com> | 2016-01-21 17:15:39 +0200 |
---|---|---|
committer | kongr45gpen <electrovesta@gmail.com> | 2016-01-21 17:15:39 +0200 |
commit | 042bf88ca06f04d78bd6c7506b349934df291d31 (patch) | |
tree | 261656a2dc2e4f0821077e7e0264fb2856b90cbf /local/utility.py | |
parent | f352d99c68ecea70b5599b50c3626636d22b845a (diff) | |
download | supybot_github-042bf88ca06f04d78bd6c7506b349934df291d31.tar.gz supybot_github-042bf88ca06f04d78bd6c7506b349934df291d31.tar.bz2 supybot_github-042bf88ca06f04d78bd6c7506b349934df291d31.zip |
Allow configuring the type of brackets to use
Diffstat (limited to 'local/utility.py')
-rw-r--r-- | local/utility.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/local/utility.py b/local/utility.py index 3487b06..aa96835 100644 --- a/local/utility.py +++ b/local/utility.py @@ -41,6 +41,15 @@ def plural(number, s, p): return p return s +def parseBrackets(bracketConfig): + if " " in bracketConfig: + return tuple(bracketConfig.split(' ', 1)) + else: + # Cut the config in the middle + mid = len(bracketConfig)/2 + return (bracketConfig[:mid], bracketConfig[mid:]) + + def maxLen(msg, maxn=400, splitLines=True): """Cut down a string if its longer than `maxn` chars""" |