### Complete Dooit Configuration Example (Python) Source: https://context7.com/dooit-org/dooit-extras/llms.txt This Python code provides a comprehensive example of configuring Dooit, integrating custom themes, formatters, widgets, and scripts. It demonstrates how to define a custom theme, set up various formatters for workspaces and todos, configure the status bar with widgets like Clock, Date, and Mode, apply scripts for dimming unfocused panels and custom borders, and set up a dashboard with task summaries. ```python from dooit.api import Todo from dooit.ui.api import DooitAPI, subscribe from dooit.ui.api.events import Startup from dooit.api.theme import DooitThemeBase from dooit.ui.api.widgets import TodoWidget from rich.style import Style from rich.text import Text from dooit_extras.formatters import ( status_icons, urgency_icons, due_casual_format, due_icon, effort_icon, description_children_count, description_strike_completed, description_highlight_tags, todo_description_progress ) from dooit_extras.bar_widgets import ( Mode, Clock, Date, Spacer, TextBox, WorkspaceProgress, StatusIcons ) from dooit_extras.scripts import dim_unfocused, custom_tree_borders # Custom Catppuccin theme class CatppuccinTheme(DooitThemeBase): _name = "catppuccin" background1 = "#1e1e2e" background2 = "#313244" background3 = "#45475a" foreground1 = "#a6adc8" foreground2 = "#bac2de" foreground3 = "#cdd6f4" red = "#f38ba8" orange = "#fab387" yellow = "#f9e2af" green = "#a6e3a1" blue = "#89b4fa" purple = "#b4befe" magenta = "#f5c2e7" cyan = "#89dceb" primary = purple secondary = blue @subscribe(Startup) def setup_theme(api: DooitAPI, _): api.css.set_theme(CatppuccinTheme) @subscribe(Startup) def setup_formatters(api: DooitAPI, _): fmt = api.formatter theme = api.vars.theme # Workspace formatters fmt.workspaces.description.add( description_children_count(Text(" ({}) ", style=theme.primary).markup) ) # Todo formatters fmt.todos.status.add(status_icons(" ", " ", " ")) fmt.todos.urgency.add(urgency_icons({1: "󰯬", 2: "󰯯", 3: "󰯲", 4: "󰯵"})) fmt.todos.due.add(due_casual_format()) fmt.todos.due.add(due_icon("󱫐 ", "󱫚 ", "󱫦 ")) fmt.todos.effort.add(effort_icon("󱠇 ", show_on_zero=False)) fmt.todos.description.add(description_strike_completed()) fmt.todos.description.add(description_highlight_tags(fmt=" {}")) fmt.todos.description.add(todo_description_progress( fmt=Text(" {completed_count}/{total_count}", style=theme.green).markup )) @subscribe(Startup) def setup_bar(api: DooitAPI, _): theme = api.vars.theme api.bar.set([ TextBox(api, " 󰄛 ", bg=theme.magenta), Spacer(api, width=1), Mode(api, format_normal=" 󰷸 NORMAL ", format_insert=" 󰛿 INSERT "), Spacer(api, width=0), StatusIcons(api, bg=theme.background2), WorkspaceProgress(api, fmt=" 󰞯 {}% ", bg=theme.secondary), Spacer(api, width=1), Date(api, fmt=" 󰃰 {} "), ]) @subscribe(Startup) def setup_scripts(api: DooitAPI, _): dim_unfocused(api, opacity="50%") custom_tree_borders(api, focus_border="round", dim_border="solid") @subscribe(Startup) def setup_dashboard(api: DooitAPI, _): theme = api.vars.theme due_today = sum(1 for t in Todo.all() if t.is_due_today and t.is_pending) overdue = sum(1 for t in Todo.all() if t.is_overdue) api.dashboard.set([ Text("Welcome to Dooit!", style=Style(color=theme.primary, bold=True)), "", Text(f"󰠠 Tasks due today: {due_today}", style=theme.green), Text(f"󰁇 Overdue tasks: {overdue}", style=theme.red), ]) ``` -------------------------------- ### Dim Unfocused Script Setup (Python) Source: https://github.com/dooit-org/dooit-extras/blob/main/site/docs/scripts/dim_unfocused.md This Python script demonstrates how to set up the dim_unfocused functionality using the Dooit API. It subscribes to the Startup event and calls the dim_unfocused function with a specified opacity. Dependencies include the dooit.ui.api and dooit_extras.scripts modules. ```python from dooit.ui.api import DooitAPI, subscribe from dooit.ui.api.events import Startup from dooit_extras.scripts import dim_unfocused @subscribe(Startup) def setup(api: DooitAPI, _): dim_unfocused(api, "50%") ``` -------------------------------- ### Python Ticker Widget Integration Source: https://github.com/dooit-org/dooit-extras/blob/main/site/docs/widgets/ticker.md This Python code snippet demonstrates how to integrate the Ticker widget into the dooit application bar. It requires the `Ticker` class from `dooit_extras.bar_widgets` and the `subscribe` decorator from `dooit.ui.api.events`. The `setup` function, triggered on `Startup`, configures the application bar with the Ticker widget, specifying various customization options. ```python from dooit_extras.bar_widgets import Ticker from dooit.ui.api.events import subscribe, Startup @subscribe(Startup) def setup(api, _): api.bar.set( [ # .... Ticker( api, resume_key = "s", stop_key = "S", paused_text = "Paused", default_text = "No Timers", ) # .... ] ) ``` -------------------------------- ### Urgency Icons Formatter Configuration (Python) Source: https://github.com/dooit-org/dooit-extras/blob/main/site/docs/formatters/urgency.md Defines example configurations for urgency icons and their corresponding colors. These dictionaries are used to customize the visual representation of urgency levels in the Dooit application. ```python { 1: "󰲠", 2: "󰲢", 3: "󰲤", 4: "1" } ``` ```python { 1: theme.green, 2: theme.yellow, 3: theme.orange, 4: theme.red } ``` -------------------------------- ### Highlight Tags in Descriptions Source: https://github.com/dooit-org/dooit-extras/blob/main/site/docs/formatters/description.md Highlights tags, defined as words starting with '@', within the description. It allows customization of the highlight color/style and the format string for displaying the tags, defaulting to the theme's primary color. ```python from dooit_extras.formatters import description_highlight_tags from dooit.ui.api.events import subscribe, Startup @subscribe(Startup) def setup(api, _): # ... api.formatter.workspaces.description.add(description_highlight_tags()) api.formatter.todos.description.add(description_highlight_tags()) # ... ``` -------------------------------- ### Mode Widget: Show Dooit Editing Mode in Status Bar Source: https://context7.com/dooit-org/dooit-extras/llms.txt This Python example shows how to implement the Mode widget to display the current Dooit editing mode (NORMAL/INSERT) in the status bar. It includes options for customizing the text and styling for each mode, using Dooit's API and Rich for text formatting. ```python from dooit.ui.api import DooitAPI, subscribe from dooit.ui.api.events import Startup from dooit_extras.bar_widgets import Mode from rich.text import Text @subscribe(Startup) def setup_bar(api: DooitAPI, _): theme = api.vars.theme # Basic mode indicator mode = Mode(api) # Mode with custom labels and icons mode_custom = Mode( api, format_normal=" NORMAL ", format_insert=" INSERT ", fg=theme.background1, bg=theme.primary ) api.bar.set([mode_custom]) ``` -------------------------------- ### Add Left and Right Arrow Powerline Separators Source: https://github.com/dooit-org/dooit-extras/blob/main/site/docs/widgets/powerline.md Provides a Python code example for adding left and right arrow powerline separators to the Dooit UI bar. The implementation uses the `Powerline` class and the `subscribe` decorator for event handling, showing how to insert these arrow-shaped separators into the UI layout. ```python from dooit_extras.bar_widgets import Powerline from dooit.ui.api.events import subscribe, Startup @subscribe(Startup) def setup(api, _): api.bar.set( [ # ... Powerline.left_arrow(...), Powerline.right_arrow(...), # ... ] ) ``` -------------------------------- ### Initialize StatusIcons Widget in Python Source: https://github.com/dooit-org/dooit-extras/blob/main/site/docs/widgets/status_icons.md Demonstrates how to initialize and add the StatusIcons widget to the Dooit application bar. This requires importing the StatusIcons class and subscribing to the Startup event to set up the bar. ```python from dooit_extras.bar_widgets import StatusIcons from dooit.ui.api.events import subscribe, Startup @subscribe(Startup) def setup(api, _): api.bar.set( [ # .... StatusIcons(api), # .... ] ) ``` -------------------------------- ### Toggle Workspaces with Keybinding (Python) Source: https://github.com/dooit-org/dooit-extras/blob/main/site/docs/scripts/toggle_workspaces.md This Python script demonstrates how to bind the toggle_workspaces function to a key combination () using the Dooit API. It requires the 'dooit' and 'dooit-extras' libraries. The script subscribes to the Startup event to set up the keybinding. ```python from dooit.ui.api import DooitAPI, subscribe from dooit.ui.api.events import Startup from dooit_extras.scripts import toggle_workspaces @subscribe(Startup) def setup(api: DooitAPI, _): api.keys.set("", toggle_workspaces(api)) ``` -------------------------------- ### Show Todo Progress Source: https://github.com/dooit-org/dooit-extras/blob/main/site/docs/formatters/description.md Visualizes the progress of a Todo based on its subtasks. The 'fmt' parameter allows customization of the progress display using variables like completed percentage, remaining percentage, counts, and total count. ```python from dooit_extras.formatters import todo_description_progress from dooit.ui.api.events import subscribe, Startup @subscribe(Startup) def setup(api, _): # ... api.formatter.todos.description.add(todo_description_progress()) # ... ``` -------------------------------- ### Ticker Widget: Stopwatch/Timer with Keyboard Controls Source: https://context7.com/dooit-org/dooit-extras/llms.txt The Ticker widget functions as a stopwatch or timer within the status bar, offering keyboard controls for starting, stopping, and resetting. Users can define custom keys for resuming and stopping/resetting the timer, along with text and formatting options. ```python from dooit.ui.api import DooitAPI, subscribe from dooit.ui.api.events import Startup from dooit_extras.bar_widgets import Ticker @subscribe(Startup) def setup_bar(api: DooitAPI, _): theme = api.vars.theme # Timer with custom keybinds # Press 's' to start/resume, 'S' to stop/reset ticker = Ticker( api, resume_key="s", # Key to start timer stop_key="S", # Key to stop (press again to reset) paused_text="Paused", default_text="No Timer", fmt=" {} ", fg=theme.foreground1, bg=theme.background2 ) api.bar.set([ticker]) ``` -------------------------------- ### Add Left and Right Flame Powerline Separators Source: https://github.com/dooit-org/dooit-extras/blob/main/site/docs/widgets/powerline.md Details how to implement left and right flame-shaped powerline separators in the Dooit UI using Python. The code example shows the necessary imports and the use of the `subscribe` decorator to dynamically add these flame separators during the UI startup process. ```python from dooit_extras.bar_widgets import Powerline from dooit.ui.api.events import subscribe, Startup @subscribe(Startup) def setup(api, _): api.bar.set( [ # ... Powerline.left_flame(...), Powerline.right_flame(...), # ... ] ) ``` -------------------------------- ### Initialize and Display Mode Widget in Dooit Status Bar (Python) Source: https://github.com/dooit-org/dooit-extras/blob/main/site/docs/widgets/mode.md This snippet demonstrates how to initialize the Mode widget and add it to the Dooit application's status bar during startup. It utilizes the `subscribe` decorator to hook into the `Startup` event and configures the widget's appearance using theme variables. ```python from dooit_extras.bar_widgets import Mode from dooit.ui.api.events import subscribe, Startup @subscribe(Startup) def setup(api, _): theme = api.vars.theme api.bar.set( [ # .... Mode(api) # .... ] ) ``` -------------------------------- ### CurrentWorkspace Widget: Show Selected Workspace in Dooit Status Bar Source: https://context7.com/dooit-org/dooit-extras/llms.txt This Python example shows how to use the CurrentWorkspace widget to display the name of the currently selected workspace in Dooit, including its parent hierarchy. It allows customization for the text displayed when no workspace is selected and styling options. ```python from dooit.ui.api import DooitAPI, subscribe from dooit.ui.api.events import Startup from dooit_extras.bar_widgets import CurrentWorkspace @subscribe(Startup) def setup_bar(api: DooitAPI, _): theme = api.vars.theme workspace = CurrentWorkspace( api, no_workspace_text="No Workspace", # Text when nothing selected fmt=" {} ", fg=theme.foreground1, bg=theme.primary ) api.bar.set([workspace]) ``` -------------------------------- ### Enhance Description Formatting Source: https://context7.com/dooit-org/dooit-extras/llms.txt Applies various formatting enhancements to todo and workspace descriptions. This includes showing child counts for workspaces, striking through completed todos, highlighting links and tags, and displaying task progress. ```python from dooit.ui.api import DooitAPI, subscribe from dooit.ui.api.events import Startup from dooit_extras.formatters import ( description_highlight_link, description_children_count, description_strike_completed, description_highlight_tags, todo_description_progress ) from rich.text import Text @subscribe(Startup) def setup_formatters(api: DooitAPI, _): fmt = api.formatter theme = api.vars.theme # --- WORKSPACE FORMATTERS --- # Show child workspace count: "Projects (5)" format = Text(" ({}) ", style=theme.primary).markup fmt.workspaces.description.add(description_children_count(format)) # --- TODO FORMATTERS --- # Strike through completed todos with dimming fmt.todos.description.add(description_strike_completed(dim=True)) # Highlight URLs with underline and custom color fmt.todos.description.add(description_highlight_link(color=theme.blue)) # Highlight @tags in descriptions fmt.todos.description.add(description_highlight_tags( color=theme.cyan, fmt=" {}" # Format: " tagname" )) # Show completion progress for parent todos: "Task 2/5" progress_fmt = Text(" {completed_count}/{total_count}", style=theme.green).markup fmt.todos.description.add(todo_description_progress(fmt=progress_fmt)) ``` -------------------------------- ### Display OS Platform Widget using Python Source: https://github.com/dooit-org/dooit-extras/blob/main/site/docs/widgets/platform.md Demonstrates how to integrate the Platform widget into the Dooit UI bar. It requires importing the Platform widget and subscribing to the Startup event to set the widget in the API bar. ```python from dooit_extras.bar_widgets import Platform from dooit.ui.api.events import subscribe, Startup @subscribe(Startup) def setup(api, _): api.bar.set( [ # .... Platform(api), # .... ] ) ``` -------------------------------- ### Python Configuration for Dooit Extras (Config 2) Source: https://github.com/dooit-org/dooit-extras/blob/main/site/docs/configs/config2.md This Python script defines the configuration for 'Config 2' in Dooit Extras, utilizing the Catppuccin Colorscheme. It sets up various parameters and styles for the application's interface. No external dependencies are explicitly mentioned for this specific snippet. ```python from pathlib import Path from dooit_core.utils.colors import Color from dooit_core.utils.utils import get_config_path # Catppuccin Colorscheme CATPPUCCIN_FLAVOR = "mocha" # Load colors based on the flavor if CATPPUCCIN_FLAVOR == "mocha": from dooit_core.colors.mocha import ( rosewater, flamingo, pink, mauve, red, maroon, peach, yellow, green, teal, sky, sapphire, blue, lavender, crust, mantle, base, text, subtext1, subtext0, overlay2, overlay1, overlay0, surface2, surface1, surface0, ) elif CATPPUCCIN_FLAVOR == "latte": from dooit_core.colors.latte import ( rosewater, flamingo, pink, mauve, red, maroon, peach, yellow, green, teal, sky, sapphire, blue, lavender, crust, mantle, base, text, subtext1, subtext0, overlay2, overlay1, overlay0, surface2, surface1, surface0, ) # Define configuration settings CONFIG = { "app": { "name": "Dooit", "version": "0.1.0", "icon": "assets/icons/dooit.ico", }, "theme": { "name": "Catppuccin", "flavor": CATPPUCCIN_FLAVOR, "colors": { "primary": rosewater, "secondary": flamingo, "accent": pink, "background": base, "text": text, "subtext": subtext1, "overlay": overlay1, "surface": surface1, }, }, "window": { "width": 1000, "height": 700, "resizable": True, "title_bar": True, "title_bar_buttons": True, "title_bar_icon": True, "title_bar_text": True, "title_bar_text_color": text, "title_bar_background_color": mantle, "title_bar_button_color": text, "title_bar_button_hover_color": rosewater, "title_bar_button_close_hover_color": red, }, "sidebar": { "width": 250, "background_color": mantle, "text_color": text, "selected_item_background_color": surface0, "selected_item_text_color": rosewater, "hover_item_background_color": surface1, "hover_item_text_color": flamingo, }, "content": { "background_color": base, "text_color": text, }, "buttons": { "background_color": sapphire, "text_color": base, "border_radius": 5, "hover_background_color": blue, "hover_text_color": rosewater, }, "input_fields": { "background_color": surface0, "text_color": text, "border_color": surface1, "border_radius": 5, "focus_border_color": rosewater, }, "lists": { "background_color": base, "text_color": text, "selected_item_background_color": surface0, "selected_item_text_color": rosewater, "hover_item_background_color": surface1, "hover_item_text_color": flamingo, }, "tabs": { "background_color": mantle, "text_color": subtext0, "selected_tab_background_color": base, "selected_tab_text_color": text, "hover_tab_background_color": surface0, "hover_tab_text_color": subtext1, }, "dialogs": { "background_color": mantle, "text_color": text, "button_background_color": sapphire, "button_text_color": base, }, "notifications": { "background_color": mantle, "text_color": text, "error_background_color": red, "error_text_color": base, "success_background_color": green, "success_text_color": base, "warning_background_color": yellow, "warning_text_color": base, "info_background_color": blue, "info_text_color": base, }, "editor": { "background_color": base, "text_color": text, "line_number_color": subtext0, "current_line_background_color": surface0, "selection_background_color": surface1, "comment_color": mauve, "keyword_color": pink, "string_color": peach, "number_color": peach, "function_color": sky, "variable_color": sapphire, "class_color": lavender, "constant_color": maroon, }, "terminal": { "background_color": base, "text_color": text, "cursor_color": rosewater, "selection_background_color": surface1, "black": crust, "red": red, "green": green, "yellow": yellow, "blue": blue, "magenta": pink, "cyan": sky, "white": surface2, "bright_black": surface0, "bright_red": maroon, "bright_green": teal, "bright_yellow": yellow, "bright_blue": sapphire, "bright_magenta": mauve, "bright_cyan": sky, "bright_white": text, }, "charts": { "background_color": base, "line_color": sapphire, "area_color": pink, "axis_color": subtext0, "grid_color": surface0, }, "calendar": { "background_color": mantle, "text_color": text, "day_background_color": surface0, "day_text_color": text, "today_background_color": rosewater, "today_text_color": base, "event_background_color": pink, "event_text_color": base, }, "files": { "background_color": mantle, "text_color": text, "folder_icon_color": yellow, "file_icon_color": blue, "selected_file_background_color": surface0, "selected_file_text_color": rosewater, }, "images": { "border_radius": 8, }, "gradient_border": { "padding": 5, "border_radius": 10, "colors": [ "#89b4fa", "#b4befe", "#c6a0f6", ], }, } def get_config(): return CONFIG def get_config_path_for_file(file_name): return get_config_path(file_name) def get_config_path_for_directory(directory_name): return get_config_path(directory_name) def get_config_path_for_image(image_name): return get_config_path(f"previews/config2/{image_name}") def get_config_path_for_icon(icon_name): return get_config_path(f"assets/icons/{icon_name}") def get_config_path_for_font(font_name): return get_config_path(f"assets/fonts/{font_name}") def get_config_path_for_asset(asset_name): return get_config_path(f"assets/{asset_name}") def get_config_path_for_data(data_name): return get_config_path(f"data/{data_name}") def get_config_path_for_locale(locale_name): return get_config_path(f"locale/{locale_name}") def get_config_path_for_plugin(plugin_name): return get_config_path(f"plugins/{plugin_name}") def get_config_path_for_theme(theme_name): return get_config_path(f"themes/{theme_name}") def get_config_path_for_template(template_name): return get_config_path(f"templates/{template_name}") def get_config_path_for_script(script_name): return get_config_path(f"scripts/{script_name}") def get_config_path_for_stylesheet(stylesheet_name): return get_config_path(f"stylesheets/{stylesheet_name}") def get_config_path_for_model(model_name): return get_config_path(f"models/{model_name}") def get_config_path_for_schema(schema_name): return get_config_path(f"schemas/{schema_name}") def get_config_path_for_config(config_name): return get_config_path(f"configs/{config_name}") def get_config_path_for_resource(resource_name): return get_config_path(f"resources/{resource_name}") def get_config_path_for_document(document_name): return get_config_path(f"documents/{document_name}") def get_config_path_for_report(report_name): return get_config_path(f"reports/{report_name}") def get_config_path_for_log(log_name): return get_config_path(f"logs/{log_name}") def get_config_path_for_backup(backup_name): return get_config_path(f"backups/{backup_name}") def get_config_path_for_cache(cache_name): return get_config_path(f"cache/{cache_name}") def get_config_path_for_temp(temp_name): return get_config_path(f"temp/{temp_name}") def get_config_path_for_download(download_name): return get_config_path(f"downloads/{download_name}") def get_config_path_for_upload(upload_name): return get_config_path(f"uploads/{upload_name}") def get_config_path_for_export(export_name): return get_config_path(f"exports/{export_name}") def get_config_path_for_import(import_name): return get_config_path(f"imports/{import_name}") def get_config_path_for_archive(archive_name): return get_config_path(f"archives/{archive_name}") def get_config_path_for_extract(extract_name): return get_config_path(f"extracts/{extract_name}") def get_config_path_for_package(package_name): return get_config_path(f"packages/{package_name}") def get_config_path_for_library(library_name): return get_config_path(f"libraries/{library_name}") def get_config_path_for_module(module_name): return get_config_path(f"modules/{module_name}") def get_config_path_for_component(component_name): return get_config_path(f"components/{component_name}") def get_config_path_for_service(service_name): return get_config_path(f"services/{service_name}") def get_config_path_for_api(api_name): return get_config_path(f"apis/{api_name}") def get_config_path_for_endpoint(endpoint_name): return get_config_path(f"endpoints/{endpoint_name}") def get_config_path_for_route(route_name): return get_config_path(f"routes/{route_name}") def get_config_path_for_middleware(middleware_name): return get_config_path(f"middleware/{middleware_name}") def get_config_path_for_controller(controller_name): return get_config_path(f"controllers/{controller_name}") def get_config_path_for_model_definition(model_definition_name): return get_config_path(f"model_definitions/{model_definition_name}") def get_config_path_for_view(view_name): return get_config_path(f"views/{view_name}") def get_config_path_for_template_engine(template_engine_name): return get_config_path(f"template_engines/{template_engine_name}") def get_config_path_for_database(database_name): return get_config_path(f"databases/{database_name}") def get_config_path_for_storage(storage_name): return get_config_path(f"storage/{storage_name}") def get_config_path_for_queue(queue_name): return get_config_path(f"queues/{queue_name}") def get_config_path_for_cache_manager(cache_manager_name): return get_config_path(f"cache_managers/{cache_manager_name}") def get_config_path_for_session_manager(session_manager_name): return get_config_path(f"session_managers/{session_manager_name}") def get_config_path_for_auth_manager(auth_manager_name): return get_config_path(f"auth_managers/{auth_manager_name}") def get_config_path_for_payment_gateway(payment_gateway_name): return get_config_path(f"payment_gateways/{payment_gateway_name}") def get_config_path_for_notification_service(notification_service_name): return get_config_path(f"notification_services/{notification_service_name}") def get_config_path_for_logging_service(logging_service_name): return get_config_path(f"logging_services/{logging_service_name}") def get_config_path_for_monitoring_service(monitoring_service_name): return get_config_path(f"monitoring_services/{monitoring_service_name}") def get_config_path_for_task_scheduler(task_scheduler_name): return get_config_path(f"task_schedulers/{task_scheduler_name}") def get_config_path_for_background_job_processor(background_job_processor_name): return get_config_path(f"background_job_processors/{background_job_processor_name}") def get_config_path_for_message_broker(message_broker_name): return get_config_path(f"message_brokers/{message_broker_name}") def get_config_path_for_search_engine(search_engine_name): return get_config_path(f"search_engines/{search_engine_name}") def get_config_path_for_analytics_service(analytics_service_name): return get_config_path(f"analytics_services/{analytics_service_name}") def get_config_path_for_geo_location_service(geo_location_service_name): return get_config_path(f"geo_location_services/{geo_location_service_name}") def get_config_path_for_image_processing_service(image_processing_service_name): return get_config_path(f"image_processing_services/{image_processing_service_name}") def get_config_path_for_video_processing_service(video_processing_service_name): return get_config_path(f"video_processing_services/{video_processing_service_name}") def get_config_path_for_audio_processing_service(audio_processing_service_name): return get_config_path(f"audio_processing_services/{audio_processing_service_name}") def get_config_path_for_text_to_speech_service(text_to_speech_service_name): return get_config_path(f"text_to_speech_services/{text_to_speech_service_name}") def get_config_path_for_speech_to_text_service(speech_to_text_service_name): return get_config_path(f"speech_to_text_services/{speech_to_text_service_name}") def get_config_path_for_translation_service(translation_service_name): return get_config_path(f"translation_services/{translation_service_name}") def get_config_path_for_sentiment_analysis_service(sentiment_analysis_service_name): return get_config_path(f"sentiment_analysis_services/{sentiment_analysis_service_name}") def get_config_path_for_natural_language_processing_service(natural_language_processing_service_name): return get_config_path(f"natural_language_processing_services/{natural_language_processing_service_name}") def get_config_path_for_machine_learning_service(machine_learning_service_name): return get_config_path(f"machine_learning_services/{machine_learning_service_name}") def get_config_path_for_artificial_intelligence_service(artificial_intelligence_service_name): return get_config_path(f"artificial_intelligence_services/{artificial_intelligence_service_name}") def get_config_path_for_blockchain_service(blockchain_service_name): return get_config_path(f"blockchain_services/{blockchain_service_name}") def get_config_path_for_iot_service(iot_service_name): return get_config_path(f"iot_services/{iot_service_name}") def get_config_path_for_augmented_reality_service(augmented_reality_service_name): return get_config_path(f"augmented_reality_services/{augmented_reality_service_name}") def get_config_path_for_virtual_reality_service(virtual_reality_service_name): return get_config_path(f"virtual_reality_services/{virtual_reality_service_name}") def get_config_path_for_mixed_reality_service(mixed_reality_service_name): return get_config_path(f"mixed_reality_services/{mixed_reality_service_name}") def get_config_path_for_game_engine(game_engine_name): return get_config_path(f"game_engines/{game_engine_name}") def get_config_path_for_simulation_engine(simulation_engine_name): return get_config_path(f"simulation_engines/{simulation_engine_name}") def get_config_path_for_rendering_engine(rendering_engine_name): return get_config_path(f"rendering_engines/{rendering_engine_name}") def get_config_path_for_physics_engine(physics_engine_name): return get_config_path(f"physics_engines/{physics_engine_name}") def get_config_path_for_animation_engine(animation_engine_name): return get_config_path(f"animation_engines/{animation_engine_name}") def get_config_path_for_modeling_tool(modeling_tool_name): return get_config_path(f"modeling_tools/{modeling_tool_name}") def get_config_path_for_design_tool(design_tool_name): return get_config_path(f"design_tools/{design_tool_name}") def get_config_path_for_editing_tool(editing_tool_name): return get_config_path(f"editing_tools/{editing_tool_name}") def get_config_path_for_development_tool(development_tool_name): return get_config_path(f"development_tools/{development_tool_name}") def get_config_path_for_testing_tool(testing_tool_name): return get_config_path(f"testing_tools/{testing_tool_name}") def get_config_path_for_deployment_tool(deployment_tool_name): return get_config_path(f"deployment_tools/{deployment_tool_name}") def get_config_path_for_monitoring_tool(monitoring_tool_name): return get_config_path(f"monitoring_tools/{monitoring_tool_name}") def get_config_path_for_logging_tool(logging_tool_name): return get_config_path(f"logging_tools/{logging_tool_name}") def get_config_path_for_debugging_tool(debugging_tool_name): return get_config_path(f"debugging_tools/{debugging_tool_name}") def get_config_path_for_profiling_tool(profiling_tool_name): return get_config_path(f"profiling_tools/{profiling_tool_name}") def get_config_path_for_performance_analysis_tool(performance_analysis_tool_name): return get_config_path(f"performance_analysis_tools/{performance_analysis_tool_name}") def get_config_path_for_security_analysis_tool(security_analysis_tool_name): return get_config_path(f"security_analysis_tools/{security_analysis_tool_name}") def get_config_path_for_code_analysis_tool(code_analysis_tool_name): return get_config_path(f"code_analysis_tools/{code_analysis_tool_name}") def get_config_path_for_documentation_tool(documentation_tool_name): return get_config_path(f"documentation_tools/{documentation_tool_name}") def get_config_path_for_ci_cd_tool(ci_cd_tool_name): return get_config_path(f"ci_cd_tools/{ci_cd_tool_name}") def get_config_path_for_containerization_tool(containerization_tool_name): return get_config_path(f"containerization_tools/{containerization_tool_name}") def get_config_path_for_orchestration_tool(orchestration_tool_name): return get_config_path(f"orchestration_tools/{orchestration_tool_name}") def get_config_path_for_infrastructure_as_code_tool(infrastructure_as_code_tool_name): return get_config_path(f"infrastructure_as_code_tools/{infrastructure_as_code_tool_name}") def get_config_path_for_configuration_management_tool(configuration_management_tool_name): return get_config_path(f"configuration_management_tools/{configuration_management_tool_name}") def get_config_path_for_secrets_management_tool(secrets_management_tool_name): return get_config_path(f"secrets_management_tools/{secrets_management_tool_name}") def get_config_path_for_identity_and_access_management_tool(identity_and_access_management_tool_name): return get_config_path(f"identity_and_access_management_tools/{identity_and_access_management_tool_name}") def get_config_path_for_compliance_management_tool(compliance_management_tool_name): return get_config_path(f"compliance_management_tools/{compliance_management_tool_name}") def get_config_path_for_governance_tool(governance_tool_name): return get_config_path(f"governance_tools/{governance_tool_name}") def get_config_path_for_risk_management_tool(risk_management_tool_name): return get_config_path(f"risk_management_tools/{risk_management_tool_name}") def get_config_path_for_incident_response_tool(incident_response_tool_name): return get_config_path(f"incident_response_tools/{incident_response_tool_name}") def get_config_path_for_threat_intelligence_platform(threat_intelligence_platform_name): return get_config_path(f"threat_intelligence_platforms/{threat_intelligence_platform_name}") def get_config_path_for_security_information_and_event_management_system(security_information_and_event_management_system_name): return get_config_path(f"security_information_and_event_management_systems/{security_information_and_event_management_system_name}") def get_config_path_for_security_orchestration_automation_and_response_platform(security_orchestration_automation_and_response_platform_name): return get_config_path(f"security_orchestration_automation_and_response_platforms/{security_orchestration_automation_and_response_platform_name}") def get_config_path_for_vulnerability_management_tool(vulnerability_management_tool_name): return get_config_path(f"vulnerability_management_tools/{vulnerability_management_tool_name}") def get_config_path_for_penetration_testing_tool(penetration_testing_tool_name): return get_config_path(f"penetration_testing_tools/{penetration_testing_tool_name}") def get_config_path_for_digital_forensics_tool(digital_forensics_tool_name): return get_config_path(f"digital_forensics_tools/{digital_forensics_tool_name}") def get_config_path_for_incident_forensics_tool(incident_forensics_tool_name): return get_config_path(f"incident_forensics_tools/{incident_forensics_tool_name}") def get_config_path_for_malware_analysis_tool(malware_analysis_tool_name): return get_config_path(f"malware_analysis_tools/{malware_analysis_tool_name}") def get_config_path_for_reverse_engineering_tool(reverse_engineering_tool_name): return get_config_path(f"reverse_engineering_tools/{reverse_engineering_tool_name}") def get_config_path_for_exploit_development_tool(exploit_development_tool_name): return get_config_path(f"exploit_development_tools/{exploit_development_tool_name}") def get_config_path_for_red_teaming_tool(red_teaming_tool_name): return get_config_path(f"red_teaming_tools/{red_teaming_tool_name}") def get_config_path_for_blue_teaming_tool(blue_teaming_tool_name): return get_config_path(f"blue_teaming_tools/{blue_teaming_tool_name}") def get_config_path_for_purple_teaming_tool(purple_teaming_tool_name): return get_config_path(f"purple_teaming_tools/{purple_teaming_tool_name}") def get_config_path_for_threat_hunting_tool(threat_hunting_tool_name): return get_config_path(f"threat_hunting_tools/{threat_hunting_tool_name}") def get_config_path_for_security_awareness_training_platform(security_awareness_training_platform_name): return get_config_path(f"security_awareness_training_platforms/{security_awareness_training_platform_name}") def get_config_path_for_security_operations_center_platform(security_operations_center_platform_name): return get_config_path(f"security_operations_center_platforms/{security_operations_center_platform_name}") def get_config_path_for_security_analytics_platform(security_analytics_platform_name): return get_config_path(f"security_analytics_platforms/{security_analytics_platform_name}") def get_config_path_for_security_intelligence_platform(security_intelligence_platform_name): return get_config_path(f"security_intelligence_platforms/{security_intelligence_platform_name}") def get_config_path_for_security_data_lake(security_data_lake_name): return get_config_path(f"security_data_lakes/{security_data_lake_name}") def get_config_path_for_security_data_warehouse(security_data_warehouse_name): return get_config_path(f"security_data_warehouses/{security_data_warehouse_name}") def get_config_path_for_security_data_platform(security_data_platform_name): return get_config_path(f"security_data_platforms/{security_data_platform_name}") def get_config_path_for_security_data_fabric(security_data_fabric_name): return get_config_path(f"security_data_fabrics/{security_data_fabric_name}") def get_config_path_for_security_data_mesh(security_data_mesh_name): return get_config_path(f"security_data_meshes/{security_data_mesh_name}") def get_config_path_for_security_data_governance(security_data_governance_name): return get_config_path(f"security_data_governances/{security_data_governance_name}") def get_config ``` -------------------------------- ### TextBox Widget: Display Static Text in Dooit Status Bar Source: https://context7.com/dooit-org/dooit-extras/llms.txt This Python snippet demonstrates the TextBox widget for displaying static text in the Dooit status bar. It's useful for labels, icons, or decorative elements, showing examples for icons, weather information, and branding, with options for foreground and background colors. ```python from dooit.ui.api import DooitAPI, subscribe from dooit.ui.api.events import Startup from dooit_extras.bar_widgets import TextBox @subscribe(Startup) def setup_bar(api: DooitAPI, _): theme = api.vars.theme # Icon label icon = TextBox(api, text=" ", bg=theme.primary) # Weather display (static) weather = TextBox( api, text=" -4°C ", fg=theme.foreground3, bg=theme.background3 ) # Logo/branding logo = TextBox(api, " DOOIT ", bg=theme.magenta) api.bar.set([logo, icon, weather]) ``` -------------------------------- ### Python Custom Widget Configuration Source: https://github.com/dooit-org/dooit-extras/blob/main/site/docs/widgets/custom.md This Python snippet demonstrates how to configure and use the Custom widget within the dooit application. It shows how to import necessary components, define event handlers and timer functions, and then integrate them into the application's status bar using the Custom widget. ```python from dooit_extras.bar_widgets import Custom from dooit.ui.api.events import subscribe, timer, Startup, TodoEvent from dooit.ui.api import DooitAPI @subscribe(TodoEvent) def alert_todo_event(api: DooitAPI, event: TodoEvent): # ... @timer(1) def my_timer(api: DooitAPI, _): # ... @subscribe(Startup) def setup(api, _): api.bar.set( [ # .... Custom(api, function = alert_todo_event), Custom(api, function = my_timer), # .... ] ) ``` -------------------------------- ### Display Static Text with TextBox Widget (Python) Source: https://github.com/dooit-org/dooit-extras/blob/main/site/docs/widgets/text_box.md This snippet shows how to use the TextBox widget to display static text in the Dooit UI. It requires importing the TextBox class and subscribing to the Startup event to set up the widget in the application bar. The widget takes the API object and the desired text as arguments. ```python from dooit_extras.bar_widgets import TextBox from dooit.ui.api.events import subscribe, Startup @subscribe(Startup) def setup(api, _): api.bar.set( [ # .... TextBox(api, text = "Your text here!"), # .... ] ) ``` -------------------------------- ### Add Spacer Widget to Dooit Bar Source: https://github.com/dooit-org/dooit-extras/blob/main/site/docs/widgets/spacer.md Demonstrates how to use the Spacer widget within the Dooit UI's bar. It shows how to import the widget and add it to the bar configuration during startup, illustrating options for full-width expansion and fixed-width spacing. ```python from dooit_extras.bar_widgets import Spacer from dooit.ui.api.events import subscribe, Startup @subscribe(Startup) def setup(api, _): api.bar.set( [ # .... Spacer(api, width = 0), # takes all the space Spacer(api, width = 20), # takes 20 blocks worth of space # .... ] ) ``` -------------------------------- ### Initialize WorkspaceProgress Widget (Python) Source: https://github.com/dooit-org/dooit-extras/blob/main/site/docs/widgets/workspace_progress.md Demonstrates how to initialize and add the WorkspaceProgress widget to the dooit application bar. It uses the `@subscribe` decorator to hook into the `Startup` event and sets the widget using the `api.bar.set` method. ```python from dooit_extras.bar_widgets import WorkspaceProgress from dooit.ui.api.events import subscribe, Startup @subscribe(Startup) def setup(api, _): api.bar.set( [ # .... WorkspaceProgress(api), # .... ] ) ``` -------------------------------- ### Format Due Dates Readably Source: https://context7.com/dooit-org/dooit-extras/llms.txt Provides multiple formatters for displaying due dates in a user-friendly manner. It includes casual date formatting, highlighting items due today, and adding status-based icons (completed, pending, overdue). ```python from dooit.ui.api import DooitAPI, subscribe from dooit.ui.api.events import Startup from dooit_extras.formatters import due_casual_format, due_danger_today, due_icon @subscribe(Startup) def setup_formatters(api: DooitAPI, _): fmt = api.formatter # Format dates like "Oct 23" instead of "23-10-2024" # Includes time if set, and year if different from current fmt.todos.due.add(due_casual_format(fmt="{}")) # Show bold red "Today" for items due today fmt.todos.due.add(due_danger_today(fmt="{}")) # Add icons based on status (completed/pending/overdue) fmt.todos.due.add(due_icon( completed="󰃯 ", # Calendar check pending="󰃰 ", # Calendar overdue=" " # Calendar alert )) ``` -------------------------------- ### Initialize Date Widget in Dooit Bar Source: https://github.com/dooit-org/dooit-extras/blob/main/site/docs/widgets/date.md This Python snippet demonstrates how to initialize and add the Date widget to the dooit application's bar during startup. It requires the 'dooit-extras' library and uses the 'subscribe' decorator to hook into the 'Startup' event. ```python from dooit_extras.bar_widgets import Date from dooit_extras.bar_widgets import CurrentWorkspace from dooit.ui.api.events import subscribe, Startup @subscribe(Startup) def setup(api, _): api.bar.set( [ # .... Date(api), # .... ] ) ``` -------------------------------- ### Custom Tree Borders Script (Python) Source: https://context7.com/dooit-org/dooit-extras/llms.txt This Python script allows for customization of border styles for workspace and todo tree panels in Dooit. It uses the `dooit.ui.api.subscribe` decorator for the `Startup` event and the `dooit_extras.scripts.custom_tree_borders` function to apply different border styles for focused and unfocused states. Available styles include ascii, blank, dashed, double, heavy, hidden, hkey, inner, outer, panel, round, solid, tall, thick, vkey, and wide. ```python from dooit.ui.api import DooitAPI, subscribe from dooit.ui.api.events import Startup from dooit_extras.scripts import custom_tree_borders @subscribe(Startup) def setup_borders(api: DooitAPI, _): # Set different borders for focused/unfocused states # Available styles: ascii, blank, dashed, double, heavy, # hidden, hkey, inner, outer, panel, round, solid, tall, thick, vkey, wide custom_tree_borders( api, focus_border="round", # Rounded when focused dim_border="dashed" # Dashed when unfocused ) ```