cic-cli/cic/cmd/init.py

34 lines
758 B
Python
Raw Normal View History

2021-10-09 18:50:43 +02:00
# standard imports
import logging
2021-10-09 19:56:29 +02:00
import os
# local imports
from cic import Proof
from cic.meta import Meta
from cic.attachment import Attachment
2021-10-09 20:37:54 +02:00
from cic.network import Network
2021-10-09 18:50:43 +02:00
logg = logging.getLogger(__name__)
def process_args(argparser):
argparser.add_argument('--target', action='append', type=str, help='initialize network specification file with target')
2021-10-09 18:50:43 +02:00
argparser.add_argument('directory', help='directory to initialize')
def validate_args(args):
pass
def execute(config, eargs):
2021-10-09 19:56:29 +02:00
os.makedirs(eargs.directory)
cp = Proof(eargs.directory)
cm = Meta(eargs.directory)
ca = Attachment(eargs.directory)
cn = Network(eargs.directory, targets=eargs.target)
2021-10-09 19:56:29 +02:00
cp.start()
cm.start()
ca.start()
2021-10-09 20:37:54 +02:00
cn.start()