def _qrcode_from_signify_ed25519_pubkey(pubkey_file, mode='text'):
 assert (mode in ['text', 'svg'])
 import pyqrcode
 with open(pubkey_file) as f:
  pubkey = f.read().splitlines()[1]
  qr = pyqrcode.create(pubkey, error='L', mode='binary')
  if (mode == 'text'):
   return qr.terminal()
  elif (mode == 'svg'):
   import io
   data_buffer = io.BytesIO()
   qr.svg(data_buffer, omithw=True)
   return data_buffer.getvalue()
  else:
   raise Exception('logic error')

def _qrcode_from_signify_ed25519_pubkey ( pubkey_file , mode = 'text' ) : assert ( mode in [ 'text' , 'svg' ] ) import pyqrcode with open ( pubkey_file ) as f : pubkey = f . read ( ) . splitlines ( ) [ 1 ] qr = pyqrcode . create ( pubkey , error = 'L' , mode = 'binary' ) if ( mode == 'text' ) : return qr . terminal ( ) elif ( mode == 'svg' ) : import io data_buffer = io . BytesIO ( ) qr . svg ( data_buffer , omithw = True ) return data_buffer . getvalue ( ) else : raise Exception ( 'logic error' )
usage: 1 .