From f161a009ceeb3970f5bed2bc569bb0696e2001c8 Mon Sep 17 00:00:00 2001 From: kongr45gpen Date: Fri, 16 Sep 2016 16:32:05 +0300 Subject: Allow using supybot to override config values for each channel --- config.py | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) (limited to 'config.py') diff --git a/config.py b/config.py index f91f05b..3e0f66c 100644 --- a/config.py +++ b/config.py @@ -16,14 +16,16 @@ Github = conf.registerPlugin('Github') # This is where your configuration variables (if any) should go. For example: # conf.registerGlobalValue(Github, 'someConfigVariableName', # registry.Boolean(False, """Help for someConfigVariableName.""")) +# +# Global values should also be added to configValue() in utility.py conf.registerGlobalValue(Github, 'channel', registry.String('#commits', """Determines the channel where commit notifications will go by default.""")) -conf.registerGlobalValue(Github, 'shortURL', +conf.registerChannelValue(Github, 'shortURL', registry.Boolean(True, """Use git.io to produce shorter URLs""")) -conf.registerGlobalValue(Github, 'hidePush', +conf.registerChannelValue(Github, 'hidePush', registry.Boolean(False, """Whether to hide 'user pushed ... commits' message""")) conf.registerGlobalValue(Github, 'passcode', @@ -37,19 +39,19 @@ conf.registerGlobalValue(Github, 'disallowConfigOverride', registry.Boolean(True, """Don't let the user change config values from the URL""")) -conf.registerGlobalValue(Github, 'showMilestone', +conf.registerChannelValue(Github, 'showMilestone', registry.Boolean(True, """Show the name of the milestone when reporting issues or issue comments""")) -conf.registerGlobalValue(Github, 'tagShowCommitMsg', +conf.registerChannelValue(Github, 'tagShowCommitMsg', registry.Boolean(True, """Show the commit message of the commit a new tag points to""")) -conf.registerGlobalValue(Github, 'showMergedCommits', +conf.registerChannelValue(Github, 'showMergedCommits', registry.Boolean(False, """Show merged commits when a branch is merged into another""")) -conf.registerGlobalValue(Github, 'showSuccessfulBuildMessages', +conf.registerChannelValue(Github, 'showSuccessfulBuildMessages', registry.String('change', """Whether to show successful build messages - can be never, change or always""")) @@ -57,29 +59,29 @@ conf.registerGlobalValue(Github, 'port', registry.Integer(8093, """The port where Github will send HTTP requests""")) -conf.registerGlobalValue(Github, 'theme', +conf.registerChannelValue(Github, 'theme', registry.String('default', """The name of the theme that will be used to style messages""")) -conf.registerGlobalValue(Github, 'brackets', +conf.registerChannelValue(Github, 'brackets', registry.String('( )', """The brackets to use to enclose URLs (space-separated)""")) -conf.registerGlobalValue(Github, 'allowArbitraryMessages', +conf.registerChannelValue(Github, 'allowArbitraryMessages', registry.Boolean(False, """Whether to allow parsing and showing arbitrary messages sent by a client""")) -conf.registerGlobalValue(Github, 'hideURL', +conf.registerChannelValue(Github, 'hideURL', registry.Boolean(False, """Whether to not display the URLs of actions""")) -conf.registerGlobalValue(Github, 'preventIssueNameSpam', +conf.registerChannelValue(Github, 'preventIssueNameSpam', registry.Boolean(True, """Whether to prevent the same issue name from showing up too often""")) -conf.registerGlobalValue(Github, 'showIssueEdits', +conf.registerChannelValue(Github, 'showIssueEdits', registry.Boolean(True, """Whether to show a message when an issue is edited""")) -conf.registerGlobalValue(Github, 'showPendingStatuses', +conf.registerChannelValue(Github, 'showPendingStatuses', registry.Boolean(True, """Whether to show a message for a pending status (e.g. a build in progress)""")) -- cgit v1.2.3