Skip to content

Commit

Permalink
Version bump and changelog for 1.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Soheab committed Nov 6, 2023
1 parent 8e30d0e commit f9e6ff1
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 2 deletions.
2 changes: 1 addition & 1 deletion discord/ext/modal_paginator/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from .core import ModalPaginator as ModalPaginator, PaginatorModal as PaginatorModal
from .custom_button import CustomButton as CustomButton

__version__ = "1.1.0a"
__version__ = "1.1.0"
__author__ = "Soheab"
__license__ = "MPL-2.0"
25 changes: 24 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,33 @@
"discord": ("https://discordpy.readthedocs.io/en/latest/", None),
}

# fmt: off
# what this basically does it shorten the commit hash to 7 characters...
# i couldn't find a better way to do this. please help me if you know how to do this better.
class FormatCommitHash: # noqa
def __new__(cls):# -> Any:
# fixes the following error:
# _pickle.PicklingError: Can't pickle <class 'FormatCommitHash'>: attribute lookup FormatCommitHash on builtins failed
# please don't ask me why this works, i don't know either. Found it here: https://stackoverflow.com/a/17329487
# yes, i moved it here so it looks better.
import __main__
setattr(__main__, cls.__name__, cls)
cls.__module__ = "__main__"
return super().__new__(cls)

def __mod__(self, spec: str) -> str:
return f"({spec[:7]})"

# fmt: on

extlinks = {
"apidocs": ("https://some-random-api.com/docs/%s", None),
"commit": ("https://github.com/Soheab/modal-paginator/commit/%s", FormatCommitHash()),
}


del FormatCommitHash


viewcode_follow_imported_members = True
autoclass_signature = "separated"
autodoc_typehints_format = "short"
Expand All @@ -91,6 +113,7 @@
autodoc_typehints = "none"
autodoc_class_signature = "separated"
typehints_use_signature = False
extlinks_detect_hardcoded_links = True

nitpicky = True
nitpick_ignore = [
Expand Down
39 changes: 39 additions & 0 deletions docs/whats_new.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,45 @@ Changelog
This page keeps a detailed human friendly rendering of what's new and changed
in specific versions.

v1.1.0
-------

Features
~~~~~~~~~

- :commit:`e13542080b9902216baa33f609531f992f53eca4` Added the ability to have the paginator automatically "finish" the paginator.
See the :attr:`.ModalPaginator.auto_finish` attribute for more
information.
- :commit:`ace7bceb6ce6b4d33a70863209b9030ed59942eb` Added a method to have the extension construct the amount of modals needed depending
on the needed :class:`~discord.ui.TextInput`\s. See :meth:`.ModalPaginator.from_text_inputs`
for more information.
- :commit:`d4111ffd5bc9c6d31acb40e8fb5e607aeea9d6c0` Added the ability to customize the "error" message that users could get when they used a button
that they weren't supposed to use (yet). This is useful for i18n purposes or to
send a friendlier message overal. See the following methods on :class:`.ModalPaginator` for more information:

* :meth:`~.ModalPaginator.get_open_button_error_message`
* :meth:`~.ModalPaginator.get_next_button_error_message`
* :meth:`~.ModalPaginator.get_previous_button_error_message`
* :meth:`~.ModalPaginator.get_finish_button_error_message`

Bug Fixes
~~~~~~~~~

- :commit:`2f032a5a6df32f1a46450a7a56ce4db425818b4a` Fix not being able to remove a "default" button using the ``buttons=`` kwarg.

Miscellaneous
~~~~~~~~~~~~~

- :commit:`228711cdc1cb9aaa6987a406f44577cb2ad23570` You no longer have to call the original implementation of :meth:`.ModalPaginator.on_finish` / :meth:`.ModalPaginator.on_cancel`
when overriding it. It's now called automatically.
- :commit:`8507c52d0ca9c0ed51980a6a19f6bc230632b643` Refactored the custom buttons implementation to work better front and-backend.
- :commit:`bc1850b2a84bf87c7a2275b752233da183a09f4e` Made it so your implementation of :meth:`.ModalPaginator.on_finish` / :meth:`.ModalPaginator.on_cancel`
is called first before the default implementation.
- :commit:`3ecfcaf7af2bf00ae9a8a53c8f3955e51a9af0d3` Fix typo in the docstring of :attr:`.ModalPaginator.message`.
- :commit:`3ecfcaf7af2bf00ae9a8a53c8f3955e51a9af0d3` Fix the example for the ``buttons`` kwarg on :class:`.ModalPaginator` in the
docstring.


v1.0.0
-------

Expand Down

0 comments on commit f9e6ff1

Please sign in to comment.