Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
09a5d57
Add support for displaying files from snekbox
ionite34 Nov 16, 2022
499336b
Implement full FileAttachment parsing
ionite34 Nov 21, 2022
34f40e5
Change EvalJob str to repr
ionite34 Nov 21, 2022
6459d43
Refactor encoding parsing
ionite34 Nov 21, 2022
f6139c6
Update unit tests
ionite34 Nov 21, 2022
4932999
Refactor API for snekbox updates
ionite34 Nov 24, 2022
c7d6d05
Update unit test
ionite34 Nov 24, 2022
51e7e17
Refactors for EvalResult and EvalJob dataclasses
ionite34 Nov 29, 2022
7711e2d
Update unit tests for snekbox
ionite34 Nov 29, 2022
44f8863
Merge branch 'main' into snekbox-files
ionite34 Nov 30, 2022
5eba530
Reorder imports
ionite34 Nov 30, 2022
41d2628
Fix send_job return type
ionite34 Dec 1, 2022
bf53273
Fix test_post_job unit test
ionite34 Dec 14, 2022
def2dd6
Revert typo
ionite34 Dec 14, 2022
6272289
Update bot/exts/utils/snekbox.py
ionite34 Dec 14, 2022
7deda34
Suppress HTTPException for redo emoji
ionite34 Dec 14, 2022
7c31368
Merge branch 'snekbox-files' of https://github.com/python-discord/bot…
ionite34 Dec 14, 2022
daf92c6
Update file size limit comment
ionite34 Dec 14, 2022
e248e9e
Update function name `get_message`
ionite34 Dec 14, 2022
a1d1926
Update test_post_job to use 3.10 snekbox
ionite34 Dec 14, 2022
a7d4875
Update `prepare_timeit_input` docstring
ionite34 Dec 14, 2022
318d67d
Merge branch 'main' into snekbox-files
ionite34 Dec 14, 2022
727a146
Refactor to move snekbox to module
ionite34 Dec 14, 2022
5666482
Rename attribute `failed_files`
ionite34 Dec 14, 2022
d005844
Add FILE_COUNT_LIMIT and error messages
ionite34 Dec 14, 2022
a577e48
sizeof_fmt uses 0 d.p. for integrals
ionite34 Dec 17, 2022
fc785d1
Split get_message errors to other properties
ionite34 Dec 17, 2022
75d1fde
Update unit tests for EvalResult message change
ionite34 Dec 17, 2022
9ab03ad
Revert newline format for msg
ionite34 Dec 17, 2022
a82c15d
Add unit test for files_error_message
ionite34 Dec 17, 2022
d2de465
Add unit tests for EvalResult.files_error_str
ionite34 Dec 17, 2022
d7722b3
Rename method get_failed_files_str
ionite34 Dec 20, 2022
48cf627
Add markdown mention escape for file error str
ionite34 Dec 20, 2022
2aaf161
Add discord file name normalization
ionite34 Dec 20, 2022
d75d465
Improve RE_ANSI match cases
ionite34 Dec 20, 2022
7affd48
Refactor snekbox tests to module
ionite34 Dec 20, 2022
b04143c
Add normalize file name tests
ionite34 Dec 20, 2022
2b4c85e
Change failed files str to truncate on chars only
ionite34 Dec 20, 2022
bebd241
Add file extension filtering
ionite34 Feb 7, 2023
5d6b042
Add disallowed file extensions tests
ionite34 Feb 7, 2023
3d5fa6c
Change wording for failed attachments, use `:failmail:` emoji
ionite34 Feb 7, 2023
8101659
Fix unit tests for new failmail emoji
ionite34 Feb 7, 2023
8f2b323
Add skip condition for windows not able to test path escapes
ionite34 Feb 7, 2023
3a4a6a5
Update file error messages
ionite34 Feb 8, 2023
a59eaf4
Update unit tests for file error message changes
ionite34 Feb 8, 2023
455c6b8
Hide no output on any file upload
ionite34 Feb 9, 2023
a8c3330
Add and update eval to use new `failed_file` emoji
ionite34 Feb 9, 2023
adbb011
Add `failed_file` emoji to config
ionite34 Feb 9, 2023
13eb7c4
Made EvalJob and FileAttachment dataclasses frozen
ionite34 Feb 12, 2023
48b0f7d
Simplify file name truncation
ionite34 Feb 12, 2023
51b719e
Merge branch 'snekbox-files' of https://github.com/python-discord/bot…
ionite34 Feb 12, 2023
5bbb49c
Fix indentation
ionite34 Feb 12, 2023
d481e35
Fix identation
ionite34 Feb 12, 2023
70d3d3c
Move files error message call
ionite34 Feb 12, 2023
bc7a3fb
Move allowed_mentions and view definitions
ionite34 Feb 12, 2023
fa2cd5c
Add `has_output` and `has_files` for EvalResult
ionite34 Feb 14, 2023
540ed9c
Fix typing
ionite34 Feb 18, 2023
84ac06d
Introduce variable for max output lines and chars
ionite34 Feb 18, 2023
07ba337
Add name property for FileAttachment
ionite34 Feb 18, 2023
8183294
Text file upload to paste service / in-line display
ionite34 Feb 18, 2023
3438ac3
Fix empty files format when only new lines
ionite34 Feb 18, 2023
dc7653b
Refactor format_output to have `output_default` as str
ionite34 Feb 22, 2023
a6726c5
Fix file text count comparison
ionite34 Feb 22, 2023
7e7f7c3
Fix budget lines comparison
ionite34 Feb 22, 2023
4fed441
Update budget lines and chars for text to be shared with stdout
ionite34 Feb 22, 2023
d29e8c6
Use PurePosixPath so tests work on windows
ionite34 Feb 22, 2023
3d19133
Fix and simplify logic for optional line numbering
ionite34 Feb 24, 2023
0743f89
Restore implicit no line nums when 0 lines behavior
ionite34 Feb 24, 2023
618471c
Add docstring info on file system support for eval
ionite34 Feb 24, 2023
232836f
Merge branch 'main' into snekbox-files
ionite34 Mar 9, 2023
1ccf515
Merge branch 'main' into snekbox-files
ionite34 Mar 9, 2023
8b8647c
Merge branch 'main' into snekbox-files
ionite34 Mar 9, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions bot/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -584,6 +584,7 @@ class _Emojis(EnvConfig):
defcon_update = "<:defconsettingsupdated:470326274082996224>" # noqa: E704

failmail = "<:failmail:633660039931887616>"
failed_file = "<:failed_file:1073298441968562226>"

incident_actioned = "<:incident_actioned:714221559279255583>"
incident_investigating = "<:incident_investigating:714224190928191551>"
Expand Down
12 changes: 12 additions & 0 deletions bot/exts/utils/snekbox/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
from bot.bot import Bot
from bot.exts.utils.snekbox._cog import CodeblockConverter, Snekbox
from bot.exts.utils.snekbox._eval import EvalJob, EvalResult

__all__ = ("CodeblockConverter", "Snekbox", "EvalJob", "EvalResult")


async def setup(bot: Bot) -> None:
"""Load the Snekbox cog."""
# Defer import to reduce side effects from importing the codeblock package.
from bot.exts.utils.snekbox._cog import Snekbox
await bot.add_cog(Snekbox(bot))
Loading