Skip to content

Commit

Permalink
fix: the annoying string dict
Browse files Browse the repository at this point in the history
  • Loading branch information
MehmedGIT committed Aug 13, 2024
1 parent d1af85b commit 50f73c5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/ocrd_network/cli/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,20 +81,24 @@ def send_processing_job_request(
"path_to_mets": mets,
"description": "OCR-D Network client request",
"input_file_grps": input_file_grp.split(','),
"parameters": parameter if parameter else {},
"agent_type": agent_type
}
if output_file_grp:
req_params["output_file_grps"] = output_file_grp.split(',')
if page_id:
req_params["page_id"] = page_id
if parameter:
if parameter == ['{}']:
req_params["parameters"] = {}
else:
req_params["parameters"] = parameter
if result_queue_name:
req_params["result_queue_name"] = result_queue_name
if callback_url:
req_params["callback_url"] = callback_url
client = Client(server_addr_processing=address)
processing_job_id = client.send_processing_job_request(
processor_name=processor_name, req_params=loads(dumps(req_params)))
processor_name=processor_name, req_params=req_params)
assert processing_job_id
print(f"Processing job id: {processing_job_id}")
if block:
Expand Down
1 change: 1 addition & 0 deletions src/ocrd_network/server_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ def raise_http_exception(logger: Logger, status_code: int, message: str, error:


def validate_job_input(logger: Logger, processor_name: str, ocrd_tool: dict, job_input: PYJobInput) -> None:
# logger.warning(f"Job input: {job_input}")
if bool(job_input.path_to_mets) == bool(job_input.workspace_id):
message = (
"Wrong processing job input format. "
Expand Down

0 comments on commit 50f73c5

Please sign in to comment.