Add network module

This commit is contained in:
nolash
2021-10-09 20:37:54 +02:00
parent fad433cd55
commit 546a4d912a
10 changed files with 129 additions and 36 deletions

View File

@@ -1,15 +0,0 @@
# local imports
from cic.attachment import Attachment
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='directory')
def validate_args(args):
pass
def execute(config, eargs):
ca = Attachment(eargs.directory)
ca.load()

View File

@@ -6,6 +6,7 @@ import os
from cic import Proof
from cic.meta import Meta
from cic.attachment import Attachment
from cic.network import Network
logg = logging.getLogger(__name__)
@@ -24,7 +25,9 @@ def execute(config, eargs):
cp = Proof(eargs.directory)
cm = Meta(eargs.directory)
ca = Attachment(eargs.directory)
cn = Network(eargs.directory)
cp.start()
cm.start()
ca.start()
cn.start()

32
cic/cmd/show.py Normal file
View File

@@ -0,0 +1,32 @@
# local imports
from cic import Proof
from cic.meta import Meta
from cic.attachment import Attachment
from cic.network import Network
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='directory')
def validate_args(args):
pass
def execute(config, eargs):
cp = Proof(path=eargs.directory)
cm = Meta(path=eargs.directory)
ca = Attachment(path=eargs.directory)
cn = Network(eargs.directory)
cp.load()
cm.load()
ca.load()
cn.load()
print("Version: {}\n".format(cp.version()))
print("Proof:\n{}".format(cp))
print("Meta:\n{}".format(cm))
print("Attachments:\n{}".format(ca))
print("Network:\n{}".format(cn))