|
@@ -1,6 +1,7 @@
|
|
|
#!/usr/bin/env python
|
|
|
# coding: utf-8
|
|
|
-import qrcode
|
|
|
+from collections import defaultdict
|
|
|
+import pyqrcode
|
|
|
import requests
|
|
|
import json
|
|
|
import xml.dom.minidom
|
|
@@ -68,15 +69,13 @@ class WXBot:
|
|
|
|
|
|
def gen_qr_code(self, qr_file_path):
|
|
|
string = 'https://login.weixin.qq.com/l/' + self.uuid
|
|
|
- qr = qrcode.QRCode()
|
|
|
- qr.border = 1
|
|
|
- qr.add_data(string)
|
|
|
- qr.make(fit=True)
|
|
|
+ qr = pyqrcode.create(string)
|
|
|
if self.conf['qr'] == 'png':
|
|
|
- img = qr.make_image()
|
|
|
- img.save(qr_file_path)
|
|
|
+ qr.png(qr_file_path)
|
|
|
elif self.conf['qr'] == 'tty':
|
|
|
- qr.print_tty()
|
|
|
+ print 'Not support tty'
|
|
|
+ pass
|
|
|
+ #qr.print_tty()
|
|
|
|
|
|
def wait4login(self, tip):
|
|
|
time.sleep(tip)
|