Skip to content

Commit

Permalink
3.2.2 (#3324)
Browse files Browse the repository at this point in the history
* page sizing changes

* docs
  • Loading branch information
Michael H authored Jan 10, 2020
1 parent 2bb9b87 commit deab24e
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 12 deletions.
14 changes: 14 additions & 0 deletions docs/changelog_3_2_0.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
.. 3.2.x Changelogs
Redbot 3.2.2 (2020-01-10)
=========================

Hotfixes
--------

- Fix Help Pagination issue

Docs
----

- Correct venv docs


Redbot 3.2.1 (2020-01-10)
=========================

Expand Down
6 changes: 3 additions & 3 deletions docs/venv_guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ to keep it in a location which is easy to type out the path to. From now, we'll
~~~~~~~~~~~~~~~~~~~~~~~~
Create your virtual environment with the following command::

python3.7 -m venv redenv
python3.8 -m venv redenv

And activate it with the following command::

Expand All @@ -56,7 +56,7 @@ Continue reading `below <after-activating-virtual-environment>`.
~~~~~~~~~~~~~~~~~~~
Create your virtual environment with the following command::

py -3.7 -m venv redenv
py -3.8 -m venv redenv

And activate it with the following command::

Expand All @@ -82,7 +82,7 @@ Using ``pyenv virtualenv``
Using ``pyenv virtualenv`` saves you the headache of remembering where you installed your virtual
environments. If you haven't already, install pyenv with `pyenv-installer`_.

First, ensure your pyenv interpreter is set to python 3.7.0 or greater with the following command::
First, ensure your pyenv interpreter is set to python 3.8.1 or greater with the following command::

pyenv version

Expand Down
2 changes: 1 addition & 1 deletion redbot/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ def _update_event_loop_policy():
_asyncio.set_event_loop_policy(_uvloop.EventLoopPolicy())


__version__ = "3.2.2.dev1"
__version__ = "3.2.2"
version_info = VersionInfo.from_str(__version__)

# Filter fuzzywuzzy slow sequence matcher warning
Expand Down
14 changes: 7 additions & 7 deletions redbot/core/commands/help.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ def shorten_line(a_line: str) -> str:
shorten_line(f"**{name}** {command.short_doc}")
for name, command in sorted(subcommands.items())
)
for i, page in enumerate(pagify(subtext, page_length=1000, shorten_by=0)):
for i, page in enumerate(pagify(subtext, page_length=500, shorten_by=0)):
if i == 0:
title = "**__Subcommands:__**"
else:
Expand Down Expand Up @@ -281,12 +281,12 @@ def group_embed_fields(fields: List[EmbedField], max_chars=1000):
f_len = len(f.value) + len(f.name)

# Commands start at the 1st index of fields, i < 2 is a hacky workaround for now
if not current_count or f_len + current_count > max_chars or i < 2:
if not current_count or f_len + current_count < max_chars or i < 2:
current_count += f_len
curr_group.append(f)
elif curr_group:
ret.append(curr_group)
current_count = 0
current_count = f_len
curr_group = [f]
else:
if curr_group:
Expand All @@ -299,7 +299,7 @@ async def make_and_send_embeds(self, ctx, embed_dict: dict):
pages = []

page_char_limit = await ctx.bot._config.help.page_char_limit()
page_char_limit = min(page_char_limit, 5990) # Just in case someone was manually...
page_char_limit = min(page_char_limit, 5500) # Just in case someone was manually...

author_info = {"name": f"{ctx.me.display_name} Help Menu", "icon_url": ctx.me.avatar_url}

Expand All @@ -318,13 +318,13 @@ async def make_and_send_embeds(self, ctx, embed_dict: dict):
# We could consider changing this to always just subtract the offset,
# But based on when this is being handled (very end of 3.2 release)
# I'd rather not stick a major visual behavior change in at the last moment.
if page_char_limit + offset > 5990:
if page_char_limit + offset > 5500:
# This is still neccessary with the max interaction above
# While we could subtract 100% of the time the offset from page_char_limit
# the intent here is to shorten again
# *only* when neccessary, by the exact neccessary amount
# To retain a visual match with prior behavior.
page_char_limit = 5990 - offset
page_char_limit = 5500 - offset
elif page_char_limit < 250:
# Prevents an edge case where a combination of long cog help and low limit
# Could prevent anything from ever showing up.
Expand Down Expand Up @@ -393,7 +393,7 @@ def shorten_line(a_line: str) -> str:
shorten_line(f"**{name}** {command.short_doc}")
for name, command in sorted(coms.items())
)
for i, page in enumerate(pagify(command_text, page_length=1000, shorten_by=0)):
for i, page in enumerate(pagify(command_text, page_length=500, shorten_by=0)):
if i == 0:
title = "**__Commands:__**"
else:
Expand Down
1 change: 0 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ basepython = python3.8
extras = docs
commands =
sphinx-build -d "{toxworkdir}/docs_doctree" docs "{toxworkdir}/docs_out/html" -W -bhtml
sphinx-build -d "{toxworkdir}/docs_doctree" docs "{toxworkdir}/docs_out/linkcheck" -W -blinkcheck
sphinx-build -d "{toxworkdir}/docs_doctree" docs "{toxworkdir}/docs_out/doctest" -W -bdoctest

[testenv:style]
Expand Down

0 comments on commit deab24e

Please sign in to comment.