-
Notifications
You must be signed in to change notification settings - Fork 237
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
59 additions
and
3 deletions.
There are no files selected for viewing
Validating CODEOWNERS rules …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# | ||
# https://help.github.com/articles/about-codeowners/ | ||
# | ||
|
||
* @wechaty/python |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
Huan LI (李卓桓) <https://github.com/huan> | ||
Jingjing WU (吴京京) <https://github.com/wj-Mcat> | ||
Chunhong HUANG (黄纯鸿) <https://github.com/huangaszaq> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -245,11 +245,13 @@ pip3 install wechaty | |
|
||
### v0.4 (Mar 15, 2020) master | ||
|
||
1 Add a friendly exception message for PyPI users. [#24](https://github.com/wechaty/python-wechaty/issues/24) | ||
Welcome [@huangaszaq](https://github.com/huangaszaq) for joining the project! [#42](https://github.com/wechaty/python-wechaty/pull/42) | ||
|
||
1. Add a friendly exception message for PyPI users. [#24](https://github.com/wechaty/python-wechaty/issues/24) | ||
|
||
### v0.1 (Mar 8, 2020) | ||
|
||
Welcome [@wj-Mcat](https://github.com/wj-Mcat) for joining the project! | ||
Welcome [@wj-Mcat](https://github.com/wj-Mcat) for joining the project! [#4](https://github.com/wechaty/python-wechaty/pull/4) | ||
|
||
1. Starting translate TypeScript of Wechaty to Python | ||
1. DevOps Setup | ||
|
@@ -269,6 +271,11 @@ Project created, publish a empty module `wechaty` on PyPI. | |
- [Go Wechaty](https://github.com/wechaty/go-wechaty) - Go WeChat Bot SDK for Individual Account | ||
- [Java Wechaty](https://github.com/wechaty/java-wechaty) - Java WeChat Bot SDK for Individual Account | ||
|
||
## Maintainers | ||
|
||
1. [@wj-Mcat](https://github.com/wj-Mcat) - Jingjing WU (吴京京) | ||
1. [@huangaszaq](https://github.com/huangaszaq) - Chunhong HUANG (黄纯鸿) | ||
|
||
## Author | ||
|
||
[Huan LI](https://github.com/huan) ([李卓桓](http://linkedin.com/in/zixia)) [email protected] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ pycodestyle | |
pylint | ||
pylint-quotes | ||
pytest | ||
pytype | ||
pytype==2020.2.20 | ||
semver | ||
grpclib | ||
pyee | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,3 +4,4 @@ requests | |
qrcode | ||
chatie-grpc==0.15.dev4 | ||
requests | ||
qrcode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import qrcode | ||
import platform | ||
|
||
|
||
def qr_terminal_str(data,version=None): | ||
""" | ||
:param data: qrcode data | ||
:param version:1-40 or None | ||
:return: | ||
""" | ||
if platform.system() == "Windows": | ||
white_block = '▇' | ||
black_block = ' ' | ||
new_line = '\n' | ||
else: | ||
white_block = '\033[0;37;47m ' | ||
black_block = '\033[0;37;40m ' | ||
new_line = '\033[0m\n' | ||
|
||
qr = qrcode.QRCode(version) | ||
qr.add_data(data) | ||
if version: | ||
qr.make() | ||
else: | ||
qr.make(fit=True) | ||
output = white_block*(qr.modules_count+2) + new_line | ||
for mn in qr.modules: | ||
output += white_block | ||
for m in mn: | ||
if m: | ||
output += black_block | ||
else: | ||
output += white_block | ||
output += white_block + new_line | ||
output += white_block*(qr.modules_count+2) + new_line | ||
return output | ||
|
||
|
||
def draw(data, version=None): | ||
output = qr_terminal_str(data,version) | ||
print (output) |