mirror of
https://github.com/status-im/PyGithub.git
synced 2026-08-31 19:01:15 +00:00
Restore RateLimit.rate attribute, raise deprecation warning instead
This commit is contained in:
+20
-3
@@ -30,6 +30,8 @@
|
||||
import github.GithubObject
|
||||
import github.Rate
|
||||
|
||||
from deprecated import deprecated
|
||||
|
||||
|
||||
class RateLimit(github.GithubObject.NonCompletableGithubObject):
|
||||
"""
|
||||
@@ -39,10 +41,25 @@ class RateLimit(github.GithubObject.NonCompletableGithubObject):
|
||||
def __repr__(self):
|
||||
return self.get__repr__({"core": self._core.value})
|
||||
|
||||
@property
|
||||
@deprecated(reason="""
|
||||
The rate object is deprecated. If you're writing new API client code
|
||||
or updating existing code, you should use the core object instead of
|
||||
the rate object. The core object contains the same information that
|
||||
is present in the rate object.
|
||||
""")
|
||||
def rate(self):
|
||||
"""
|
||||
(Deprecated) Rate limit for non-search-related API, use `core` instead
|
||||
|
||||
:type: class:`github.Rate.Rate`
|
||||
"""
|
||||
return self._core.value
|
||||
|
||||
@property
|
||||
def core(self):
|
||||
"""
|
||||
Rate limit for rest of the API.
|
||||
Rate limit for the non-search-related API
|
||||
|
||||
:type: class:`github.Rate.Rate`
|
||||
"""
|
||||
@@ -51,7 +68,7 @@ class RateLimit(github.GithubObject.NonCompletableGithubObject):
|
||||
@property
|
||||
def search(self):
|
||||
"""
|
||||
Rate limit for Search API.
|
||||
Rate limit for the Search API.
|
||||
|
||||
:type: class:`github.Rate.Rate`
|
||||
"""
|
||||
@@ -60,7 +77,7 @@ class RateLimit(github.GithubObject.NonCompletableGithubObject):
|
||||
@property
|
||||
def graphql(self):
|
||||
"""
|
||||
Experimental rate limit for GraphQL, use with caution.
|
||||
(Experimental) Rate limit for GraphQL API, use with caution.
|
||||
|
||||
:type: class:`github.Rate.Rate`
|
||||
"""
|
||||
|
||||
+2
-1
@@ -1,4 +1,5 @@
|
||||
requests>=2.14.0
|
||||
pyjwt
|
||||
sphinx<1.8
|
||||
sphinx-rtd-theme<0.5
|
||||
sphinx-rtd-theme<0.5
|
||||
Deprecated
|
||||
Reference in New Issue
Block a user