File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 88.. image :: https://img.shields.io/pypi/pyversions/PyAuth.png
99 :target: https://pypi.python.org/pypi/PyAuth/
1010 :alt: Latest Version
11-
11+
1212.. image :: https://img.shields.io/github/release/tknarr/PyAuth.png
1313 :target: https://github.com/tknarr/PyAuth/releases/latest
1414 :alt: Latest Version
@@ -53,8 +53,8 @@ Prerequisites
5353 `wxWidgets <http://www.wxwidgets.org/ >`_
5454* `pyotp 2.0.1 <https://pypi.python.org/pypi/pyotp >`_ or higher
5555* `cryptography 1.3 <https://pypi.python.org/pypi/cryptography >`_ or higher
56- * `pycrypto 2.6.1 <https://pypi/ python.org/pypi/pycrypto >`_ or higher, strictly for
57- decrypting older databases
56+ * `qrcode 5.3 <https://pypi. python.org/pypi/qrcode >`_ or higher
57+ * ` Pillow 3.4 < https://pypi.python.org/pypi/Pillow >`_ or higher
5858
5959wxPython isn't automatically pulled in by ``pip `` because the version at PyPI is
6060still 2.9. Your distribution probably includes a pre-packaged version, or you can
@@ -103,7 +103,7 @@ Command line:
103103* ``-n `` forces the program to display in a normal window without using the
104104 notification icon. This overrides ``-s `` and ``-m `` and any remembered settings
105105 for the notification icon.
106-
106+
107107* ``--icons `` selects a set of icons with the named background (default white).
108108
109109* ``--logfile `` allows you to set a log file for errors and messages logged by
Original file line number Diff line number Diff line change 2121import wx
2222from AuthenticationStore import AuthenticationEntry
2323from Logging import GetLogger
24- from qrcode import QrCodeImage , QrCodeFrame
24+ from QrCode import QrCodeImage , QrCodeFrame
2525
2626
2727class AuthEntryPanel ( wx .Panel ):
@@ -389,10 +389,6 @@ def GetCodeString( self, selected ):
389389 def GetProvisioningUri ( self ):
390390 return self .entry .GetKeyUri ( )
391391
392- def GetQrCodeUrl ( self ):
393- qr = QrCodeImage ( self .entry )
394- return qr .GetUrl ( )
395-
396392 def GetQrCodeImage ( self ):
397393 qr = QrCodeImage ( self .entry )
398394 return qr .GetImage ( )
Original file line number Diff line number Diff line change 2626## along with this program. If not, see http://www.gnu.org/licenses/
2727
2828import os
29- import string
3029import base64
3130from cryptography .hazmat .primitives import hashes
3231from cryptography .hazmat .primitives .ciphers import Cipher , algorithms , modes
Original file line number Diff line number Diff line change 1818## along with this program. If not, see http://www.gnu.org/licenses/
1919
2020import wx
21- import requests
22- import urllib
21+ import qrcode
2322from io import BytesIO
24- from AuthenticationStore import AuthenticationEntry
25- from Logging import GetLogger
2623
2724
2825class QrCodeImage :
@@ -31,21 +28,12 @@ class QrCodeImage:
3128 def __init__ ( self , entry ):
3229 self .provisioning_uri = entry .GetKeyUri ( )
3330
34- def GetUrl ( self ):
35- return "https://www.google.com/chart?chs=240x240&chld=M|0&cht=qr&chl=" + urllib .quote ( self .provisioning_uri )
36-
3731 def GetImage ( self ):
38- url = self .GetUrl ( )
39- GetLogger ( ).debug ( "Requesting QR code image from %s" , url )
40- resp = requests .get ( url )
41- GetLogger ( ).debug ( "HTTP status: %d" , resp .status_code )
42- if resp .status_code == requests .codes .ok :
43- input_strm = BytesIO ( resp .content )
44- image = wx .ImageFromStream ( input_strm , wx .BITMAP_TYPE_PNG )
45- else :
46- GetLogger ( ).error ( "HTTP error %d" , resp .status_code )
47- GetLogger ( ).error ( "Error response body:\n %s" , resp .text )
48- image = None
32+ img = qrcode .make ( self .provisioning_uri )
33+ strm = BytesIO ( )
34+ img .save ( strm , "PNG" )
35+ strm .seek ( 0 )
36+ image = wx .ImageFromStream ( strm , wx .BITMAP_TYPE_PNG )
4937 return image
5038
5139
Original file line number Diff line number Diff line change 8181
8282 install_requires = [
8383 # 'wxPython>=3.0',
84- 'requests>=2.10' ,
8584 'pyotp>=2.0.1' ,
86- 'pycrypto>=2.6.1' ,
87- 'cryptography>=1.3'
85+ 'cryptography>=1.3' ,
86+ 'qrcode>=5.3' ,
87+ 'Pillow>=3.4'
8888 ],
8989
9090 package_data = {
You can’t perform that action at this time.
0 commit comments