Skip to content

Commit 6c98efe

Browse files
committed
Rename modules to prevent pollution of namespace.
Part of the problem with testing this has been that in the API there are functions like user() or gist() which prevent me from being able to import from github3.gist or github3.user the class(es) I need to make sure the right objects are being returned. Changing the module names allows for no ambiguity and (ideally) no clashes in names. This also means I can clean up __init__.py which was becoming awfully cluttered.
1 parent 832d19b commit 6c98efe

9 files changed

Lines changed: 17 additions & 17 deletions

File tree

File renamed without changes.

github3/gist.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
from json import dumps
1010
from .models import GitHubObject, GitHubCore, BaseComment
11-
from .user import User
11+
from .users import User
1212

1313

1414
class GistFile(GitHubObject):

github3/git.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
from base64 import b64decode
1010
from json import dumps
1111
from .models import GitHubObject, GitHubCore, BaseCommit
12-
from .user import User
12+
from .users import User
1313

1414

1515
class Blob(GitHubObject):

github3/github.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@
88

99
from requests import session
1010
from json import dumps
11-
from .event import Event
12-
from .gist import Gist
13-
from .issue import Issue, issue_params
11+
from .events import Event
12+
from .gists import Gist
13+
from .issues import Issue, issue_params
1414
from .legacy import LegacyIssue, LegacyRepo, LegacyUser
1515
from .models import GitHubCore
16-
from .org import Organization
17-
from .repo import Repository
18-
from .user import User, Key
16+
from .orgs import Organization
17+
from .repos import Repository
18+
from .users import User, Key
1919

2020

2121
class GitHub(GitHubCore):

github3/issue.py renamed to github3/issues.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
from json import dumps
1010
from re import match
1111
from .models import GitHubCore, BaseComment
12-
from .user import User
12+
from .users import User
1313

1414

1515
class Label(GitHubCore):

github3/org.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
"""
88

99
from json import dumps
10-
from .event import Event
10+
from .events import Event
1111
from .models import BaseAccount, GitHubCore
12-
from .repo import Repository
13-
from .user import User
12+
from .repos import Repository
13+
from .users import User
1414

1515

1616
class Team(GitHubCore):

github3/pulls.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
from json import dumps
1010
from .git import Commit
1111
from .models import GitHubObject, GitHubCore, BaseComment
12-
from .user import User
12+
from .users import User
1313

1414

1515
class PullDestination(GitHubCore):

github3/repo.py renamed to github3/repos.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@
88

99
from base64 import b64decode
1010
from json import dumps
11-
from .event import Event
12-
from .issue import Issue, Label, Milestone, issue_params
11+
from .events import Event
12+
from .issues import Issue, Label, Milestone, issue_params
1313
from .git import Blob, Commit, Reference, Tag, Tree
1414
from .models import GitHubObject, GitHubCore, BaseComment, BaseCommit
1515
from .pulls import PullRequest
16-
from .user import User, Key
16+
from .users import User, Key
1717

1818

1919
class Repository(GitHubCore):

github3/user.py renamed to github3/users.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"""
88

99
from json import dumps
10-
from .event import Event
10+
from .events import Event
1111
from .models import GitHubObject, GitHubCore, BaseAccount
1212

1313

0 commit comments

Comments
 (0)