8000 super simple request counter · adrianmoisey/github3.py@8554ddb · GitHub
[go: up one dir, main page]

Skip to content

Commit 8554ddb

Browse files
super simple request counter
1 parent fc598a2 commit 8554ddb

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

github3/session.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ def __init__(self):
3535
})
3636
self.base_url = 'https://api.github.com'
3737
self.two_factor_auth_cb = None
38+
self.request_counter = 0
3839

3940
def basic_auth(self, username, password):
4041
"""Set the Basic Auth credentials on this Session.
@@ -85,6 +86,7 @@ def oauth2_auth(self, client_id, client_secret):
8586

8687
def request(self, *args, **kwargs):
8788
response = super(GitHubSession, self).request(*args, **kwargs)
89+
self.request_counter += 1
8890
if requires_2fa(response) and self.two_factor_auth_cb:
8991
# No need to flatten and re-collect the args in
9092
# handle_two_factor_auth

0 commit comments

Comments
 (0)
0