diff options
author | kongr45gpen <electrovesta@gmail.com> | 2016-01-21 18:41:55 +0200 |
---|---|---|
committer | kongr45gpen <electrovesta@gmail.com> | 2016-01-21 18:41:55 +0200 |
commit | 8fd81d577568517c12e23512dda43a7aecd1883a (patch) | |
tree | 784690ade7786e2b394f546f0e64ecca18ddbf84 /local/handler | |
parent | 230da7e0db5a31a543bbaa24a63478f5111ceba8 (diff) | |
download | supybot_github-8fd81d577568517c12e23512dda43a7aecd1883a.tar.gz supybot_github-8fd81d577568517c12e23512dda43a7aecd1883a.tar.bz2 supybot_github-8fd81d577568517c12e23512dda43a7aecd1883a.zip |
Show repo owner if the repo is a fork
Diffstat (limited to 'local/handler')
-rw-r--r-- | local/handler/CreateDeleteHandler.py | 2 | ||||
-rw-r--r-- | local/handler/GithubHandler.py | 10 | ||||
-rw-r--r-- | local/handler/IssueCommentHandler.py | 1 | ||||
-rw-r--r-- | local/handler/IssueHandler.py | 1 | ||||
-rw-r--r-- | local/handler/PushHandler.py | 5 | ||||
-rw-r--r-- | local/handler/StatusHandler.py | 1 | ||||
-rw-r--r-- | local/handler/WikiHandler.py | 2 |
7 files changed, 8 insertions, 14 deletions
diff --git a/local/handler/CreateDeleteHandler.py b/local/handler/CreateDeleteHandler.py index fc6f0cb..3fa0d45 100644 --- a/local/handler/CreateDeleteHandler.py +++ b/local/handler/CreateDeleteHandler.py @@ -5,7 +5,6 @@ def handle(data, theme): if data['ref_type'] == 'tag': theme.tag( - repo = data['repository']['name'], actor = data['sender']['login'], action = "tagged" if created else "deleted tag", to = data['ref'], @@ -14,7 +13,6 @@ def handle(data, theme): ) else: theme.branch( - repo = data['repository']['name'], actor = data['sender']['login'], action = "created" if created else "deleted", count = 0, diff --git a/local/handler/GithubHandler.py b/local/handler/GithubHandler.py index 1c54ce8..79a635a 100644 --- a/local/handler/GithubHandler.py +++ b/local/handler/GithubHandler.py @@ -69,7 +69,6 @@ class GithubHandler(BaseHTTPServer.BaseHTTPRequestHandler): and configValue('passcode').strip().lower() != 'false' \ and configValue('passcode').strip().lower() != 'null' \ and configValue('passcode').strip().lower() != 'no' - brackets = parseBrackets(configValue('brackets')) resetConfigOverrides() @@ -98,11 +97,13 @@ class GithubHandler(BaseHTTPServer.BaseHTTPRequestHandler): s.wfile.write("The password is wrong") return + brackets = parseBrackets(configValue('brackets')) themeName = configValue('theme') alphanumericPattern = re.compile('[\W_]+') themeClass = ''.join([alphanumericPattern.sub('', themeName).title(), 'Theme']) + # Find the theme's class try: mod = getattr(themes, themeClass) klass = getattr(mod, themeClass) @@ -111,7 +112,12 @@ class GithubHandler(BaseHTTPServer.BaseHTTPRequestHandler): log.error("The '%s' theme was not found" % themeName) klass = themes.DefaultTheme.DefaultTheme - theme = klass(brackets) + repo = {} + + repo['name'] = data.get('repository').get('name') + repo['owner'] = data.get('repository').get('owner',{}).get('login') + repo['fork'] = data.get('repository').get('fork', False) + theme = klass(repo, brackets) # # Handle different event types diff --git a/local/handler/IssueCommentHandler.py b/local/handler/IssueCommentHandler.py index e0084f3..b066013 100644 --- a/local/handler/IssueCommentHandler.py +++ b/local/handler/IssueCommentHandler.py @@ -10,7 +10,6 @@ def handle(data, theme): assignee = data['issue']['assignee']['login'] theme.issue( - repo = data['repository']['name'], actor = data['comment']['user']['login'], action = 'commented on', comment = data['comment']['body'], diff --git a/local/handler/IssueHandler.py b/local/handler/IssueHandler.py index cc5cf4e..122e519 100644 --- a/local/handler/IssueHandler.py +++ b/local/handler/IssueHandler.py @@ -18,7 +18,6 @@ def handle(data, theme): labelColor = data['label']['color'] theme.issue( - repo = data['repository']['name'], actor = data['sender']['login'], action = data['action'], issueNo = data['issue']['number'], diff --git a/local/handler/PushHandler.py b/local/handler/PushHandler.py index 46e57a7..e40aa64 100644 --- a/local/handler/PushHandler.py +++ b/local/handler/PushHandler.py @@ -59,7 +59,6 @@ def handle(data, theme): if configValue("hidePush",None) == False and not branched: theme.push( - repo = data['repository']['name'], branch = branch, actor = data['pusher']['name'], url = getShortURL(data['compare']), @@ -68,7 +67,6 @@ def handle(data, theme): elif branched: if isTag: theme.tag( - repo = data['repository']['name'], actor = data['pusher']['name'], action = action, base = branchFrom, @@ -80,7 +78,6 @@ def handle(data, theme): ) elif isMerge: theme.merge( - repo = data['repository']['name'], actor = data['pusher']['name'], action = action, mergeCount = mergedCommitCount, @@ -91,7 +88,6 @@ def handle(data, theme): ) else: theme.branch( - repo = data['repository']['name'], actor = data['pusher']['name'], action = action, count = commitno, @@ -116,7 +112,6 @@ def handle(data, theme): theme.commit( branch = commitBranch, - repo = data['repository']['name'], author = author, id = commit['id'], message = commit['message'], diff --git a/local/handler/StatusHandler.py b/local/handler/StatusHandler.py index dd4bbd9..729daac 100644 --- a/local/handler/StatusHandler.py +++ b/local/handler/StatusHandler.py @@ -2,7 +2,6 @@ from ..utility import * def handle(data, theme): theme.status( - repo = data['repository']['name'], status = data['state'], description = data['description'], url = data['target_url'] diff --git a/local/handler/WikiHandler.py b/local/handler/WikiHandler.py index 59bb37e..d04a589 100644 --- a/local/handler/WikiHandler.py +++ b/local/handler/WikiHandler.py @@ -7,7 +7,6 @@ def handle(data, theme): if configValue("hidePush",None) is False: theme.wikiPush( - repo = data['repository']['name'], actor = data['sender']['login'], count = pageno, url = url @@ -24,7 +23,6 @@ def handle(data, theme): # Unfortunately github doesn't support edit summaries :( theme.wikiPages( - repo = data['repository']['name'], actor = data['sender']['login'], pages = pages, url = url |