-
Notifications
You must be signed in to change notification settings - Fork 12
Refactor membership queries #605
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
41 commits
Select commit
Hold shift + click to select a range
cc35a2b
Refactor membership checking
MattyTheHacker 0917ae5
Refactor and Reformat
MattyTheHacker 2270e9c
Fix import error
MattyTheHacker fdda120
Bit of a mess
MattyTheHacker 1ed9d9f
Formatting
MattyTheHacker 797f94d
Fix
MattyTheHacker 2ac933d
Reformat
MattyTheHacker 74e57a6
Revert accidental change
MattyTheHacker fc6c1aa
Revert
MattyTheHacker f324842
Add logging
MattyTheHacker 00a7121
Simplify logic
MattyTheHacker e548fd1
Fixes
MattyTheHacker 93f601d
Merge main into member-query-refactor
automatic-pr-updater[bot] 88ded71
Merge main into member-query-refactor
automatic-pr-updater[bot] 2657358
Fixes
MattyTheHacker a6d1735
Docs
MattyTheHacker 4835d1c
Merge main into member-query-refactor
automatic-pr-updater[bot] 7b31100
Merge main into member-query-refactor
automatic-pr-updater[bot] 5b4ebd6
Merge main into member-query-refactor
automatic-pr-updater[bot] f9209c7
Merge main into member-query-refactor
automatic-pr-updater[bot] 6f7c436
do some stuff
MattyTheHacker 01c9e14
[pre-commit.ci lite] apply automatic fixes
pre-commit-ci-lite[bot] 3777f72
Merge main into member-query-refactor
automatic-pr-updater[bot] 3eb3e0f
Merge main into member-query-refactor
automatic-pr-updater[bot] 6c43a5e
Merge main into member-query-refactor
automatic-pr-updater[bot] 72c9876
Implement custom exception
MattyTheHacker b0f165a
Use the new exception
MattyTheHacker 2df510a
Refactor
MattyTheHacker 10d7f27
Merge branch 'main' into member-query-refactor
MattyTheHacker b5b4a39
Merge main into member-query-refactor
automatic-pr-updater[bot] a803f3d
Merge main into member-query-refactor
automatic-pr-updater[bot] 8dde2bc
Merge main into member-query-refactor
automatic-pr-updater[bot] 62f63c4
Merge main into member-query-refactor
automatic-pr-updater[bot] c241a2a
Merge main into member-query-refactor
automatic-pr-updater[bot] 2308273
Fixes from review
MattyTheHacker 07f8b8e
Fix spaces
MattyTheHacker 0e530ba
Move logger up
MattyTheHacker 01490c9
yeet args
MattyTheHacker ca2f66c
Fix regex check
MattyTheHacker a3673e4
[pre-commit.ci lite] apply automatic fixes
pre-commit-ci-lite[bot] bfc561f
review fixes
MattyTheHacker File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
MattyTheHacker marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
"""Custom exception classes raised when errors occur during use of MSL features.""" | ||
|
||
from typing import TYPE_CHECKING, override | ||
|
||
from typed_classproperties import classproperty | ||
|
||
from .base import BaseTeXBotError | ||
|
||
if TYPE_CHECKING: | ||
from collections.abc import Sequence | ||
|
||
|
||
__all__: "Sequence[str]" = ("MSLMembershipError",) | ||
|
||
|
||
class MSLMembershipError(BaseTeXBotError, RuntimeError): | ||
""" | ||
Exception class to raise when any error occurs while checking MSL membership. | ||
|
||
If this error occurs, it is likely that MSL features will not work correctly. | ||
""" | ||
|
||
@classproperty | ||
@override | ||
def DEFAULT_MESSAGE(cls) -> str: | ||
return "An error occurred while trying to fetch membership data from MSL." |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
"""MSL utility classes & functions provided for use across the whole of the project.""" | ||
|
||
from typing import TYPE_CHECKING | ||
|
||
from .memberships import ( | ||
fetch_community_group_members_count, | ||
fetch_community_group_members_list, | ||
is_id_a_community_group_member, | ||
) | ||
|
||
if TYPE_CHECKING: | ||
from collections.abc import Sequence | ||
|
||
__all__: "Sequence[str]" = ( | ||
"fetch_community_group_members_count", | ||
"fetch_community_group_members_list", | ||
"is_id_a_community_group_member", | ||
) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.