Skip to content
Snippets Groups Projects
Commit fc6aef67 authored by Ian Cordasco's avatar Ian Cordasco
Browse files

Fix up for version 0.7.1

Closes #141. Closes #143
parent 39bd753a
No related branches found
No related tags found
No related merge requests found
History/Changelog
=================
 
0.8.0: 2013-xx-xx
0.7.1: 2013-09-30
-----------------
 
- Add dependency on uritemplate.py_ to add URITemplates to different classes
- Add dependency on uritemplate.py_ to add URITemplates to different classes.
See the documentation for attributes which are templates.
- Fixed issue trying to parse ``html_url`` on Pull Requests courtesy of
@rogerhu.
- Remove ``expecter`` as a test dependency courtesy of @esacteksab.
- Fixed issue #141 trying to find an Event that doesn't exist.
 
.. _uritemplate.py: https://github.com/sigmavirus24/uritemplate
 
Loading
Loading
Loading
Loading
@@ -13,7 +13,7 @@ __title__ = 'github3'
__author__ = 'Ian Cordasco'
__license__ = 'Modified BSD'
__copyright__ = 'Copyright 2012-2013 Ian Cordasco'
__version__ = '0.7.0'
__version__ = '0.7.1'
__version_info__ = tuple(int(i) for i in __version__.split('.'))
 
from github3.api import *
Loading
Loading
Loading
Loading
@@ -43,7 +43,7 @@ class Event(GitHubObject):
self.org = Organization(event.get('org'))
#: Event type http://developer.github.com/v3/activity/events/types/
self.type = event.get('type')
handler = _payload_handlers[self.type]
handler = _payload_handlers.get(self.type, identity)
#: Dictionary with the payload. Payload structure is defined by type_.
# _type: http://developer.github.com/v3/events/types
self.payload = handler(event.get('payload'))
Loading
Loading
@@ -164,23 +164,27 @@ def _team(payload):
return payload
 
 
def identity(x):
return x
_payload_handlers = {
'CommitCommentEvent': _commitcomment,
'CreateEvent': lambda x: x,
'DeleteEvent': lambda x: x,
'CreateEvent': identity,
'DeleteEvent': identity,
'DownloadEvent': _download,
'FollowEvent': _follow,
'ForkEvent': _forkev,
'ForkApplyEvent': lambda x: x,
'ForkApplyEvent': identity,
'GistEvent': _gist,
'GollumEvent': lambda x: x,
'GollumEvent': identity,
'IssueCommentEvent': _issuecomm,
'IssuesEvent': _issueevent,
'MemberEvent': _member,
'PublicEvent': lambda x: '',
'PullRequestEvent': _pullreqev,
'PullRequestReviewCommentEvent': _pullreqcomm,
'PushEvent': lambda x: x,
'PushEvent': identity,
'TeamAddEvent': _team,
'WatchEvent': lambda x: x,
'WatchEvent': identity,
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment