-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
353e496
commit 2ec639c
Showing
4 changed files
with
34 additions
and
2 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# supervisely==6.73.128 | ||
|
||
git+https://github.com/supervisely/supervisely.git@update-app-workflow |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# This module contains the functions that are used to configure the input and output of the workflow for the current app. | ||
|
||
import supervisely as sly | ||
from typing import Union | ||
|
||
def workflow_input(api: sly.Api, project_id: int): | ||
api.app.workflow.add_input_project(project_id) | ||
sly.logger.debug(f"Workflow: Input project - {project_id}") | ||
|
||
def workflow_output(api: sly.Api, file: Union[int, sly.api.file_api.FileInfo]): | ||
try: | ||
if isinstance(file, int): | ||
file = api.file.get_info_by_id(file) | ||
meta = {"customRelationSettings": { | ||
"icon": { | ||
"icon": "zmdi-archive", | ||
"color": "#33c94c", | ||
"backgroundColor": "#d9f7e4" | ||
}, | ||
"title": f"<h4>{file.name}</h4>", | ||
"mainLink": {"url": f"/files/{file.id}/true/?teamId={file.team_id}", "title": "Download"} | ||
}} | ||
api.app.workflow.add_output_file(file, meta=meta) | ||
sly.logger.debug(f"Workflow: Output file - {file}") | ||
except Exception as e: | ||
sly.logger.debug(f"Failed to add output to the workflow: {repr(e)}") |