Skip to content

Commit afcfacc

Browse files
rename Router to GitHubRouter (#6)
1 parent 4945bbb commit afcfacc

File tree

6 files changed

+13
-13
lines changed

6 files changed

+13
-13
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,9 @@ To start handling GitHub webhooks, create your event handlers in a new file (e.g
106106
107107
```python
108108
# your_app/events.py
109-
from django_github_app.routing import Router
109+
from django_github_app.routing import GitHubRouter
110110
111-
gh = Router()
111+
gh = GitHubRouter()
112112
113113
# Handle any issue event
114114
@gh.event("issues")

src/django_github_app/events/installation.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
from django_github_app.models import Installation
77
from django_github_app.models import InstallationStatus
88
from django_github_app.models import Repository
9-
from django_github_app.routing import Router
9+
from django_github_app.routing import GitHubRouter
1010

11-
gh = Router()
11+
gh = GitHubRouter()
1212

1313

1414
@gh.event("installation", action="created")

src/django_github_app/events/repository.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
from gidgethub.abc import GitHubAPI
55

66
from django_github_app.models import Repository
7-
from django_github_app.routing import Router
7+
from django_github_app.routing import GitHubRouter
88

9-
gh = Router()
9+
gh = GitHubRouter()
1010

1111

1212
@gh.event("repository", action="renamed")

src/django_github_app/routing.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@
88
from gidgethub.routing import Router as GidgetHubRouter
99

1010

11-
class Router:
11+
class GitHubRouter:
1212
_routers: list[GidgetHubRouter] = []
1313

1414
def __init__(self) -> None:
1515
self.router = GidgetHubRouter()
16-
Router._routers.append(self.router)
16+
GitHubRouter._routers.append(self.router)
1717

1818
@classproperty
1919
def routers(cls):

src/django_github_app/views.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
from .github import SyncGitHubAPI
2424
from .models import EventLog
2525
from .models import Installation
26-
from .routing import Router
26+
from .routing import GitHubRouter
2727

2828
GitHubAPIType = TypeVar("GitHubAPIType", AsyncGitHubAPI, SyncGitHubAPI)
2929

@@ -59,7 +59,7 @@ def get_response(self, event_log: EventLog) -> JsonResponse:
5959

6060
@property
6161
def router(self) -> GidgetHubRouter:
62-
return GidgetHubRouter(*Router.routers)
62+
return GidgetHubRouter(*GitHubRouter.routers)
6363

6464
@abstractmethod
6565
def post(

tests/test_views.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
from django_github_app.github import AsyncGitHubAPI
1717
from django_github_app.github import SyncGitHubAPI
1818
from django_github_app.models import EventLog
19-
from django_github_app.routing import Router
19+
from django_github_app.routing import GitHubRouter
2020
from django_github_app.views import AsyncWebhookView
2121
from django_github_app.views import BaseWebhookView
2222
from django_github_app.views import SyncWebhookView
@@ -70,9 +70,9 @@ def _make_request(
7070

7171
@pytest.fixture
7272
def test_router():
73-
router = Router()
73+
router = GitHubRouter()
7474
yield router
75-
Router._routers.remove(router.router)
75+
GitHubRouter._routers.remove(router.router)
7676

7777

7878
class TestWebhookView(BaseWebhookView):

0 commit comments

Comments
 (0)