Fix: Formateo PEP8

This commit is contained in:
2024-08-14 12:50:53 -05:00
parent 9f7349ccee
commit fb44498e53
6 changed files with 445 additions and 303 deletions

View File

@@ -2,18 +2,30 @@ from .. import fe
__all__ = ['DIANWrite', 'DIANWriteSigned']
def DIANWrite(xml, filename):
document = xml.tostring(xml_declaration=True, encoding='UTF-8')
with open(filename, 'w') as f:
f.write(document)
def DIANWriteSigned(xml, filename, private_key, passphrase, use_cache_policy=False, dian_signer=None):
document = xml.tostring(xml_declaration=True, encoding='UTF-8').encode('utf-8')
def DIANWriteSigned(
xml,
filename,
private_key,
passphrase,
use_cache_policy=False,
dian_signer=None):
document = xml.tostring(
xml_declaration=True,
encoding='UTF-8').encode('utf-8')
if dian_signer is None:
dian_signer = fe.DianXMLExtensionSigner
signer = dian_signer(private_key, passphrase=passphrase, localpolicy=use_cache_policy)
signer = dian_signer(
private_key,
passphrase=passphrase,
localpolicy=use_cache_policy)
with open(filename, 'w') as f:
f.write(signer.sign_xml_string(document))