mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2024-12-24 16:10:02 -06:00
Update qrcode support for newer python-qrcode
This substantially reduces the FreeIPA dependencies and allows QR codes to fit in a standard terminal. https://fedorahosted.org/freeipa/ticket/4430 Reviewed-By: Petr Vobornik <pvoborni@redhat.com>
This commit is contained in:
parent
4e6a3c69b0
commit
9c50f9f957
@ -59,7 +59,7 @@ BuildRequires: python-memcached
|
||||
BuildRequires: sssd >= 1.9.2
|
||||
BuildRequires: python-lxml
|
||||
BuildRequires: python-pyasn1 >= 0.0.9a
|
||||
BuildRequires: python-qrcode
|
||||
BuildRequires: python-qrcode-core >= 5.0.0
|
||||
BuildRequires: python-dns
|
||||
BuildRequires: m2crypto
|
||||
BuildRequires: check
|
||||
@ -248,7 +248,7 @@ Requires: python-nss >= 0.15
|
||||
Requires: python-lxml
|
||||
Requires: python-netaddr
|
||||
Requires: libipa_hbac-python
|
||||
Requires: python-qrcode
|
||||
Requires: python-qrcode-core >= 5.0.0
|
||||
Requires: python-pyasn1
|
||||
Requires: python-dateutil
|
||||
Requires: python-yubico
|
||||
|
@ -246,7 +246,7 @@ class otptoken_add(LDAPCreate):
|
||||
msg_summary = _('Added OTP token "%(value)s"')
|
||||
|
||||
takes_options = LDAPCreate.takes_options + (
|
||||
Flag('qrcode?', label=_('Display QR code (requires wide terminal)')),
|
||||
Flag('qrcode?', label=_('Display QR code')),
|
||||
)
|
||||
|
||||
has_output_params = LDAPCreate.has_output_params + (
|
||||
@ -328,7 +328,7 @@ class otptoken_add(LDAPCreate):
|
||||
qr = qrcode.QRCode()
|
||||
qr.add_data(uri)
|
||||
qr.make()
|
||||
qr.print_tty()
|
||||
qr.print_ascii(tty=True)
|
||||
print "\n"
|
||||
|
||||
return rv
|
||||
|
Loading…
Reference in New Issue
Block a user