Skip to content
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

Adding support for the mobile/force paginator flag #111

Merged
merged 1 commit into from Jul 2, 2021

Conversation

clari7744
Copy link
Contributor

@clari7744 clari7744 commented Jun 29, 2021

Rationale

Some users dislike the new file output, and would rather have paginators.
It's also not a viable option to have as the only option, as a lot of people use mobile, and there's no file preview option on mobile.
The best way to view these files on mobile is downloading them, finding them in the file system, and figuring out what app to open in.

Summary of changes made

I created a new .env flag, titled JISHAKU_FORCE_PAGINATOR which would force the output to use paginator regardless of device.
I also added a check for ctx.author.is_on_mobile(), in which case it will default to paginators on mobile regardless of the flag setting.
These checks were placed everywhere there is a check for len(result) < 50_000 (features/[filesystem|invocation|python].py, flags.py)
I don't believe I missed any, but please add it if I did :)

Checklist

  • This PR changes the jishaku module/cog codebase
    • These changes add new functionality to the module/cog
    • These changes fix an issue or bug in the module/cog
    • I have tested that these changes work on a production bot codebase
    • I have tested these changes against the CI/CD test suite
    • I have updated the documentation to reflect these changes
  • This PR changes the CI/CD test suite
    • I have tested my suite changes are well-formed (all tests can be discovered)
    • These changes adjust existing test cases
    • These changes add new test cases
  • This PR changes prose (such as the documentation, README or other Markdown/RST documents)
    • I have proofread my changes for grammar and spelling issues
    • I have tested that any changes regarding Markdown/RST syntax result in a well formed document

@Gorialis
Copy link
Owner

Gorialis commented Jul 2, 2021

The imports aren't sorted correctly and I've been thinking of redoing the flag system entirely in the future, but this will do for the time being.

@Gorialis Gorialis merged commit 6222e75 into Gorialis:master Jul 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants