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

Implement/test LOLWUT command #1568

Merged
merged 3 commits into from
Oct 1, 2021
Merged

Implement/test LOLWUT command #1568

merged 3 commits into from
Oct 1, 2021

Conversation

brainix
Copy link
Contributor

@brainix brainix commented Sep 2, 2021

Pull Request check-list

  • Does $ tox pass with this change (including linting)?
  • Does travis tests pass with this change (enable it first in your forked repo and wait for the travis build to finish)?
  • Is the new or changed code fully tested?
  • Is a documentation update included (if this change modifies existing APIs, or introduces new ones)?

Description of change

Implement/test LOLWUT command

This is a lot of fun to play with:

>>> from redis import Redis
>>> redis = Redis()
>>> print(redis.lolwut(5, 6, 7, 8).decode('utf-8'))
⣴⣶⣶⣶⣶⡆
⣿⣿⣿⣿⣿⡇
⠹⡿⠟⣿⡿⠃
⠀⠀⠀⠀⠀⠀
Georg Nees - schotter, plotter on paper, 1968. Redis ver. 6.0.10

>>> print(redis.lolwut(5, 6, 7, 8).decode('utf-8'))
⢰⣶⣶⣶⣶⡆
⢿⣿⣿⣿⣿⠁
⠸⡿⢿⠿⡿⠃
⠀⠀⠀⠀⠀⠀
Georg Nees - schotter, plotter on paper, 1968. Redis ver. 6.0.10

>>> print(redis.lolwut(5, 6, 7, 8).decode('utf-8'))
⢰⣶⣶⣶⣶⡆
⣸⣿⣿⣻⣿⡅
⠿⡿⠻⠿⠿⠁
⠀⠀⠀⠀⠀⠀
Georg Nees - schotter, plotter on paper, 1968. Redis ver. 6.0.10

>>>

@brainix
Copy link
Contributor Author

brainix commented Sep 2, 2021

@chayim - I'd originally opened this PR here: #1448, but I made a mess of that branch. So I recreated that PR here, putting the command and the test in the right places, and keeping the methods alphabetized. How does it look now? Thanks!

https://redis.io/commands/lolwut

This is a lot of fun to play with:

```python
>>> from redis import Redis
>>> redis = Redis()
>>> print(redis.lolwut(5, 6, 7, 8).decode('utf-8'))
⣴⣶⣶⣶⣶⡆
⣿⣿⣿⣿⣿⡇
⠹⡿⠟⣿⡿⠃
⠀⠀⠀⠀⠀⠀
Georg Nees - schotter, plotter on paper, 1968. Redis ver. 6.0.10

>>> print(redis.lolwut(5, 6, 7, 8).decode('utf-8'))
⢰⣶⣶⣶⣶⡆
⢿⣿⣿⣿⣿⠁
⠸⡿⢿⠿⡿⠃
⠀⠀⠀⠀⠀⠀
Georg Nees - schotter, plotter on paper, 1968. Redis ver. 6.0.10

>>> print(redis.lolwut(5, 6, 7, 8).decode('utf-8'))
⢰⣶⣶⣶⣶⡆
⣸⣿⣿⣻⣿⡅
⠿⡿⠻⠿⠿⠁
⠀⠀⠀⠀⠀⠀
Georg Nees - schotter, plotter on paper, 1968. Redis ver. 6.0.10

>>>
```
redis/commands.py Outdated Show resolved Hide resolved
Co-authored-by: Chayim <chayim@users.noreply.github.com>
@brainix
Copy link
Contributor Author

brainix commented Sep 10, 2021

@chayim -- I believe I've addressed your feedback. 😅 How does this PR look now?

@chayim chayim mentioned this pull request Sep 30, 2021
66 tasks
@chayim
Copy link
Contributor

chayim commented Sep 30, 2021

Looks great @brainix. Thanks for adding lolwut support. As a total aside - I really enjoyed playing with this, I think it's very funny that this is a thing.

One last change, can you decorate the test with @skip_if_server_version_lt('5.0.0'). That's the only missing thing. Then I'll merge.

The `LOLWUT` command was introduced in Redis 5.0.0:
https://redis.io/commands/lolwut
@brainix
Copy link
Contributor Author

brainix commented Oct 1, 2021

@chayim - Good call. I've decorated the unit test to be skipped for Redis < 5.0.0.

@chayim
Copy link
Contributor

chayim commented Oct 1, 2021

Amazing. Thanks again. Let's merge this in!

@chayim chayim merged commit 9527ae8 into redis:master Oct 1, 2021
@brainix brainix deleted the lolwut branch October 1, 2021 04:25
brainix added a commit to brainix/pottery that referenced this pull request Oct 1, 2021
I got `Redis.lolwut()` merged upstream!
redis/redis-py#1568
brainix added a commit to brainix/pottery that referenced this pull request Oct 1, 2021
* Delete the Redis.lolwut() monkey patch

I got `Redis.lolwut()` merged upstream!
redis/redis-py#1568

* Bump version number
Andrew-Chen-Wang added a commit to aio-libs-abandoned/aioredis-py that referenced this pull request Oct 8, 2021
Implement/test LOLWUT command (redis/redis-py#1568)

Signed-off-by: Andrew-Chen-Wang <acwangpython@gmail.com>
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.

2 participants