mirror of
https://github.com/status-im/PyGithub.git
synced 2026-09-02 11:51:10 +00:00
Make 'isCompletable = True' the default case
This commit is contained in:
@@ -15,7 +15,7 @@ import Issue
|
||||
import Event
|
||||
import Authorization
|
||||
|
||||
class AuthenticatedUser( GithubObject.CompletableGithubObject ):
|
||||
class AuthenticatedUser( GithubObject.GithubObject ):
|
||||
@property
|
||||
def avatar_url( self ):
|
||||
self._completeIfNeeded( self._avatar_url )
|
||||
|
||||
@@ -6,7 +6,7 @@ from DefaultValueForOptionalParameters import DefaultValueForOptionalParameters
|
||||
##########
|
||||
import AuthorizationApplication
|
||||
|
||||
class Authorization( GithubObject.CompletableGithubObject ):
|
||||
class Authorization( GithubObject.GithubObject ):
|
||||
@property
|
||||
def app( self ):
|
||||
self._completeIfNeeded( self._app )
|
||||
|
||||
@@ -6,10 +6,12 @@ import GithubObject
|
||||
class AuthorizationApplication( GithubObject.GithubObject ):
|
||||
@property
|
||||
def name( self ):
|
||||
self._completeIfNeeded( self._name )
|
||||
return self._name
|
||||
|
||||
@property
|
||||
def url( self ):
|
||||
self._completeIfNeeded( self._url )
|
||||
return self._url
|
||||
|
||||
def _initAttributes( self ):
|
||||
|
||||
@@ -5,7 +5,7 @@ import GithubObject
|
||||
##########
|
||||
import Commit
|
||||
|
||||
class Branch( GithubObject.GithubObject ):
|
||||
class Branch( GithubObject.BasicGithubObject ):
|
||||
@property
|
||||
def commit( self ):
|
||||
return self._commit
|
||||
|
||||
@@ -12,7 +12,7 @@ import CommitStats
|
||||
import Commit
|
||||
import CommitComment
|
||||
|
||||
class Commit( GithubObject.CompletableGithubObject ):
|
||||
class Commit( GithubObject.GithubObject ):
|
||||
@property
|
||||
def author( self ):
|
||||
self._completeIfNeeded( self._author )
|
||||
|
||||
@@ -5,7 +5,7 @@ import GithubObject
|
||||
##########
|
||||
import NamedUser
|
||||
|
||||
class CommitComment( GithubObject.CompletableGithubObject ):
|
||||
class CommitComment( GithubObject.GithubObject ):
|
||||
@property
|
||||
def body( self ):
|
||||
self._completeIfNeeded( self._body )
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
import GithubObject
|
||||
|
||||
class CommitFile( GithubObject.GithubObject ):
|
||||
class CommitFile( GithubObject.BasicGithubObject ):
|
||||
@property
|
||||
def additions( self ):
|
||||
return self._additions
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
import GithubObject
|
||||
|
||||
class CommitStats( GithubObject.GithubObject ):
|
||||
class CommitStats( GithubObject.BasicGithubObject ):
|
||||
@property
|
||||
def additions( self ):
|
||||
return self._additions
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
import GithubObject
|
||||
|
||||
class Download( GithubObject.CompletableGithubObject ):
|
||||
class Download( GithubObject.GithubObject ):
|
||||
@property
|
||||
def accesskeyid( self ):
|
||||
self._completeIfNeeded( self._accesskeyid )
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@ import Organization
|
||||
import Repository
|
||||
import NamedUser
|
||||
|
||||
class Event( GithubObject.GithubObject ):
|
||||
class Event( GithubObject.BasicGithubObject ):
|
||||
@property
|
||||
def actor( self ):
|
||||
return self._actor
|
||||
|
||||
+1
-1
@@ -10,7 +10,7 @@ import NamedUser
|
||||
import Gist
|
||||
import GistComment
|
||||
|
||||
class Gist( GithubObject.CompletableGithubObject ):
|
||||
class Gist( GithubObject.GithubObject ):
|
||||
@property
|
||||
def comments( self ):
|
||||
self._completeIfNeeded( self._comments )
|
||||
|
||||
@@ -8,26 +8,32 @@ import NamedUser
|
||||
class GistComment( GithubObject.GithubObject ):
|
||||
@property
|
||||
def body( self ):
|
||||
self._completeIfNeeded( self._body )
|
||||
return self._body
|
||||
|
||||
@property
|
||||
def created_at( self ):
|
||||
self._completeIfNeeded( self._created_at )
|
||||
return self._created_at
|
||||
|
||||
@property
|
||||
def id( self ):
|
||||
self._completeIfNeeded( self._id )
|
||||
return self._id
|
||||
|
||||
@property
|
||||
def updated_at( self ):
|
||||
self._completeIfNeeded( self._updated_at )
|
||||
return self._updated_at
|
||||
|
||||
@property
|
||||
def url( self ):
|
||||
self._completeIfNeeded( self._url )
|
||||
return self._url
|
||||
|
||||
@property
|
||||
def user( self ):
|
||||
self._completeIfNeeded( self._user )
|
||||
return self._user
|
||||
|
||||
def delete( self ):
|
||||
|
||||
@@ -9,22 +9,27 @@ import CommitStats
|
||||
class GistHistoryState( GithubObject.GithubObject ):
|
||||
@property
|
||||
def change_status( self ):
|
||||
self._completeIfNeeded( self._change_status )
|
||||
return self._change_status
|
||||
|
||||
@property
|
||||
def committed_at( self ):
|
||||
self._completeIfNeeded( self._committed_at )
|
||||
return self._committed_at
|
||||
|
||||
@property
|
||||
def url( self ):
|
||||
self._completeIfNeeded( self._url )
|
||||
return self._url
|
||||
|
||||
@property
|
||||
def user( self ):
|
||||
self._completeIfNeeded( self._user )
|
||||
return self._user
|
||||
|
||||
@property
|
||||
def version( self ):
|
||||
self._completeIfNeeded( self._version )
|
||||
return self._version
|
||||
|
||||
def _initAttributes( self ):
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
import GithubObject
|
||||
|
||||
class GitAuthor( GithubObject.GithubObject ):
|
||||
class GitAuthor( GithubObject.BasicGithubObject ):
|
||||
@property
|
||||
def date( self ):
|
||||
return self._date
|
||||
|
||||
@@ -6,22 +6,27 @@ import GithubObject
|
||||
class GitBlob( GithubObject.GithubObject ):
|
||||
@property
|
||||
def content( self ):
|
||||
self._completeIfNeeded( self._content )
|
||||
return self._content
|
||||
|
||||
@property
|
||||
def encoding( self ):
|
||||
self._completeIfNeeded( self._encoding )
|
||||
return self._encoding
|
||||
|
||||
@property
|
||||
def sha( self ):
|
||||
self._completeIfNeeded( self._sha )
|
||||
return self._sha
|
||||
|
||||
@property
|
||||
def size( self ):
|
||||
self._completeIfNeeded( self._size )
|
||||
return self._size
|
||||
|
||||
@property
|
||||
def url( self ):
|
||||
self._completeIfNeeded( self._url )
|
||||
return self._url
|
||||
|
||||
def _initAttributes( self ):
|
||||
|
||||
@@ -10,30 +10,37 @@ import GitTree
|
||||
class GitCommit( GithubObject.GithubObject ):
|
||||
@property
|
||||
def author( self ):
|
||||
self._completeIfNeeded( self._author )
|
||||
return self._author
|
||||
|
||||
@property
|
||||
def committer( self ):
|
||||
self._completeIfNeeded( self._committer )
|
||||
return self._committer
|
||||
|
||||
@property
|
||||
def message( self ):
|
||||
self._completeIfNeeded( self._message )
|
||||
return self._message
|
||||
|
||||
@property
|
||||
def parents( self ):
|
||||
self._completeIfNeeded( self._parents )
|
||||
return self._parents
|
||||
|
||||
@property
|
||||
def sha( self ):
|
||||
self._completeIfNeeded( self._sha )
|
||||
return self._sha
|
||||
|
||||
@property
|
||||
def tree( self ):
|
||||
self._completeIfNeeded( self._tree )
|
||||
return self._tree
|
||||
|
||||
@property
|
||||
def url( self ):
|
||||
self._completeIfNeeded( self._url )
|
||||
return self._url
|
||||
|
||||
def _initAttributes( self ):
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
import GithubObject
|
||||
|
||||
class GitObject( GithubObject.GithubObject ):
|
||||
class GitObject( GithubObject.BasicGithubObject ):
|
||||
@property
|
||||
def sha( self ):
|
||||
return self._sha
|
||||
|
||||
@@ -9,14 +9,17 @@ import GitObject
|
||||
class GitRef( GithubObject.GithubObject ):
|
||||
@property
|
||||
def object( self ):
|
||||
self._completeIfNeeded( self._object )
|
||||
return self._object
|
||||
|
||||
@property
|
||||
def ref( self ):
|
||||
self._completeIfNeeded( self._ref )
|
||||
return self._ref
|
||||
|
||||
@property
|
||||
def url( self ):
|
||||
self._completeIfNeeded( self._url )
|
||||
return self._url
|
||||
|
||||
def delete( self ):
|
||||
|
||||
@@ -9,26 +9,32 @@ import GitObject
|
||||
class GitTag( GithubObject.GithubObject ):
|
||||
@property
|
||||
def message( self ):
|
||||
self._completeIfNeeded( self._message )
|
||||
return self._message
|
||||
|
||||
@property
|
||||
def object( self ):
|
||||
self._completeIfNeeded( self._object )
|
||||
return self._object
|
||||
|
||||
@property
|
||||
def sha( self ):
|
||||
self._completeIfNeeded( self._sha )
|
||||
return self._sha
|
||||
|
||||
@property
|
||||
def tag( self ):
|
||||
self._completeIfNeeded( self._tag )
|
||||
return self._tag
|
||||
|
||||
@property
|
||||
def tagger( self ):
|
||||
self._completeIfNeeded( self._tagger )
|
||||
return self._tagger
|
||||
|
||||
@property
|
||||
def url( self ):
|
||||
self._completeIfNeeded( self._url )
|
||||
return self._url
|
||||
|
||||
def _initAttributes( self ):
|
||||
|
||||
@@ -8,14 +8,17 @@ import GitTreeElement
|
||||
class GitTree( GithubObject.GithubObject ):
|
||||
@property
|
||||
def sha( self ):
|
||||
self._completeIfNeeded( self._sha )
|
||||
return self._sha
|
||||
|
||||
@property
|
||||
def tree( self ):
|
||||
self._completeIfNeeded( self._tree )
|
||||
return self._tree
|
||||
|
||||
@property
|
||||
def url( self ):
|
||||
self._completeIfNeeded( self._url )
|
||||
return self._url
|
||||
|
||||
def _initAttributes( self ):
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
import GithubObject
|
||||
|
||||
class GitTreeElement( GithubObject.GithubObject ):
|
||||
class GitTreeElement( GithubObject.BasicGithubObject ):
|
||||
@property
|
||||
def mode( self ):
|
||||
return self._mode
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import GithubException
|
||||
|
||||
class GithubObject( object ):
|
||||
class BasicGithubObject( object ):
|
||||
def __init__( self, requester, attributes, completed ): ### 'completed' may be removed if I find a way
|
||||
self._requester = requester
|
||||
self._initAttributes()
|
||||
@@ -16,9 +16,9 @@ class GithubObject( object ):
|
||||
if status >= 400: # pragma no branch
|
||||
raise GithubException.GithubException( status, data ) # pragma no cover
|
||||
|
||||
class CompletableGithubObject( GithubObject ):
|
||||
class GithubObject( BasicGithubObject ):
|
||||
def __init__( self, requester, attributes, completed ):
|
||||
GithubObject.__init__( self, requester, attributes, completed )
|
||||
BasicGithubObject.__init__( self, requester, attributes, completed )
|
||||
self.__completed = completed
|
||||
|
||||
def _completeIfNeeded( self, testedAttribute ):
|
||||
|
||||
@@ -9,38 +9,47 @@ import HookResponse
|
||||
class Hook( GithubObject.GithubObject ):
|
||||
@property
|
||||
def active( self ):
|
||||
self._completeIfNeeded( self._active )
|
||||
return self._active
|
||||
|
||||
@property
|
||||
def config( self ):
|
||||
self._completeIfNeeded( self._config )
|
||||
return self._config
|
||||
|
||||
@property
|
||||
def created_at( self ):
|
||||
self._completeIfNeeded( self._created_at )
|
||||
return self._created_at
|
||||
|
||||
@property
|
||||
def events( self ):
|
||||
self._completeIfNeeded( self._events )
|
||||
return self._events
|
||||
|
||||
@property
|
||||
def id( self ):
|
||||
self._completeIfNeeded( self._id )
|
||||
return self._id
|
||||
|
||||
@property
|
||||
def last_response( self ):
|
||||
self._completeIfNeeded( self._last_response )
|
||||
return self._last_response
|
||||
|
||||
@property
|
||||
def name( self ):
|
||||
self._completeIfNeeded( self._name )
|
||||
return self._name
|
||||
|
||||
@property
|
||||
def updated_at( self ):
|
||||
self._completeIfNeeded( self._updated_at )
|
||||
return self._updated_at
|
||||
|
||||
@property
|
||||
def url( self ):
|
||||
self._completeIfNeeded( self._url )
|
||||
return self._url
|
||||
|
||||
def delete( self ):
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
import GithubObject
|
||||
|
||||
class HookResponse( GithubObject.GithubObject ):
|
||||
class HookResponse( GithubObject.BasicGithubObject ):
|
||||
@property
|
||||
def code( self ):
|
||||
return self._code
|
||||
|
||||
+1
-1
@@ -13,7 +13,7 @@ import Milestone
|
||||
import IssueComment
|
||||
import IssuePullRequest
|
||||
|
||||
class Issue( GithubObject.CompletableGithubObject ):
|
||||
class Issue( GithubObject.GithubObject ):
|
||||
@property
|
||||
def assignee( self ):
|
||||
self._completeIfNeeded( self._assignee )
|
||||
|
||||
@@ -8,26 +8,32 @@ import NamedUser
|
||||
class IssueComment( GithubObject.GithubObject ):
|
||||
@property
|
||||
def body( self ):
|
||||
self._completeIfNeeded( self._body )
|
||||
return self._body
|
||||
|
||||
@property
|
||||
def created_at( self ):
|
||||
self._completeIfNeeded( self._created_at )
|
||||
return self._created_at
|
||||
|
||||
@property
|
||||
def id( self ):
|
||||
self._completeIfNeeded( self._id )
|
||||
return self._id
|
||||
|
||||
@property
|
||||
def updated_at( self ):
|
||||
self._completeIfNeeded( self._updated_at )
|
||||
return self._updated_at
|
||||
|
||||
@property
|
||||
def url( self ):
|
||||
self._completeIfNeeded( self._url )
|
||||
return self._url
|
||||
|
||||
@property
|
||||
def user( self ):
|
||||
self._completeIfNeeded( self._user )
|
||||
return self._user
|
||||
|
||||
def delete( self ):
|
||||
|
||||
@@ -6,7 +6,7 @@ import GithubObject
|
||||
import Issue
|
||||
import NamedUser
|
||||
|
||||
class IssueEvent( GithubObject.CompletableGithubObject ):
|
||||
class IssueEvent( GithubObject.GithubObject ):
|
||||
@property
|
||||
def actor( self ):
|
||||
self._completeIfNeeded( self._actor )
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
import GithubObject
|
||||
|
||||
class IssuePullRequest( GithubObject.GithubObject ):
|
||||
class IssuePullRequest( GithubObject.BasicGithubObject ):
|
||||
@property
|
||||
def diff_url( self ):
|
||||
return self._diff_url
|
||||
|
||||
@@ -8,14 +8,17 @@ import GithubObject
|
||||
class Label( GithubObject.GithubObject ):
|
||||
@property
|
||||
def color( self ):
|
||||
self._completeIfNeeded( self._color )
|
||||
return self._color
|
||||
|
||||
@property
|
||||
def name( self ):
|
||||
self._completeIfNeeded( self._name )
|
||||
return self._name
|
||||
|
||||
@property
|
||||
def url( self ):
|
||||
self._completeIfNeeded( self._url )
|
||||
return self._url
|
||||
|
||||
def delete( self ):
|
||||
|
||||
@@ -11,46 +11,57 @@ import Label
|
||||
class Milestone( GithubObject.GithubObject ):
|
||||
@property
|
||||
def closed_issues( self ):
|
||||
self._completeIfNeeded( self._closed_issues )
|
||||
return self._closed_issues
|
||||
|
||||
@property
|
||||
def created_at( self ):
|
||||
self._completeIfNeeded( self._created_at )
|
||||
return self._created_at
|
||||
|
||||
@property
|
||||
def creator( self ):
|
||||
self._completeIfNeeded( self._creator )
|
||||
return self._creator
|
||||
|
||||
@property
|
||||
def description( self ):
|
||||
self._completeIfNeeded( self._description )
|
||||
return self._description
|
||||
|
||||
@property
|
||||
def due_on( self ):
|
||||
self._completeIfNeeded( self._due_on )
|
||||
return self._due_on
|
||||
|
||||
@property
|
||||
def id( self ):
|
||||
self._completeIfNeeded( self._id )
|
||||
return self._id
|
||||
|
||||
@property
|
||||
def number( self ):
|
||||
self._completeIfNeeded( self._number )
|
||||
return self._number
|
||||
|
||||
@property
|
||||
def open_issues( self ):
|
||||
self._completeIfNeeded( self._open_issues )
|
||||
return self._open_issues
|
||||
|
||||
@property
|
||||
def state( self ):
|
||||
self._completeIfNeeded( self._state )
|
||||
return self._state
|
||||
|
||||
@property
|
||||
def title( self ):
|
||||
self._completeIfNeeded( self._title )
|
||||
return self._title
|
||||
|
||||
@property
|
||||
def url( self ):
|
||||
self._completeIfNeeded( self._url )
|
||||
return self._url
|
||||
|
||||
def delete( self ):
|
||||
|
||||
@@ -12,7 +12,7 @@ import Plan
|
||||
import Organization
|
||||
import Event
|
||||
|
||||
class NamedUser( GithubObject.CompletableGithubObject ):
|
||||
class NamedUser( GithubObject.GithubObject ):
|
||||
@property
|
||||
def avatar_url( self ):
|
||||
self._completeIfNeeded( self._avatar_url )
|
||||
|
||||
@@ -11,7 +11,7 @@ import Event
|
||||
import Repository
|
||||
import NamedUser
|
||||
|
||||
class Organization( GithubObject.CompletableGithubObject ):
|
||||
class Organization( GithubObject.GithubObject ):
|
||||
@property
|
||||
def avatar_url( self ):
|
||||
self._completeIfNeeded( self._avatar_url )
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
import GithubObject
|
||||
|
||||
class Permissions( GithubObject.GithubObject ):
|
||||
class Permissions( GithubObject.BasicGithubObject ):
|
||||
@property
|
||||
def admin( self ):
|
||||
return self._admin
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
|
||||
import GithubObject
|
||||
|
||||
class Plan( GithubObject.GithubObject ):
|
||||
class Plan( GithubObject.BasicGithubObject ):
|
||||
@property
|
||||
def collaborators( self ):
|
||||
return self._collaborators
|
||||
|
||||
@@ -11,7 +11,7 @@ import PullRequestMergeStatus
|
||||
import PullRequestComment
|
||||
import PullRequestFile
|
||||
|
||||
class PullRequest( GithubObject.CompletableGithubObject ):
|
||||
class PullRequest( GithubObject.GithubObject ):
|
||||
@property
|
||||
def additions( self ):
|
||||
self._completeIfNeeded( self._additions )
|
||||
|
||||
@@ -5,7 +5,7 @@ import GithubObject
|
||||
##########
|
||||
import NamedUser
|
||||
|
||||
class PullRequestComment( GithubObject.CompletableGithubObject ):
|
||||
class PullRequestComment( GithubObject.GithubObject ):
|
||||
@property
|
||||
def body( self ):
|
||||
self._completeIfNeeded( self._body )
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
import GithubObject
|
||||
|
||||
class PullRequestFile( GithubObject.GithubObject ):
|
||||
class PullRequestFile( GithubObject.BasicGithubObject ):
|
||||
@property
|
||||
def additions( self ):
|
||||
return self._additions
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
import GithubObject
|
||||
|
||||
class PullRequestMergeStatus( GithubObject.GithubObject ):
|
||||
class PullRequestMergeStatus( GithubObject.BasicGithubObject ):
|
||||
@property
|
||||
def merged( self ):
|
||||
return self._merged
|
||||
|
||||
@@ -31,7 +31,7 @@ import GitTag
|
||||
import Download
|
||||
import Event
|
||||
|
||||
class Repository( GithubObject.CompletableGithubObject ):
|
||||
class Repository( GithubObject.GithubObject ):
|
||||
@property
|
||||
def clone_url( self ):
|
||||
self._completeIfNeeded( self._clone_url )
|
||||
|
||||
@@ -15,22 +15,27 @@ class RepositoryKey( GithubObject.GithubObject ):
|
||||
|
||||
@property
|
||||
def id( self ):
|
||||
self._completeIfNeeded( self._id )
|
||||
return self._id
|
||||
|
||||
@property
|
||||
def key( self ):
|
||||
self._completeIfNeeded( self._key )
|
||||
return self._key
|
||||
|
||||
@property
|
||||
def title( self ):
|
||||
self._completeIfNeeded( self._title )
|
||||
return self._title
|
||||
|
||||
@property
|
||||
def url( self ):
|
||||
self._completeIfNeeded( self._url )
|
||||
return self._url
|
||||
|
||||
@property
|
||||
def verified( self ):
|
||||
self._completeIfNeeded( self._verified )
|
||||
return self._verified
|
||||
|
||||
def delete( self ):
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@ import GithubObject
|
||||
##########
|
||||
import Commit
|
||||
|
||||
class Tag( GithubObject.GithubObject ):
|
||||
class Tag( GithubObject.BasicGithubObject ):
|
||||
@property
|
||||
def commit( self ):
|
||||
return self._commit
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@ from DefaultValueForOptionalParameters import DefaultValueForOptionalParameters
|
||||
import Repository
|
||||
import NamedUser
|
||||
|
||||
class Team( GithubObject.CompletableGithubObject ):
|
||||
class Team( GithubObject.GithubObject ):
|
||||
@property
|
||||
def id( self ):
|
||||
self._completeIfNeeded( self._id )
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
import GithubObject
|
||||
from DefaultValueForOptionalParameters import DefaultValueForOptionalParameters
|
||||
|
||||
class UserKey( GithubObject.CompletableGithubObject ):
|
||||
class UserKey( GithubObject.GithubObject ):
|
||||
@property
|
||||
def id( self ):
|
||||
self._completeIfNeeded( self._id )
|
||||
|
||||
Reference in New Issue
Block a user