def mmgen_decrypt_file_maybe(fn, desc='', silent=False): d = get_data_from_file(fn, desc, binary=True, silent=silent) have_enc_ext = get_extension(fn) == g.mmenc_ext if have_enc_ext or not is_utf8(d): m = ('Attempting to decrypt', 'Decrypting')[have_enc_ext] msg(u"{} {} '{}'".format(m, desc, fn)) from mmgen.crypto import mmgen_decrypt_retry d = mmgen_decrypt_retry(d, desc) return d
def mmgen_decrypt_file_maybe(fn,desc='',quiet=False,silent=False): d = get_data_from_file(fn,desc,binary=True,quiet=quiet,silent=silent) have_enc_ext = get_extension(fn) == g.mmenc_ext if have_enc_ext or not is_utf8(d): m = ('Attempting to decrypt','Decrypting')[have_enc_ext] qmsg("{} {} '{}'".format(m,desc,fn)) from mmgen.crypto import mmgen_decrypt_retry d = mmgen_decrypt_retry(d,desc) return d
def mmgen_decrypt_file_maybe(fn, desc=''): d = get_data_from_file(fn, desc, binary=True) have_enc_ext = get_extension(fn) == g.mmenc_ext if have_enc_ext or not is_utf8(d): m = ('Attempting to decrypt', 'Decrypting')[have_enc_ext] msg("%s %s '%s'" % (m, desc, fn)) from mmgen.crypto import mmgen_decrypt_retry d = mmgen_decrypt_retry(d, desc) return d