From 426d54790c31afde20e5e138882d078d930a24e0 Mon Sep 17 00:00:00 2001 From: mike cullerton Date: Mon, 21 Nov 2022 16:29:47 -0500 Subject: [PATCH] mypy --- .../services/file_system_service.py | 2 +- .../services/logging_service.py | 10 +++++----- .../services/process_instance_processor.py | 2 +- .../services/secret_service.py | 16 ++++++++-------- 4 files changed, 15 insertions(+), 15 deletions(-) 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 523060620..c8ca29d26 100644 --- a/spiffworkflow-backend/src/spiffworkflow_backend/services/file_system_service.py +++ b/spiffworkflow-backend/src/spiffworkflow_backend/services/file_system_service.py @@ -32,7 +32,7 @@ class FileSystemService: return os.path.join(app_root, "..", dir_name) @staticmethod - def id_string_to_relative_path(id_string): + def id_string_to_relative_path(id_string: str) -> str: return id_string.replace("/", os.sep) @staticmethod diff --git a/spiffworkflow-backend/src/spiffworkflow_backend/services/logging_service.py b/spiffworkflow-backend/src/spiffworkflow_backend/services/logging_service.py index b93e86657..727afe390 100644 --- a/spiffworkflow-backend/src/spiffworkflow_backend/services/logging_service.py +++ b/spiffworkflow-backend/src/spiffworkflow_backend/services/logging_service.py @@ -212,14 +212,14 @@ 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 # type: ignore - bpmn_task_type = record.task_type if hasattr(record, "task_type") else None # 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 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 # type: ignore + current_user_id = record.current_user_id if hasattr(record, "current_user_id") else None spiff_step = ( - record.spiff_step # type: ignore - if hasattr(record, "spiff_step") and record.spiff_step is not None # type: ignore + record.spiff_step + if hasattr(record, "spiff_step") and record.spiff_step is not None 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 668ab15eb..9d188dc88 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() # type: ignore + handler.bulk_insert_logs() db.session.commit() except WorkflowTaskExecException as we: diff --git a/spiffworkflow-backend/src/spiffworkflow_backend/services/secret_service.py b/spiffworkflow-backend/src/spiffworkflow_backend/services/secret_service.py index 42f401c18..41ee22b2d 100644 --- a/spiffworkflow-backend/src/spiffworkflow_backend/services/secret_service.py +++ b/spiffworkflow-backend/src/spiffworkflow_backend/services/secret_service.py @@ -19,15 +19,15 @@ from spiffworkflow_backend.models.secret_model import SecretModel class SecretService: """SecretService.""" - def encrypt_key(self, plain_key: str) -> str: - """Encrypt_key.""" - # flask_secret = current_app.secret_key - # print("encrypt_key") - ... + # def encrypt_key(self, plain_key: str) -> str: + # """Encrypt_key.""" + # # flask_secret = current_app.secret_key + # # print("encrypt_key") + # ... - def decrypt_key(self, encrypted_key: str) -> str: - """Decrypt key.""" - ... + # def decrypt_key(self, encrypted_key: str) -> str: + # """Decrypt key.""" + # ... @staticmethod def add_secret(