From 231926207709ceaa61e87b64e34e17d85adecd9c Mon Sep 17 00:00:00 2001 From: Vincent Jacques Date: Tue, 13 Mar 2012 20:01:07 +0100 Subject: [PATCH] Spliting GithubObjects.py --- github/CommitComment.py | 16 ++++++++++++++++ github/Download.py | 14 ++++++++++++++ github/GithubObjects.py | 27 ++------------------------- 3 files changed, 32 insertions(+), 25 deletions(-) create mode 100644 github/CommitComment.py create mode 100644 github/Download.py diff --git a/github/CommitComment.py b/github/CommitComment.py new file mode 100644 index 00000000..d51c912f --- /dev/null +++ b/github/CommitComment.py @@ -0,0 +1,16 @@ +from GithubObject import * + +from NamedUser import NamedUser + +CommitComment = GithubObject( + "CommitComment", + BaseUrl( lambda obj: obj._repo._baseUrl() + "/comments/" + str( obj.id ) ), + InternalSimpleAttributes( + "url", "id", "body", "path", "position", "commit_id", + "created_at", "updated_at", "html_url", "line", + "_repo", + ), + InternalObjectAttribute( "user", NamedUser ), + Editable( [ "body" ], [] ), + Deletable(), +) diff --git a/github/Download.py b/github/Download.py new file mode 100644 index 00000000..a4577f31 --- /dev/null +++ b/github/Download.py @@ -0,0 +1,14 @@ +from GithubObject import * + +Download = GithubObject( + "Download", + BaseUrl( lambda obj: obj._repo._baseUrl() + "/downloads/" + str( obj.id ) ), + InternalSimpleAttributes( + "url", "html_url", "id", "name", "description", "size", + "download_count", "content_type", "policy", "signature", "bucket", + "accesskeyid", "path", "acl", "expirationdate", "prefix", "mime_type", + "redirect", "s3_url", "created_at", + "_repo", + ), + Deletable(), +) diff --git a/github/GithubObjects.py b/github/GithubObjects.py index d4ac5d60..9480ba45 100644 --- a/github/GithubObjects.py +++ b/github/GithubObjects.py @@ -74,31 +74,8 @@ Issue = GithubObject( ), ) -Download = GithubObject( - "Download", - BaseUrl( lambda obj: obj._repo._baseUrl() + "/downloads/" + str( obj.id ) ), - InternalSimpleAttributes( - "url", "html_url", "id", "name", "description", "size", - "download_count", "content_type", "policy", "signature", "bucket", - "accesskeyid", "path", "acl", "expirationdate", "prefix", "mime_type", - "redirect", "s3_url", "created_at", - "_repo", - ), - Deletable(), -) - -CommitComment = GithubObject( - "CommitComment", - BaseUrl( lambda obj: obj._repo._baseUrl() + "/comments/" + str( obj.id ) ), - InternalSimpleAttributes( - "url", "id", "body", "path", "position", "commit_id", - "created_at", "updated_at", "html_url", "line", - "_repo", - ), - InternalObjectAttribute( "user", NamedUser ), - Editable( [ "body" ], [] ), - Deletable(), -) +from Download import Download +from CommitComment import CommitComment Commit = GithubObject( "Commit",