heuer / segno

Python QR Code and Micro QR Code encoder
https://pypi.org/project/segno/
BSD 3-Clause "New" or "Revised" License
606 stars 52 forks source link

Add an option to print QR codes in the terminal with half-block characters. #97

Closed christian-oudard closed 2 years ago

christian-oudard commented 3 years ago

Added an option qr.terminal(compact=True), which uses unicode half-block characters to print to the terminal in half the space.

christian-oudard commented 3 years ago

How necessary is it to use proper color coding in this PR?

heuer commented 3 years ago

Thanks for your submission. I'll take a look at it this weekend. Regarding colors: The default terminal output does not use any color at all. I guess colors may be ignored.

christian-oudard commented 3 years ago

I added a unittest today. The test has a triple-quoted QR code written directly in Python, which may not be your preferred style, please adjust as necessary.

heuer commented 3 years ago

@christian-oudard, I modified your code a bit. What do you think? See https://github.com/heuer/segno/compare/pr-terminal-compact-97

I'll do some tests in different environments (Win, Linux, Mac) and merge the branch into master.

christian-oudard commented 3 years ago

Your updates look good. So happy it's easy to get this merged.

christian-oudard commented 3 years ago

Any way we could get this merged to master? We're still using the half-block feature from a fork in MobileCoin CLI.

christian-oudard commented 3 years ago

We're still using this in production, are you able to merge this?

christian-oudard commented 2 years ago

Since this pull request was mentioned again, can I once again request that it get merged?

heuer commented 2 years ago

Since this pull request was mentioned again, can I once again request that it get merged?

Sorry for the looong delay.

Although I like the idea and appreciate your contribution, the change has more impacts for Segno than initially thought and I haven't found the time for thinking about it.

The change effects among other things QRCodeSequence, Python typing and the CLI and requires more test cases than one.

I work on this issue / PR and you can expect a new release with your contribution soon.

heuer commented 2 years ago

Released 1.4.0 today with your contribution. Thanks again! :+1: