From fb722625dddb9a32f75190723f7da12683b7c4b2 Mon Sep 17 00:00:00 2001 From: Vincent Jacques Date: Tue, 13 Mar 2012 19:59:48 +0100 Subject: [PATCH] Spliting GithubObjects.py --- github/GithubObjects.py | 23 ++--------------------- github/IssueComment.py | 15 +++++++++++++++ github/IssueEvent.py | 13 +++++++++++++ 3 files changed, 30 insertions(+), 21 deletions(-) create mode 100644 github/IssueComment.py create mode 100644 github/IssueEvent.py diff --git a/github/GithubObjects.py b/github/GithubObjects.py index 117d2200..d4ac5d60 100644 --- a/github/GithubObjects.py +++ b/github/GithubObjects.py @@ -41,27 +41,8 @@ Milestone = GithubObject( ), ) -IssueComment = GithubObject( - "IssueComment", - BaseUrl( lambda obj: obj._repo._baseUrl() + "/issues/comments/" + str( obj.id ) ), - InternalSimpleAttributes( - "url", "body", "created_at", "updated_at", "id", - "_repo", - ), - InternalObjectAttribute( "user", NamedUser ), - Editable( [ "body" ], [] ), - Deletable(), -) - -IssueEvent = GithubObject( - "IssueEvent", - BaseUrl( lambda obj: obj._repo._baseUrl() + "/issues/events/" + str( obj.id ) ), - InternalSimpleAttributes( - "id", "url", "created_at", "issue", "event", "commit_id", - "_repo", - ), - InternalObjectAttribute( "actor", NamedUser ), -) +from IssueComment import IssueComment +from IssueEvent import IssueEvent Issue = GithubObject( "Issue", diff --git a/github/IssueComment.py b/github/IssueComment.py new file mode 100644 index 00000000..d22ff923 --- /dev/null +++ b/github/IssueComment.py @@ -0,0 +1,15 @@ +from GithubObject import * + +from NamedUser import NamedUser + +IssueComment = GithubObject( + "IssueComment", + BaseUrl( lambda obj: obj._repo._baseUrl() + "/issues/comments/" + str( obj.id ) ), + InternalSimpleAttributes( + "url", "body", "created_at", "updated_at", "id", + "_repo", + ), + InternalObjectAttribute( "user", NamedUser ), + Editable( [ "body" ], [] ), + Deletable(), +) diff --git a/github/IssueEvent.py b/github/IssueEvent.py new file mode 100644 index 00000000..88f0d482 --- /dev/null +++ b/github/IssueEvent.py @@ -0,0 +1,13 @@ +from GithubObject import * + +from NamedUser import NamedUser + +IssueEvent = GithubObject( + "IssueEvent", + BaseUrl( lambda obj: obj._repo._baseUrl() + "/issues/events/" + str( obj.id ) ), + InternalSimpleAttributes( + "id", "url", "created_at", "issue", "event", "commit_id", + "_repo", + ), + InternalObjectAttribute( "actor", NamedUser ), +)