From a4c0dd52ae8f1f4c6e0c09f5bda804a226439138 Mon Sep 17 00:00:00 2001 From: Jon Herron Date: Wed, 22 Feb 2023 11:04:07 -0500 Subject: [PATCH] Getting ./bin/pyl to pass --- .../spiffworkflow_backend/scripts/get_data_sizes.py | 11 ++++++++--- .../services/process_instance_processor.py | 4 +++- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/spiffworkflow-backend/src/spiffworkflow_backend/scripts/get_data_sizes.py b/spiffworkflow-backend/src/spiffworkflow_backend/scripts/get_data_sizes.py index 038c6f8a..2f28ffa7 100644 --- a/spiffworkflow-backend/src/spiffworkflow_backend/scripts/get_data_sizes.py +++ b/spiffworkflow-backend/src/spiffworkflow_backend/scripts/get_data_sizes.py @@ -5,11 +5,12 @@ from spiffworkflow_backend.models.script_attributes_context import ( ScriptAttributesContext, ) from spiffworkflow_backend.scripts.script import Script -#from spiffworkflow_backend.servces.process_instance_processor import ProcessInstanceProcessor from spiffworkflow_backend.services.process_instance_processor import ( ProcessInstanceProcessor, ) +# from spiffworkflow_backend.servces.process_instance_processor import ProcessInstanceProcessor + class GetDataSizes(Script): """GetDataSizes.""" @@ -32,6 +33,10 @@ class GetDataSizes(Script): """Run.""" task = script_attributes_context.task return { - "cumulative_task_data_size": ProcessInstanceProcessor.get_task_data_size(task.workflow), - "python_env_size": ProcessInstanceProcessor.get_python_env_size(task.workflow), + "cumulative_task_data_size": ProcessInstanceProcessor.get_task_data_size( + task.workflow + ), + "python_env_size": ProcessInstanceProcessor.get_python_env_size( + task.workflow + ), } diff --git a/spiffworkflow-backend/src/spiffworkflow_backend/services/process_instance_processor.py b/spiffworkflow-backend/src/spiffworkflow_backend/services/process_instance_processor.py index 1dfea5a5..0d0a641e 100644 --- a/spiffworkflow-backend/src/spiffworkflow_backend/services/process_instance_processor.py +++ b/spiffworkflow-backend/src/spiffworkflow_backend/services/process_instance_processor.py @@ -1624,7 +1624,9 @@ class ProcessInstanceProcessor: @classmethod def get_python_env_size(cls, bpmn_process_instance: BpmnWorkflow) -> int: - user_defined_state = bpmn_process_instance.script_engine.environment.user_defined_state() + user_defined_state = ( + bpmn_process_instance.script_engine.environment.user_defined_state() + ) return cls._get_data_size(user_defined_state) def check_task_data_size(self) -> None: