child count for verbose output
parent
d93929d8b5
commit
6b7b3ce193
12
run.py
12
run.py
|
@ -34,16 +34,17 @@ class Sins():
|
|||
self.logger.info('parsed\n {}'.format((parsed)))
|
||||
|
||||
paths = (self.seed)
|
||||
|
||||
children = 0
|
||||
while True:
|
||||
for path in paths:
|
||||
scrap_path = os.path.join(self.run_dir, path)
|
||||
if os.path.isfile(scrap_path):
|
||||
self.execute(
|
||||
children += self.execute(
|
||||
self.parent,
|
||||
scrap_path,
|
||||
self.run_dir
|
||||
)
|
||||
self.logger.info('"children": "{}",'.format(children))
|
||||
paths = sorted(os.listdir(self.run_dir))
|
||||
|
||||
def scrap_recent(self, run_dir):
|
||||
|
@ -55,8 +56,10 @@ class Sins():
|
|||
return None
|
||||
|
||||
def execute(self, parent, scrap, cwd):
|
||||
self.logger.info('execute\n {}'.format(((parent, scrap, cwd))))
|
||||
subprocess.run([parent, scrap], cwd=cwd)
|
||||
self.logger.debug('execute\n {}'.format(((parent, scrap, cwd))))
|
||||
proc = subprocess.run([parent, scrap], cwd=cwd, stdout=subprocess.PIPE)
|
||||
children = proc.stdout
|
||||
return int(children)
|
||||
|
||||
|
||||
def hex_dumps(scrap_dir):
|
||||
|
@ -122,6 +125,7 @@ if __name__ == '__main__':
|
|||
else:
|
||||
stream_handler = logging.StreamHandler()
|
||||
stream_handler.setFormatter(formatter)
|
||||
logger.setLevel(logging.INFO)
|
||||
logger.addHandler(stream_handler)
|
||||
|
||||
if args.provision:
|
||||
|
|
Loading…
Reference in New Issue