Skip to content

Commit ca2b08f

Browse files
committed
Update usage of login in github3.api
1 parent 2f2346e commit ca2b08f

2 files changed

Lines changed: 13 additions & 9 deletions

File tree

LATEST_VERSION_NOTES.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,9 @@ Old name New attribute name
233233
- Most instances of ``login`` as a parameter have been changed to ``username``
234234
for clarity and consistency. This affects the following methods:
235235

236+
- ``github3.authorize``
237+
- ``github3.repositories_by``
238+
- ``github3.user``
236239
- ``Organization#add_member``
237240
- ``Organization#is_member``
238241
- ``Organization#is_public_member``

github3/api.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@
1313
gh = GitHub()
1414

1515

16-
def authorize(login, password, scopes, note='', note_url='', client_id='',
16+
def authorize(username, password, scopes, note='', note_url='', client_id='',
1717
client_secret='', two_factor_callback=None):
1818
"""Obtain an authorization token for the GitHub API.
1919
20-
:param str login: (required)
20+
:param str username: (required)
2121
:param str password: (required)
2222
:param list scopes: (required), areas you want this token to apply to,
2323
i.e., 'gist', 'user'
@@ -34,7 +34,7 @@ def authorize(login, password, scopes, note='', note_url='', client_id='',
3434
"""
3535
gh = GitHub()
3636
gh.login(two_factor_callback=two_factor_callback)
37-
return gh.authorize(login, password, scopes, note, note_url, client_id,
37+
return gh.authorize(username, password, scopes, note, note_url, client_id,
3838
client_secret)
3939

4040

@@ -289,15 +289,15 @@ def organizations_with(username, number=-1, etag=None):
289289
return gh.organizations_with(username, number, etag)
290290

291291

292-
def repositories_by(login, type=None, sort=None, direction=None, number=-1,
292+
def repositories_by(username, type=None, sort=None, direction=None, number=-1,
293293
etag=None):
294-
"""List public repositories for the specified ``login``.
294+
"""List public repositories for the specified ``username``.
295295
296296
.. versionadded:: 0.6
297297
298298
.. note:: This replaces github3.iter_repos
299299
300-
:param str login: (required)
300+
:param str username: (required)
301301
:param str type: (optional), accepted values:
302302
('all', 'owner', 'member')
303303
API default: 'all'
@@ -316,7 +316,8 @@ def repositories_by(login, type=None, sort=None, direction=None, number=-1,
316316
317317
"""
318318
if login:
319-
return gh.repositories_by(login, type, sort, direction, number, etag)
319+
return gh.repositories_by(username, type, sort, direction, number,
320+
etag)
320321
return iter([])
321322

322323

@@ -633,8 +634,8 @@ def search_users(query, sort=None, order=None, per_page=None,
633634
etag)
634635

635636

636-
def user(login):
637-
return gh.user(login)
637+
def user(username):
638+
return gh.user(username)
638639
user.__doc__ = gh.user.__doc__
639640

640641

0 commit comments

Comments
 (0)