Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
DorianAarno committed Jul 8, 2024
1 parent 589dfcc commit 2f392e4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 60 deletions.
59 changes: 1 addition & 58 deletions Paginator/Paginate.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class CreatePaginator(ui.View):
def __init__(self, embeds, author_id: int = None, timeout: float = None):

super().__init__(
timeout=None
timeout=timeout
)
self.embeds = embeds
self.author_id = author_id
Expand All @@ -87,60 +87,3 @@ def __init__(self, embeds, author_id: int = None, timeout: float = None):
disabled = True
self.add_item(PreviousButton(True))
self.add_item(NextButton(disabled))

# class CreatePaginator(ui.View):
# """
# Paginator for Embeds.
# Parameters:
# ----------
# embeds: List[Embed]
# List of embeds which are in the Paginator. Paginator starts from first embed.
# author: int
# The ID of the author who can interact with the buttons. Anyone can interact with the Paginator Buttons if not specified.
# timeout: float
# How long the Paginator should timeout in, after the last interaction.

# """
# def __init__(self, embeds: list, author: int | None = None, timeout: float | None = None):
# if not timeout:
# super().__init__()
# else:
# super().__init__(timeout=timeout)
# self.embeds = embeds
# self.author = author
# self.CurrentEmbed = 0



# @ui.button(emoji="⬅️", style=ButtonStyle.grey)
# async def previous(self, button, inter):
# if not inter.response.is_done():
# await inter.response.defer(ephemeral=True)
# try:
# if inter.author.id != self.author and self.author:
# return await inter.followup.send("You cannot interact with these buttons.", ephemeral=True)

# if self.CurrentEmbed:
# await inter.followup.edit_message(embed=self.embeds[self.CurrentEmbed-1])
# self.CurrentEmbed -= 1
# else:
# raise ValueError("No previous embed available")

# except Exception as e:
# self.logger.error(f"Error in Paginator 'previous': {e}")
# await inter.followup.send('Unable to change the page.', ephemeral=True)

# @ui.button(emoji="➡️", style=ButtonStyle.grey)
# async def next(self, button, inter):
# if not inter.response.is_done():
# await inter.response.defer(ephemeral=True)
# try:
# if inter.author.id != self.author and self.author != 123:
# return await inter.followup.send("You cannot interact with these buttons.", ephemeral=True)

# await inter.followup.edit_message(embed=self.embeds[self.CurrentEmbed+1])
# self.CurrentEmbed += 1

# except Exception as e:
# self.logger.error(f"Error in Paginator 'next': {e}")
# await inter.followup.send('Unable to change the page.', ephemeral=True)
5 changes: 3 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,23 @@

setup(
name="disnake-pagination",
version="2.0",
version="2.1",
description="A simple Embed Paginator for your projects made with disnake.",
long_description=long_description,
long_description_content_type='text/markdown',
packages=['Paginator'],
url="https://github.com/DorianAarno/Paginator",
author="Aarno Dorian",
author_email="aarnodorian56@gmail.com",
download_url = "https://github.com/DorianAarno/Paginator/archive/refs/tags/v1.0.tar.gz",
download_url = "https://github.com/DorianAarno/Paginator/archive/refs/tags/v2.1.tar.gz",
license = "MIT",
classifiers=[
'Intended Audience :: Developers',
'Natural Language :: English',
'Operating System :: OS Independent',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Topic :: Internet',
'Topic :: Software Development :: Libraries',
'Topic :: Software Development :: Libraries :: Python Modules',
Expand Down

0 comments on commit 2f392e4

Please sign in to comment.