diff options
author | kongr45gpen <electrovesta@gmail.com> | 2016-07-30 20:48:09 +0300 |
---|---|---|
committer | kongr45gpen <electrovesta@gmail.com> | 2016-07-30 20:48:09 +0300 |
commit | 93beeec8ceb8cb62c1da3ae5239e4299ebf3dc50 (patch) | |
tree | 2e6da93fa5b4fba10d9b0e9a72afb22602c52330 | |
parent | e5d698ab769bb03340d83e253721c6c3f56ade01 (diff) | |
download | supybot_github-93beeec8ceb8cb62c1da3ae5239e4299ebf3dc50.tar.gz supybot_github-93beeec8ceb8cb62c1da3ae5239e4299ebf3dc50.tar.bz2 supybot_github-93beeec8ceb8cb62c1da3ae5239e4299ebf3dc50.zip |
Add a config value to hide URLs
-rw-r--r-- | config.py | 4 | ||||
-rw-r--r-- | local/theme/Theme.py | 3 | ||||
-rw-r--r-- | local/utility.py | 2 |
3 files changed, 9 insertions, 0 deletions
@@ -67,4 +67,8 @@ conf.registerGlobalValue(Github, 'allowArbitraryMessages', registry.Boolean(False, """Whether to allow parsing and showing arbitrary messages sent by a client""")) +conf.registerGlobalValue(Github, 'hideURL', + registry.Boolean(False, + """Whether to not display the URLs of actions""")) + # vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79: diff --git a/local/theme/Theme.py b/local/theme/Theme.py index ecad213..c209e49 100644 --- a/local/theme/Theme.py +++ b/local/theme/Theme.py @@ -8,4 +8,7 @@ class Theme(object): pass def enclose(self, text): + if text == None or text == '': + #TODO: Remove the space before the URL + return "" return "%s%s%s" % (self.brackets[0], text, self.brackets[1]) diff --git a/local/utility.py b/local/utility.py index a1d41bd..065be0f 100644 --- a/local/utility.py +++ b/local/utility.py @@ -97,6 +97,8 @@ def colorAction(action): def getShortURL(longurl): """ Returns a short URL generated by git.io""" + if configValue("hideURL") is True: + return None if configValue("shortURL") is False or not getShortURL.github.match(longurl): url = longurl else: |