<div> <sly-fieldtitle="INFO: Test massage"description="this is a common template for displaying information"style="padding-top: 0; padding-bottom: 0"> <sly-iconslot="icon":options="{ color: '#13ce66', bgColor: '#e1f7eb', rounded: false }"> <iclass="zmdi zmdi-info"></i> </sly-icon> </sly-field> <sly-fieldtitle="WARNING: Test message"description="this is a common template for displaying warnings"> <sly-iconslot="icon":options="{ color: '#fba607', bgColor: '#ffeee3', rounded: false }"> <iclass="zmdi zmdi-alert-triangle"></i> </sly-icon> </sly-field> <sly-fieldtitle="ERROR: Test message"description="this is a common template for displaying errors"> <sly-iconslot="icon":options="{ color: '#de1212', bgColor: '#ffebeb', rounded: false }"> <iclass="zmdi zmdi-alert-circle"></i> </sly-icon> </sly-field></div>
Step 2 — Python Script
To keep the application running all the time, we will use the app.run method.
src/main.py
import supervisely_lib as slyfrom dotenv import load_dotenv # pip install python-dotenv# don't forget to add to requirements.txt!load_dotenv("../debug.env")load_dotenv("../secret_debug.env", override=True)app = sly.AppService()defmain(): sly.logger.info('Application starting...') app.run()if__name__=="__main__": sly.main_wrapper("main", main)
Step 3 — Updating debug.env && config.json
Write TASK_ID While True Script from Part 7 to debug.env
We also need to specify the path along which our application can cache debugging data DEBUG_APP_DIR and DEBUG_CACHE_DIR
{"name":"UI Rendering","type":"app","categories": ["quickstart" ],"description":"There will be some description","docker_image":"supervisely/base-py-sdk:6.1.93","main_script":"chapter-03-headless/part-02-ui-rendering/src/main.py","gui_template":"chapter-03-headless/part-02-ui-rendering/src/gui.html","task_location":"workspace_tasks","icon":"https://img.icons8.com/color/100/000000/2.png","icon_background":"#FFFFFF"}