cic-cli/cic/cmd/show.py

38 lines
975 B
Python
Raw Normal View History

2021-10-09 20:37:54 +02:00
# local imports
from cic import Proof
from cic.meta import Meta
from cic.attachment import Attachment
from cic.network import Network
2021-10-10 14:49:22 +02:00
from cic.token import Token
2021-10-09 20:37:54 +02:00
def process_args(argparser):
argparser.add_argument('-f', '--file', type=str, help='add file')
argparser.add_argument('-d', '--directory', type=str, dest='directory', default='.', help='cic data directory')
2021-10-09 20:37:54 +02:00
def validate_args(args):
pass
def execute(config, eargs):
2021-10-10 14:49:22 +02:00
ct = Token(path=eargs.directory)
2021-10-09 20:37:54 +02:00
cp = Proof(path=eargs.directory)
cm = Meta(path=eargs.directory)
ca = Attachment(path=eargs.directory)
cn = Network(eargs.directory)
2021-10-10 14:49:22 +02:00
ct.load()
2021-10-09 20:37:54 +02:00
cp.load()
cm.load()
ca.load()
cn.load()
2021-10-10 14:49:22 +02:00
print("""[cic.header]
version = {}\n""".format(cp.version()))
print("[cic.token]\n{}".format(ct))
print("[cic.proof]\n{}".format(cp))
print("[cic.meta]\n{}".format(cm))
print("[cic.attachment]\n{}".format(ca))
print("[cic.network]\n{}".format(cn))