From 6873cc65acb70ed9b42812a46789ac7bcd146db7 Mon Sep 17 00:00:00 2001 From: jasquat Date: Mon, 21 Nov 2022 18:31:51 -0500 Subject: [PATCH] pyl is passing --- .../spiffworkflow_backend/models/process_group.py | 3 +-- .../services/file_system_service.py | 11 +++++++---- .../services/logging_service.py | 12 +++++++----- .../services/process_instance_processor.py | 2 +- .../services/process_model_service.py | 2 +- 5 files changed, 17 insertions(+), 13 deletions(-) diff --git a/spiffworkflow-backend/src/spiffworkflow_backend/models/process_group.py b/spiffworkflow-backend/src/spiffworkflow_backend/models/process_group.py index 001174e0..14ab3c74 100644 --- a/spiffworkflow-backend/src/spiffworkflow_backend/models/process_group.py +++ b/spiffworkflow-backend/src/spiffworkflow_backend/models/process_group.py @@ -2,6 +2,7 @@ from __future__ import annotations import dataclasses +import os from dataclasses import dataclass from dataclasses import field from typing import Any @@ -10,8 +11,6 @@ import marshmallow from marshmallow import post_load from marshmallow import Schema -import os - from spiffworkflow_backend.models.process_model import ProcessModelInfo diff --git a/spiffworkflow-backend/src/spiffworkflow_backend/services/file_system_service.py b/spiffworkflow-backend/src/spiffworkflow_backend/services/file_system_service.py index c8ca29d2..5812748c 100644 --- a/spiffworkflow-backend/src/spiffworkflow_backend/services/file_system_service.py +++ b/spiffworkflow-backend/src/spiffworkflow_backend/services/file_system_service.py @@ -33,15 +33,18 @@ class FileSystemService: @staticmethod def id_string_to_relative_path(id_string: str) -> str: + """Id_string_to_relative_path.""" return id_string.replace("/", os.sep) @staticmethod def process_group_path(name: str) -> str: """Category_path.""" - return os.path.abspath(os.path.join( - FileSystemService.root_path(), - FileSystemService.id_string_to_relative_path(name) - )) + return os.path.abspath( + os.path.join( + FileSystemService.root_path(), + FileSystemService.id_string_to_relative_path(name), + ) + ) @staticmethod def full_path_from_relative_path(relative_path: str) -> str: diff --git a/spiffworkflow-backend/src/spiffworkflow_backend/services/logging_service.py b/spiffworkflow-backend/src/spiffworkflow_backend/services/logging_service.py index 727afe39..dd34cb3f 100644 --- a/spiffworkflow-backend/src/spiffworkflow_backend/services/logging_service.py +++ b/spiffworkflow-backend/src/spiffworkflow_backend/services/logging_service.py @@ -212,14 +212,16 @@ class DBHandler(logging.Handler): bpmn_process_identifier = record.workflow # type: ignore spiff_task_guid = str(record.task_id) # type: ignore bpmn_task_identifier = str(record.task_spec) # type: ignore - bpmn_task_name = record.task_name if hasattr(record, "task_name") else None - bpmn_task_type = record.task_type if hasattr(record, "task_type") else None + bpmn_task_name = record.task_name if hasattr(record, "task_name") else None # type: ignore + bpmn_task_type = record.task_type if hasattr(record, "task_type") else None # type: ignore timestamp = record.created message = record.msg if hasattr(record, "msg") else None - current_user_id = record.current_user_id if hasattr(record, "current_user_id") else None + current_user_id = ( + record.current_user_id if hasattr(record, "current_user_id") else None # type: ignore + ) spiff_step = ( - record.spiff_step - if hasattr(record, "spiff_step") and record.spiff_step is not None + record.spiff_step # type: ignore + if hasattr(record, "spiff_step") and record.spiff_step is not None # type: ignore else 1 ) self.logs.append( 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 9d188dc8..668ab15e 100644 --- a/spiffworkflow-backend/src/spiffworkflow_backend/services/process_instance_processor.py +++ b/spiffworkflow-backend/src/spiffworkflow_backend/services/process_instance_processor.py @@ -1008,7 +1008,7 @@ class ProcessInstanceProcessor: spiff_logger = logging.getLogger("spiff") for handler in spiff_logger.handlers: if hasattr(handler, "bulk_insert_logs"): - handler.bulk_insert_logs() + handler.bulk_insert_logs() # type: ignore db.session.commit() except WorkflowTaskExecException as we: diff --git a/spiffworkflow-backend/src/spiffworkflow_backend/services/process_model_service.py b/spiffworkflow-backend/src/spiffworkflow_backend/services/process_model_service.py index 237b7865..65de4272 100644 --- a/spiffworkflow-backend/src/spiffworkflow_backend/services/process_model_service.py +++ b/spiffworkflow-backend/src/spiffworkflow_backend/services/process_model_service.py @@ -213,7 +213,7 @@ class ProcessModelService(FileSystemService): process_group_path = os.path.abspath( os.path.join( FileSystemService.root_path(), - FileSystemService.id_string_to_relative_path(process_group_id) + FileSystemService.id_string_to_relative_path(process_group_id), ) ) if self.is_group(process_group_path):