Added rich progress bars
This commit is contained in:
@@ -1,27 +1,23 @@
|
|||||||
import logging
|
import logging
|
||||||
import pprint
|
import pprint
|
||||||
|
from rich.progress import track
|
||||||
|
|
||||||
from core.runtime.managefailure import manageFailure
|
from core.runtime.managefailure import manageFailure
|
||||||
from core.runtime.stopsignals import checkDependency
|
from core.runtime.stopsignals import checkDependency
|
||||||
from core.execution.processregistry import registerProcess
|
from core.execution.processregistry import registerProcess
|
||||||
#from tqdm import tqdm
|
|
||||||
from rich.progress import track
|
|
||||||
|
|
||||||
outputs = {}
|
outputs = {}
|
||||||
|
|
||||||
def buildOperation(definition, outputs):
|
def buildOperation(definition, outputs):
|
||||||
|
process_log = True
|
||||||
|
|
||||||
from core.execution.executioncontract import executeContract
|
from core.execution.executioncontract import executeContract
|
||||||
|
|
||||||
actions = definition.actions
|
actions = definition.actions
|
||||||
outputs = registerProcess(definition, outputs)
|
outputs = registerProcess(definition, outputs)
|
||||||
responses = []
|
responses = []
|
||||||
|
|
||||||
#for action in tqdm(
|
|
||||||
# actions,
|
|
||||||
# desc=definition.name,
|
|
||||||
# unit="action"
|
|
||||||
#):
|
|
||||||
|
|
||||||
|
|
||||||
if getattr(definition, "track", False):
|
if getattr(definition, "track", False):
|
||||||
actions = track(
|
actions = track(
|
||||||
actions,
|
actions,
|
||||||
@@ -52,19 +48,22 @@ def buildOperation(definition, outputs):
|
|||||||
if action.kind == "action":
|
if action.kind == "action":
|
||||||
outputs["processes"][definition.name][action.name]["response"] = response
|
outputs["processes"][definition.name][action.name]["response"] = response
|
||||||
|
|
||||||
#Print completion status after runtime processes
|
|
||||||
print(f"{action.name} completed")
|
|
||||||
|
|
||||||
##Append completed process to process registry
|
##Append completed process to process registry
|
||||||
outputs["processes"][definition.name]["completed"].append(action.alias)
|
outputs["processes"][definition.name]["completed"].append(action.alias)
|
||||||
|
|
||||||
#For debugging purposes only
|
|
||||||
process_registry_logs = False
|
|
||||||
if process_registry_logs:
|
|
||||||
pprint.pprint(outputs["processes"])
|
|
||||||
|
|
||||||
#Temporarily disabled manageFailure functions
|
#Temporarily disabled manageFailure functions
|
||||||
#except Exception as error:
|
#except Exception as error:
|
||||||
#outputs = manageFailure(error, action, outputs)
|
#outputs = manageFailure(error, action, outputs)
|
||||||
|
|
||||||
|
#Print completion status after runtime processes
|
||||||
|
if process_log:
|
||||||
|
logging.info(f"{definition.name} completed")
|
||||||
|
|
||||||
|
#For debugging purposes only
|
||||||
|
process_registry_logs = False
|
||||||
|
if process_registry_logs:
|
||||||
|
pprint.pprint(outputs["processes"])
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return outputs, responses
|
return outputs, responses
|
||||||
|
|||||||
@@ -1 +1,2 @@
|
|||||||
requests
|
requests
|
||||||
|
rich
|
||||||
Reference in New Issue
Block a user