Add writers to core processors from export cli cmd

This commit is contained in:
nolash
2021-10-12 11:27:26 +02:00
parent 68867d09d2
commit 33c0dac678
4 changed files with 18 additions and 13 deletions

View File

@@ -52,9 +52,9 @@ def execute(config, eargs):
writers = init_writers_from_config(config)
ct = Token(path=eargs.directory)
cm = Meta(path=eargs.directory, writer=writers['meta'])
ca = Attachment(path=eargs.directory, writer=writers['attachment'])
cp = Proof(path=eargs.directory, attachments=ca, writer=writers['proof'])
cm = Meta(path=eargs.directory, writer=writers['meta'](path=eargs.output_directory))
ca = Attachment(path=eargs.directory, writer=writers['attachment'](path=eargs.output_directory))
cp = Proof(path=eargs.directory, attachments=ca, writer=writers['proof'](path=eargs.output_directory))
cn = Network(path=eargs.directory)
ct.load()
@@ -77,9 +77,8 @@ def execute(config, eargs):
ref = cn.resource(eargs.target)
chain_spec = cn.chain_spec(eargs.target)
logg.debug('found reference {} chain spec {} for target {}'.format(ref['contents'], chain_spec, eargs.target))
c = getattr(cmd_mod, 'new')(chain_spec, ref['contents'], cp, signer_hint=signer, rpc=rpc)
c = getattr(cmd_mod, 'new')(chain_spec, ref['contents'], cp, signer_hint=signer, rpc=rpc, outputs_writer=writers['ext'](path=eargs.output_directory))
c.apply_token(ct)
p = Processor(proof=cp, attachment=ca, metadata=cm, extensions=[eargs.target])
c.process(writer=writers['ext'](path=eargs.output_directory))
p = Processor(proof=cp, attachment=ca, metadata=cm, extensions=[c])
p.process()