From 9ae87f859e39194f7105c8beb78672c11e8d006d Mon Sep 17 00:00:00 2001 From: jasquat Date: Thu, 2 Mar 2023 10:06:05 -0500 Subject: [PATCH] some pyl issues --- .../bin/get_bpmn_json_for_process_instance | 19 ++++++++++--------- .../routes/process_api_blueprint.py | 11 ++++------- 2 files changed, 14 insertions(+), 16 deletions(-) diff --git a/spiffworkflow-backend/bin/get_bpmn_json_for_process_instance b/spiffworkflow-backend/bin/get_bpmn_json_for_process_instance index c6f6588f..37f59a7d 100755 --- a/spiffworkflow-backend/bin/get_bpmn_json_for_process_instance +++ b/spiffworkflow-backend/bin/get_bpmn_json_for_process_instance @@ -1,21 +1,22 @@ #!/usr/bin/env python # ^ for syntax highlighting - """Get the bpmn process json for a given process instance id and store it in /tmp.""" +import json import os import sys -import json from spiffworkflow_backend import create_app from spiffworkflow_backend.models.process_instance import ProcessInstanceModel -from spiffworkflow_backend.services.process_instance_processor import ProcessInstanceProcessor +from spiffworkflow_backend.services.process_instance_processor import ( + ProcessInstanceProcessor, +) -def main(process_instance_id: str): +def main(process_instance_id: str) -> None: """Main.""" os.environ["SPIFFWORKFLOW_BACKEND_ENV"] = "local_development" if os.environ.get("SPIFFWORKFLOW_BACKEND_BPMN_SPEC_ABSOLUTE_DIR") is None: - os.environ["SPIFFWORKFLOW_BACKEND_BPMN_SPEC_ABSOLUTE_DIR"] = "hey" + os.environ["SPIFFWORKFLOW_BACKEND_BPMN_SPEC_ABSOLUTE_DIR"] = "hey" flask_env_key = "FLASK_SESSION_SECRET_KEY" os.environ[flask_env_key] = "whatevs" app = create_app() @@ -30,11 +31,11 @@ def main(process_instance_id: str): f"Could not find a process instance with id: {process_instance_id}" ) - with open( - file_path, "w", encoding="utf-8" - ) as f: + with open(file_path, "w", encoding="utf-8") as f: f.write( - json.dumps(ProcessInstanceProcessor._get_full_bpmn_json(process_instance)) + json.dumps( + ProcessInstanceProcessor._get_full_bpmn_json(process_instance) + ) ) print(f"Saved to {file_path}") diff --git a/spiffworkflow-backend/src/spiffworkflow_backend/routes/process_api_blueprint.py b/spiffworkflow-backend/src/spiffworkflow_backend/routes/process_api_blueprint.py index 1868c62d..1879d0b1 100644 --- a/spiffworkflow-backend/src/spiffworkflow_backend/routes/process_api_blueprint.py +++ b/spiffworkflow-backend/src/spiffworkflow_backend/routes/process_api_blueprint.py @@ -86,7 +86,6 @@ def process_list() -> Any: def _process_data_fetcher( process_instance_id: int, process_data_identifier: str, - modified_process_model_identifier: str, download_file_data: bool, index: Optional[int] = None, ) -> flask.wrappers.Response: @@ -140,9 +139,8 @@ def process_data_show( return _process_data_fetcher( process_instance_id, process_data_identifier, - modified_process_model_identifier, - False, - None, + download_file_data=False, + index=None, ) @@ -156,9 +154,8 @@ def process_data_file_download( return _process_data_fetcher( process_instance_id, process_data_identifier, - modified_process_model_identifier, - True, - index, + download_file_data=True, + index=index, )