Browse Source

Make default mode from tty to png.

liuwons 9 years ago
parent
commit
b9a6615f60
2 changed files with 2 additions and 1 deletions
  1. 1 0
      test.py
  2. 1 1
      wxbot.py

+ 1 - 0
test.py

@@ -17,6 +17,7 @@ class MyWXBot(WXBot):
 def main():
 def main():
     bot = MyWXBot()
     bot = MyWXBot()
     bot.DEBUG = True
     bot.DEBUG = True
+    bot.conf['qr'] = 'png'
     bot.run()
     bot.run()
 
 
 if __name__ == '__main__':
 if __name__ == '__main__':

+ 1 - 1
wxbot.py

@@ -70,7 +70,7 @@ class WXBot:
         qr.border = 1
         qr.border = 1
         qr.add_data(string)
         qr.add_data(string)
         qr.make(fit=True)
         qr.make(fit=True)
-        if self.conf['qr'] == 'jpg':
+        if self.conf['qr'] == 'png':
             img = qr.make_image()
             img = qr.make_image()
             img.save(qr_file_path)
             img.save(qr_file_path)
         elif self.conf['qr'] == 'tty':
         elif self.conf['qr'] == 'tty':