mirror of https://github.com/nucypher/nucypher.git
Everyone gets a card...
parent
2439168dc0
commit
ccc9d86ff8
|
@ -181,6 +181,11 @@ class Alice(Character, BlockchainPolicyAuthor):
|
|||
self.active_policies = dict()
|
||||
self.revocation_kits = dict()
|
||||
|
||||
def get_card(self) -> 'Card':
|
||||
from nucypher.policy.collections import Card
|
||||
card = Card.from_character(self)
|
||||
return card
|
||||
|
||||
def add_active_policy(self, active_policy):
|
||||
"""
|
||||
Adds a Policy object that is active on the NuCypher network to Alice's
|
||||
|
|
|
@ -450,8 +450,14 @@ class Card:
|
|||
return cls.from_bytes(base64.urlsafe_b64decode(b64data))
|
||||
|
||||
def to_qr_code(self):
|
||||
import qrcode
|
||||
from qrcode.main import QRCode
|
||||
qr = QRCode()
|
||||
qr = QRCode(
|
||||
version=1,
|
||||
box_size=1,
|
||||
border=4, # min spec is 4
|
||||
error_correction=qrcode.constants.ERROR_CORRECT_L,
|
||||
)
|
||||
qr.add_data(bytes(self))
|
||||
qr.print_ascii()
|
||||
|
||||
|
|
Loading…
Reference in New Issue