hspylib-clitt 0.9.118__py3-none-any.whl → 0.9.119__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of hspylib-clitt might be problematic. Click here for more details.
- build/lib/build/lib/build/lib/build/lib/clitt/__classpath__.py +28 -0
- build/lib/build/lib/build/lib/build/lib/clitt/__init__.py +13 -0
- build/lib/build/lib/build/lib/build/lib/clitt/__main__.py +139 -0
- build/lib/build/lib/build/lib/build/lib/clitt/addons/__init__.py +12 -0
- build/lib/build/lib/build/lib/build/lib/clitt/addons/appman/__init__.py +13 -0
- build/lib/build/lib/build/lib/build/lib/clitt/addons/appman/appman.py +305 -0
- build/lib/build/lib/build/lib/build/lib/clitt/addons/appman/appman_enums.py +39 -0
- build/lib/build/lib/build/lib/build/lib/clitt/addons/appman/templates/__init__.py +11 -0
- build/lib/build/lib/build/lib/build/lib/clitt/addons/widman/__init__.py +14 -0
- build/lib/build/lib/build/lib/build/lib/clitt/addons/widman/widget.py +70 -0
- build/lib/build/lib/build/lib/build/lib/clitt/addons/widman/widget_entry.py +54 -0
- build/lib/build/lib/build/lib/build/lib/clitt/addons/widman/widgets/__init__.py +14 -0
- build/lib/build/lib/build/lib/build/lib/clitt/addons/widman/widgets/widget_free.py +110 -0
- build/lib/build/lib/build/lib/build/lib/clitt/addons/widman/widgets/widget_punch.py +246 -0
- build/lib/build/lib/build/lib/build/lib/clitt/addons/widman/widgets/widget_send_msg.py +272 -0
- build/lib/build/lib/build/lib/build/lib/clitt/addons/widman/widgets/widget_time_calc.py +146 -0
- build/lib/build/lib/build/lib/build/lib/clitt/addons/widman/widman.py +123 -0
- build/lib/build/lib/build/lib/build/lib/clitt/core/__init__.py +15 -0
- build/lib/build/lib/build/lib/build/lib/clitt/core/exception/__init__.py +11 -0
- build/lib/build/lib/build/lib/build/lib/clitt/core/exception/exceptions.py +19 -0
- build/lib/build/lib/build/lib/build/lib/clitt/core/icons/__init__.py +12 -0
- build/lib/build/lib/build/lib/build/lib/clitt/core/icons/emojis/__init__.py +12 -0
- build/lib/build/lib/build/lib/build/lib/clitt/core/icons/emojis/emojis.py +41 -0
- build/lib/build/lib/build/lib/build/lib/clitt/core/icons/emojis/face_smiling.py +40 -0
- build/lib/build/lib/build/lib/build/lib/clitt/core/icons/font_awesome/__init__.py +18 -0
- build/lib/build/lib/build/lib/build/lib/clitt/core/icons/font_awesome/app_icons.py +55 -0
- build/lib/build/lib/build/lib/build/lib/clitt/core/icons/font_awesome/awesome.py +76 -0
- build/lib/build/lib/build/lib/build/lib/clitt/core/icons/font_awesome/dashboard_icons.py +93 -0
- build/lib/build/lib/build/lib/build/lib/clitt/core/icons/font_awesome/form_icons.py +69 -0
- build/lib/build/lib/build/lib/build/lib/clitt/core/icons/font_awesome/game_icons.py +59 -0
- build/lib/build/lib/build/lib/build/lib/clitt/core/icons/font_awesome/nav_icons.py +42 -0
- build/lib/build/lib/build/lib/build/lib/clitt/core/icons/font_awesome/trickplay_icons.py +39 -0
- build/lib/build/lib/build/lib/build/lib/clitt/core/icons/font_awesome/widget_icons.py +37 -0
- build/lib/build/lib/build/lib/build/lib/clitt/core/preferences.py +87 -0
- build/lib/build/lib/build/lib/build/lib/clitt/core/term/__init__.py +14 -0
- build/lib/build/lib/build/lib/build/lib/clitt/core/term/commons.py +106 -0
- build/lib/build/lib/build/lib/build/lib/clitt/core/term/cursor.py +174 -0
- build/lib/build/lib/build/lib/build/lib/clitt/core/term/screen.py +106 -0
- build/lib/build/lib/build/lib/build/lib/clitt/core/term/terminal.py +202 -0
- build/lib/build/lib/build/lib/build/lib/clitt/core/tui/__init__.py +20 -0
- build/lib/build/lib/build/lib/build/lib/clitt/core/tui/line_input/__init__.py +12 -0
- build/lib/build/lib/build/lib/build/lib/clitt/core/tui/line_input/keyboard_input.py +229 -0
- build/lib/build/lib/build/lib/build/lib/clitt/core/tui/line_input/line_input.py +31 -0
- build/lib/build/lib/build/lib/build/lib/clitt/core/tui/mchoose/__init__.py +12 -0
- build/lib/build/lib/build/lib/build/lib/clitt/core/tui/mchoose/mchoose.py +43 -0
- build/lib/build/lib/build/lib/build/lib/clitt/core/tui/mchoose/menu_choose.py +192 -0
- build/lib/build/lib/build/lib/build/lib/clitt/core/tui/mdashboard/__init__.py +14 -0
- build/lib/build/lib/build/lib/build/lib/clitt/core/tui/mdashboard/dashboard_builder.py +54 -0
- build/lib/build/lib/build/lib/build/lib/clitt/core/tui/mdashboard/dashboard_item.py +31 -0
- build/lib/build/lib/build/lib/build/lib/clitt/core/tui/mdashboard/mdashboard.py +26 -0
- build/lib/build/lib/build/lib/build/lib/clitt/core/tui/mdashboard/menu_dashboard.py +148 -0
- build/lib/build/lib/build/lib/build/lib/clitt/core/tui/menu/__init__.py +16 -0
- build/lib/build/lib/build/lib/build/lib/clitt/core/tui/menu/tui_menu.py +111 -0
- build/lib/build/lib/build/lib/build/lib/clitt/core/tui/menu/tui_menu_action.py +47 -0
- build/lib/build/lib/build/lib/build/lib/clitt/core/tui/menu/tui_menu_factory.py +117 -0
- build/lib/build/lib/build/lib/build/lib/clitt/core/tui/menu/tui_menu_item.py +196 -0
- build/lib/build/lib/build/lib/build/lib/clitt/core/tui/menu/tui_menu_ui.py +98 -0
- build/lib/build/lib/build/lib/build/lib/clitt/core/tui/menu/tui_menu_view.py +57 -0
- build/lib/build/lib/build/lib/build/lib/clitt/core/tui/minput/__init__.py +19 -0
- build/lib/build/lib/build/lib/build/lib/clitt/core/tui/minput/access_type.py +26 -0
- build/lib/build/lib/build/lib/build/lib/clitt/core/tui/minput/field_builder.py +117 -0
- build/lib/build/lib/build/lib/build/lib/clitt/core/tui/minput/form_builder.py +72 -0
- build/lib/build/lib/build/lib/build/lib/clitt/core/tui/minput/form_field.py +180 -0
- build/lib/build/lib/build/lib/build/lib/clitt/core/tui/minput/input_type.py +30 -0
- build/lib/build/lib/build/lib/build/lib/clitt/core/tui/minput/input_validator.py +98 -0
- build/lib/build/lib/build/lib/build/lib/clitt/core/tui/minput/menu_input.py +292 -0
- build/lib/build/lib/build/lib/build/lib/clitt/core/tui/minput/minput.py +44 -0
- build/lib/build/lib/build/lib/build/lib/clitt/core/tui/minput/minput_utils.py +156 -0
- build/lib/build/lib/build/lib/build/lib/clitt/core/tui/mselect/__init__.py +12 -0
- build/lib/build/lib/build/lib/build/lib/clitt/core/tui/mselect/menu_select.py +170 -0
- build/lib/build/lib/build/lib/build/lib/clitt/core/tui/mselect/mselect.py +36 -0
- build/lib/build/lib/build/lib/build/lib/clitt/core/tui/table/__init__.py +12 -0
- build/lib/build/lib/build/lib/build/lib/clitt/core/tui/table/table_enums.py +47 -0
- build/lib/build/lib/build/lib/build/lib/clitt/core/tui/table/table_renderer.py +339 -0
- build/lib/build/lib/build/lib/build/lib/clitt/core/tui/tui_application.py +52 -0
- build/lib/build/lib/build/lib/build/lib/clitt/core/tui/tui_component.py +154 -0
- build/lib/build/lib/build/lib/build/lib/clitt/core/tui/tui_preferences.py +103 -0
- build/lib/build/lib/build/lib/build/lib/clitt/utils/__init__.py +11 -0
- build/lib/build/lib/build/lib/build/lib/clitt/utils/git_utils.py +66 -0
- build/lib/build/lib/build/lib/clitt/__classpath__.py +28 -0
- build/lib/build/lib/build/lib/clitt/__init__.py +13 -0
- build/lib/build/lib/build/lib/clitt/__main__.py +139 -0
- build/lib/build/lib/build/lib/clitt/addons/__init__.py +12 -0
- build/lib/build/lib/build/lib/clitt/addons/appman/__init__.py +13 -0
- build/lib/build/lib/build/lib/clitt/addons/appman/appman.py +305 -0
- build/lib/build/lib/build/lib/clitt/addons/appman/appman_enums.py +39 -0
- build/lib/build/lib/build/lib/clitt/addons/appman/templates/__init__.py +11 -0
- build/lib/build/lib/build/lib/clitt/addons/widman/__init__.py +14 -0
- build/lib/build/lib/build/lib/clitt/addons/widman/widget.py +70 -0
- build/lib/build/lib/build/lib/clitt/addons/widman/widget_entry.py +54 -0
- build/lib/build/lib/build/lib/clitt/addons/widman/widgets/__init__.py +14 -0
- build/lib/build/lib/build/lib/clitt/addons/widman/widgets/widget_free.py +110 -0
- build/lib/build/lib/build/lib/clitt/addons/widman/widgets/widget_punch.py +246 -0
- build/lib/build/lib/build/lib/clitt/addons/widman/widgets/widget_send_msg.py +272 -0
- build/lib/build/lib/build/lib/clitt/addons/widman/widgets/widget_time_calc.py +146 -0
- build/lib/build/lib/build/lib/clitt/addons/widman/widman.py +123 -0
- build/lib/build/lib/build/lib/clitt/core/__init__.py +15 -0
- build/lib/build/lib/build/lib/clitt/core/exception/__init__.py +11 -0
- build/lib/build/lib/build/lib/clitt/core/exception/exceptions.py +19 -0
- build/lib/build/lib/build/lib/clitt/core/icons/__init__.py +12 -0
- build/lib/build/lib/build/lib/clitt/core/icons/emojis/__init__.py +12 -0
- build/lib/build/lib/build/lib/clitt/core/icons/emojis/emojis.py +41 -0
- build/lib/build/lib/build/lib/clitt/core/icons/emojis/face_smiling.py +40 -0
- build/lib/build/lib/build/lib/clitt/core/icons/font_awesome/__init__.py +18 -0
- build/lib/build/lib/build/lib/clitt/core/icons/font_awesome/app_icons.py +55 -0
- build/lib/build/lib/build/lib/clitt/core/icons/font_awesome/awesome.py +76 -0
- build/lib/build/lib/build/lib/clitt/core/icons/font_awesome/dashboard_icons.py +93 -0
- build/lib/build/lib/build/lib/clitt/core/icons/font_awesome/form_icons.py +69 -0
- build/lib/build/lib/build/lib/clitt/core/icons/font_awesome/game_icons.py +59 -0
- build/lib/build/lib/build/lib/clitt/core/icons/font_awesome/nav_icons.py +42 -0
- build/lib/build/lib/build/lib/clitt/core/icons/font_awesome/trickplay_icons.py +39 -0
- build/lib/build/lib/build/lib/clitt/core/icons/font_awesome/widget_icons.py +37 -0
- build/lib/build/lib/build/lib/clitt/core/preferences.py +87 -0
- build/lib/build/lib/build/lib/clitt/core/term/__init__.py +14 -0
- build/lib/build/lib/build/lib/clitt/core/term/commons.py +106 -0
- build/lib/build/lib/build/lib/clitt/core/term/cursor.py +174 -0
- build/lib/build/lib/build/lib/clitt/core/term/screen.py +106 -0
- build/lib/build/lib/build/lib/clitt/core/term/terminal.py +202 -0
- build/lib/build/lib/build/lib/clitt/core/tui/__init__.py +20 -0
- build/lib/build/lib/build/lib/clitt/core/tui/line_input/__init__.py +12 -0
- build/lib/build/lib/build/lib/clitt/core/tui/line_input/keyboard_input.py +229 -0
- build/lib/build/lib/build/lib/clitt/core/tui/line_input/line_input.py +31 -0
- build/lib/build/lib/build/lib/clitt/core/tui/mchoose/__init__.py +12 -0
- build/lib/build/lib/build/lib/clitt/core/tui/mchoose/mchoose.py +43 -0
- build/lib/build/lib/build/lib/clitt/core/tui/mchoose/menu_choose.py +192 -0
- build/lib/build/lib/build/lib/clitt/core/tui/mdashboard/__init__.py +14 -0
- build/lib/build/lib/build/lib/clitt/core/tui/mdashboard/dashboard_builder.py +54 -0
- build/lib/build/lib/build/lib/clitt/core/tui/mdashboard/dashboard_item.py +31 -0
- build/lib/build/lib/build/lib/clitt/core/tui/mdashboard/mdashboard.py +26 -0
- build/lib/build/lib/build/lib/clitt/core/tui/mdashboard/menu_dashboard.py +148 -0
- build/lib/build/lib/build/lib/clitt/core/tui/menu/__init__.py +16 -0
- build/lib/build/lib/build/lib/clitt/core/tui/menu/tui_menu.py +111 -0
- build/lib/build/lib/build/lib/clitt/core/tui/menu/tui_menu_action.py +47 -0
- build/lib/build/lib/build/lib/clitt/core/tui/menu/tui_menu_factory.py +117 -0
- build/lib/build/lib/build/lib/clitt/core/tui/menu/tui_menu_item.py +196 -0
- build/lib/build/lib/build/lib/clitt/core/tui/menu/tui_menu_ui.py +98 -0
- build/lib/build/lib/build/lib/clitt/core/tui/menu/tui_menu_view.py +57 -0
- build/lib/build/lib/build/lib/clitt/core/tui/minput/__init__.py +19 -0
- build/lib/build/lib/build/lib/clitt/core/tui/minput/access_type.py +26 -0
- build/lib/build/lib/build/lib/clitt/core/tui/minput/field_builder.py +117 -0
- build/lib/build/lib/build/lib/clitt/core/tui/minput/form_builder.py +72 -0
- build/lib/build/lib/build/lib/clitt/core/tui/minput/form_field.py +180 -0
- build/lib/build/lib/build/lib/clitt/core/tui/minput/input_type.py +30 -0
- build/lib/build/lib/build/lib/clitt/core/tui/minput/input_validator.py +98 -0
- build/lib/build/lib/build/lib/clitt/core/tui/minput/menu_input.py +292 -0
- build/lib/build/lib/build/lib/clitt/core/tui/minput/minput.py +44 -0
- build/lib/build/lib/build/lib/clitt/core/tui/minput/minput_utils.py +156 -0
- build/lib/build/lib/build/lib/clitt/core/tui/mselect/__init__.py +12 -0
- build/lib/build/lib/build/lib/clitt/core/tui/mselect/menu_select.py +170 -0
- build/lib/build/lib/build/lib/clitt/core/tui/mselect/mselect.py +36 -0
- build/lib/build/lib/build/lib/clitt/core/tui/table/__init__.py +12 -0
- build/lib/build/lib/build/lib/clitt/core/tui/table/table_enums.py +47 -0
- build/lib/build/lib/build/lib/clitt/core/tui/table/table_renderer.py +339 -0
- build/lib/build/lib/build/lib/clitt/core/tui/tui_application.py +52 -0
- build/lib/build/lib/build/lib/clitt/core/tui/tui_component.py +154 -0
- build/lib/build/lib/build/lib/clitt/core/tui/tui_preferences.py +103 -0
- build/lib/build/lib/build/lib/clitt/utils/__init__.py +11 -0
- build/lib/build/lib/build/lib/clitt/utils/git_utils.py +66 -0
- build/lib/build/lib/clitt/__classpath__.py +28 -0
- build/lib/build/lib/clitt/__init__.py +13 -0
- build/lib/build/lib/clitt/__main__.py +139 -0
- build/lib/build/lib/clitt/addons/__init__.py +12 -0
- build/lib/build/lib/clitt/addons/appman/__init__.py +13 -0
- build/lib/build/lib/clitt/addons/appman/appman.py +305 -0
- build/lib/build/lib/clitt/addons/appman/appman_enums.py +39 -0
- build/lib/build/lib/clitt/addons/appman/templates/__init__.py +11 -0
- build/lib/build/lib/clitt/addons/widman/__init__.py +14 -0
- build/lib/build/lib/clitt/addons/widman/widget.py +70 -0
- build/lib/build/lib/clitt/addons/widman/widget_entry.py +54 -0
- build/lib/build/lib/clitt/addons/widman/widgets/__init__.py +14 -0
- build/lib/build/lib/clitt/addons/widman/widgets/widget_free.py +110 -0
- build/lib/build/lib/clitt/addons/widman/widgets/widget_punch.py +246 -0
- build/lib/build/lib/clitt/addons/widman/widgets/widget_send_msg.py +272 -0
- build/lib/build/lib/clitt/addons/widman/widgets/widget_time_calc.py +146 -0
- build/lib/build/lib/clitt/addons/widman/widman.py +123 -0
- build/lib/build/lib/clitt/core/__init__.py +15 -0
- build/lib/build/lib/clitt/core/exception/__init__.py +11 -0
- build/lib/build/lib/clitt/core/exception/exceptions.py +19 -0
- build/lib/build/lib/clitt/core/icons/__init__.py +12 -0
- build/lib/build/lib/clitt/core/icons/emojis/__init__.py +12 -0
- build/lib/build/lib/clitt/core/icons/emojis/emojis.py +41 -0
- build/lib/build/lib/clitt/core/icons/emojis/face_smiling.py +40 -0
- build/lib/build/lib/clitt/core/icons/font_awesome/__init__.py +18 -0
- build/lib/build/lib/clitt/core/icons/font_awesome/app_icons.py +55 -0
- build/lib/build/lib/clitt/core/icons/font_awesome/awesome.py +76 -0
- build/lib/build/lib/clitt/core/icons/font_awesome/dashboard_icons.py +93 -0
- build/lib/build/lib/clitt/core/icons/font_awesome/form_icons.py +69 -0
- build/lib/build/lib/clitt/core/icons/font_awesome/game_icons.py +59 -0
- build/lib/build/lib/clitt/core/icons/font_awesome/nav_icons.py +42 -0
- build/lib/build/lib/clitt/core/icons/font_awesome/trickplay_icons.py +39 -0
- build/lib/build/lib/clitt/core/icons/font_awesome/widget_icons.py +37 -0
- build/lib/build/lib/clitt/core/preferences.py +87 -0
- build/lib/build/lib/clitt/core/term/__init__.py +14 -0
- build/lib/build/lib/clitt/core/term/commons.py +106 -0
- build/lib/build/lib/clitt/core/term/cursor.py +174 -0
- build/lib/build/lib/clitt/core/term/screen.py +106 -0
- build/lib/build/lib/clitt/core/term/terminal.py +202 -0
- build/lib/build/lib/clitt/core/tui/__init__.py +20 -0
- build/lib/build/lib/clitt/core/tui/line_input/__init__.py +12 -0
- build/lib/build/lib/clitt/core/tui/line_input/keyboard_input.py +229 -0
- build/lib/build/lib/clitt/core/tui/line_input/line_input.py +31 -0
- build/lib/build/lib/clitt/core/tui/mchoose/__init__.py +12 -0
- build/lib/build/lib/clitt/core/tui/mchoose/mchoose.py +43 -0
- build/lib/build/lib/clitt/core/tui/mchoose/menu_choose.py +192 -0
- build/lib/build/lib/clitt/core/tui/mdashboard/__init__.py +14 -0
- build/lib/build/lib/clitt/core/tui/mdashboard/dashboard_builder.py +54 -0
- build/lib/build/lib/clitt/core/tui/mdashboard/dashboard_item.py +31 -0
- build/lib/build/lib/clitt/core/tui/mdashboard/mdashboard.py +26 -0
- build/lib/build/lib/clitt/core/tui/mdashboard/menu_dashboard.py +148 -0
- build/lib/build/lib/clitt/core/tui/menu/__init__.py +16 -0
- build/lib/build/lib/clitt/core/tui/menu/tui_menu.py +111 -0
- build/lib/build/lib/clitt/core/tui/menu/tui_menu_action.py +47 -0
- build/lib/build/lib/clitt/core/tui/menu/tui_menu_factory.py +117 -0
- build/lib/build/lib/clitt/core/tui/menu/tui_menu_item.py +196 -0
- build/lib/build/lib/clitt/core/tui/menu/tui_menu_ui.py +98 -0
- build/lib/build/lib/clitt/core/tui/menu/tui_menu_view.py +57 -0
- build/lib/build/lib/clitt/core/tui/minput/__init__.py +19 -0
- build/lib/build/lib/clitt/core/tui/minput/access_type.py +26 -0
- build/lib/build/lib/clitt/core/tui/minput/field_builder.py +117 -0
- build/lib/build/lib/clitt/core/tui/minput/form_builder.py +72 -0
- build/lib/build/lib/clitt/core/tui/minput/form_field.py +180 -0
- build/lib/build/lib/clitt/core/tui/minput/input_type.py +30 -0
- build/lib/build/lib/clitt/core/tui/minput/input_validator.py +98 -0
- build/lib/build/lib/clitt/core/tui/minput/menu_input.py +292 -0
- build/lib/build/lib/clitt/core/tui/minput/minput.py +44 -0
- build/lib/build/lib/clitt/core/tui/minput/minput_utils.py +156 -0
- build/lib/build/lib/clitt/core/tui/mselect/__init__.py +12 -0
- build/lib/build/lib/clitt/core/tui/mselect/menu_select.py +170 -0
- build/lib/build/lib/clitt/core/tui/mselect/mselect.py +36 -0
- build/lib/build/lib/clitt/core/tui/table/__init__.py +12 -0
- build/lib/build/lib/clitt/core/tui/table/table_enums.py +47 -0
- build/lib/build/lib/clitt/core/tui/table/table_renderer.py +339 -0
- build/lib/build/lib/clitt/core/tui/tui_application.py +52 -0
- build/lib/build/lib/clitt/core/tui/tui_component.py +154 -0
- build/lib/build/lib/clitt/core/tui/tui_preferences.py +103 -0
- build/lib/build/lib/clitt/utils/__init__.py +11 -0
- build/lib/build/lib/clitt/utils/git_utils.py +66 -0
- build/lib/clitt/__classpath__.py +28 -0
- build/lib/clitt/__init__.py +13 -0
- build/lib/clitt/__main__.py +139 -0
- build/lib/clitt/addons/__init__.py +12 -0
- build/lib/clitt/addons/appman/__init__.py +13 -0
- build/lib/clitt/addons/appman/appman.py +305 -0
- build/lib/clitt/addons/appman/appman_enums.py +39 -0
- build/lib/clitt/addons/appman/templates/__init__.py +11 -0
- build/lib/clitt/addons/widman/__init__.py +14 -0
- build/lib/clitt/addons/widman/widget.py +70 -0
- build/lib/clitt/addons/widman/widget_entry.py +54 -0
- build/lib/clitt/addons/widman/widgets/__init__.py +14 -0
- build/lib/clitt/addons/widman/widgets/widget_free.py +110 -0
- build/lib/clitt/addons/widman/widgets/widget_punch.py +246 -0
- build/lib/clitt/addons/widman/widgets/widget_send_msg.py +272 -0
- build/lib/clitt/addons/widman/widgets/widget_time_calc.py +146 -0
- build/lib/clitt/addons/widman/widman.py +123 -0
- build/lib/clitt/core/__init__.py +15 -0
- build/lib/clitt/core/exception/__init__.py +11 -0
- build/lib/clitt/core/exception/exceptions.py +19 -0
- build/lib/clitt/core/icons/__init__.py +12 -0
- build/lib/clitt/core/icons/emojis/__init__.py +12 -0
- build/lib/clitt/core/icons/emojis/emojis.py +41 -0
- build/lib/clitt/core/icons/emojis/face_smiling.py +40 -0
- build/lib/clitt/core/icons/font_awesome/__init__.py +18 -0
- build/lib/clitt/core/icons/font_awesome/app_icons.py +55 -0
- build/lib/clitt/core/icons/font_awesome/awesome.py +76 -0
- build/lib/clitt/core/icons/font_awesome/dashboard_icons.py +93 -0
- build/lib/clitt/core/icons/font_awesome/form_icons.py +69 -0
- build/lib/clitt/core/icons/font_awesome/game_icons.py +59 -0
- build/lib/clitt/core/icons/font_awesome/nav_icons.py +42 -0
- build/lib/clitt/core/icons/font_awesome/trickplay_icons.py +39 -0
- build/lib/clitt/core/icons/font_awesome/widget_icons.py +37 -0
- build/lib/clitt/core/preferences.py +87 -0
- build/lib/clitt/core/term/__init__.py +14 -0
- build/lib/clitt/core/term/commons.py +106 -0
- build/lib/clitt/core/term/cursor.py +174 -0
- build/lib/clitt/core/term/screen.py +106 -0
- build/lib/clitt/core/term/terminal.py +202 -0
- build/lib/clitt/core/tui/__init__.py +20 -0
- build/lib/clitt/core/tui/line_input/__init__.py +12 -0
- build/lib/clitt/core/tui/line_input/keyboard_input.py +229 -0
- build/lib/clitt/core/tui/line_input/line_input.py +31 -0
- build/lib/clitt/core/tui/mchoose/__init__.py +12 -0
- build/lib/clitt/core/tui/mchoose/mchoose.py +43 -0
- build/lib/clitt/core/tui/mchoose/menu_choose.py +192 -0
- build/lib/clitt/core/tui/mdashboard/__init__.py +14 -0
- build/lib/clitt/core/tui/mdashboard/dashboard_builder.py +54 -0
- build/lib/clitt/core/tui/mdashboard/dashboard_item.py +31 -0
- build/lib/clitt/core/tui/mdashboard/mdashboard.py +26 -0
- build/lib/clitt/core/tui/mdashboard/menu_dashboard.py +148 -0
- build/lib/clitt/core/tui/menu/__init__.py +16 -0
- build/lib/clitt/core/tui/menu/tui_menu.py +111 -0
- build/lib/clitt/core/tui/menu/tui_menu_action.py +47 -0
- build/lib/clitt/core/tui/menu/tui_menu_factory.py +117 -0
- build/lib/clitt/core/tui/menu/tui_menu_item.py +196 -0
- build/lib/clitt/core/tui/menu/tui_menu_ui.py +98 -0
- build/lib/clitt/core/tui/menu/tui_menu_view.py +57 -0
- build/lib/clitt/core/tui/minput/__init__.py +19 -0
- build/lib/clitt/core/tui/minput/access_type.py +26 -0
- build/lib/clitt/core/tui/minput/field_builder.py +117 -0
- build/lib/clitt/core/tui/minput/form_builder.py +72 -0
- build/lib/clitt/core/tui/minput/form_field.py +180 -0
- build/lib/clitt/core/tui/minput/input_type.py +30 -0
- build/lib/clitt/core/tui/minput/input_validator.py +98 -0
- build/lib/clitt/core/tui/minput/menu_input.py +292 -0
- build/lib/clitt/core/tui/minput/minput.py +44 -0
- build/lib/clitt/core/tui/minput/minput_utils.py +156 -0
- build/lib/clitt/core/tui/mselect/__init__.py +12 -0
- build/lib/clitt/core/tui/mselect/menu_select.py +170 -0
- build/lib/clitt/core/tui/mselect/mselect.py +36 -0
- build/lib/clitt/core/tui/table/__init__.py +12 -0
- build/lib/clitt/core/tui/table/table_enums.py +47 -0
- build/lib/clitt/core/tui/table/table_renderer.py +339 -0
- build/lib/clitt/core/tui/tui_application.py +52 -0
- build/lib/clitt/core/tui/tui_component.py +154 -0
- build/lib/clitt/core/tui/tui_preferences.py +103 -0
- build/lib/clitt/utils/__init__.py +11 -0
- build/lib/clitt/utils/git_utils.py +66 -0
- clitt/.version +1 -1
- clitt/__init__.py +3 -3
- clitt/addons/__init__.py +3 -3
- clitt/addons/appman/__init__.py +3 -3
- clitt/addons/appman/templates/__init__.py +3 -3
- clitt/addons/widman/__init__.py +3 -3
- clitt/addons/widman/widgets/__init__.py +3 -3
- clitt/core/__init__.py +3 -3
- clitt/core/exception/__init__.py +3 -3
- clitt/core/icons/__init__.py +3 -3
- clitt/core/icons/emojis/__init__.py +3 -3
- clitt/core/icons/font_awesome/__init__.py +3 -3
- clitt/core/term/__init__.py +3 -3
- clitt/core/term/commons.py +11 -12
- clitt/core/tui/__init__.py +3 -3
- clitt/core/tui/line_input/__init__.py +3 -3
- clitt/core/tui/mchoose/__init__.py +3 -3
- clitt/core/tui/mdashboard/__init__.py +3 -3
- clitt/core/tui/menu/__init__.py +3 -3
- clitt/core/tui/minput/__init__.py +3 -3
- clitt/core/tui/mselect/__init__.py +3 -3
- clitt/core/tui/table/__init__.py +3 -3
- clitt/utils/__init__.py +3 -3
- {hspylib_clitt-0.9.118.dist-info → hspylib_clitt-0.9.119.dist-info}/METADATA +2 -2
- hspylib_clitt-0.9.119.dist-info/RECORD +413 -0
- {hspylib_clitt-0.9.118.dist-info → hspylib_clitt-0.9.119.dist-info}/top_level.txt +1 -0
- hspylib_clitt-0.9.118.dist-info/RECORD +0 -97
- {hspylib_clitt-0.9.118.dist-info → hspylib_clitt-0.9.119.dist-info}/WHEEL +0 -0
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
# -*- coding: utf-8 -*-
|
|
3
|
+
|
|
4
|
+
"""
|
|
5
|
+
@project: HsPyLib-Clitt
|
|
6
|
+
@package: clitt.core.tui
|
|
7
|
+
@file: tui_component.py
|
|
8
|
+
@created: Tue, 4 May 2021
|
|
9
|
+
@author: <B>H</B>ugo <B>S</B>aporetti <B>J</B>unior"
|
|
10
|
+
@site: https://github.com/yorevs/hspylib
|
|
11
|
+
@license: MIT - Please refer to <https://opensource.org/licenses/MIT>
|
|
12
|
+
|
|
13
|
+
Copyright·(c)·2024,·HSPyLib
|
|
14
|
+
"""
|
|
15
|
+
from abc import ABC, abstractmethod
|
|
16
|
+
from clitt.core.icons.font_awesome.awesome import Awesome
|
|
17
|
+
from clitt.core.term.commons import Direction
|
|
18
|
+
from clitt.core.term.cursor import Cursor
|
|
19
|
+
from clitt.core.term.screen import Screen
|
|
20
|
+
from clitt.core.term.terminal import Terminal
|
|
21
|
+
from clitt.core.tui.tui_preferences import TUIPreferences
|
|
22
|
+
from hspylib.core.tools.text_tools import elide_text
|
|
23
|
+
from hspylib.modules.cli.keyboard import Keyboard
|
|
24
|
+
from typing import Any, List, Optional, TypeVar
|
|
25
|
+
|
|
26
|
+
T = TypeVar("T", bound=Any)
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
class TUIComponent(ABC):
|
|
30
|
+
"""Provide a base class for terminal UI components."""
|
|
31
|
+
|
|
32
|
+
def __init__(self, title: str):
|
|
33
|
+
self._re_render = True
|
|
34
|
+
self._done = False
|
|
35
|
+
self._title = title
|
|
36
|
+
self._terminal = Terminal.INSTANCE
|
|
37
|
+
|
|
38
|
+
@property
|
|
39
|
+
def terminal(self) -> Terminal:
|
|
40
|
+
return self._terminal
|
|
41
|
+
|
|
42
|
+
@property
|
|
43
|
+
def screen(self) -> Screen:
|
|
44
|
+
return self.terminal.screen
|
|
45
|
+
|
|
46
|
+
@property
|
|
47
|
+
def cursor(self) -> Cursor:
|
|
48
|
+
return self.terminal.screen.cursor
|
|
49
|
+
|
|
50
|
+
@property
|
|
51
|
+
def prefs(self) -> TUIPreferences:
|
|
52
|
+
return self.screen.preferences
|
|
53
|
+
|
|
54
|
+
@property
|
|
55
|
+
def title(self) -> str:
|
|
56
|
+
return self._title
|
|
57
|
+
|
|
58
|
+
@property
|
|
59
|
+
def rows(self) -> int:
|
|
60
|
+
return self.screen.lines
|
|
61
|
+
|
|
62
|
+
@property
|
|
63
|
+
def columns(self) -> int:
|
|
64
|
+
return self.screen.columns
|
|
65
|
+
|
|
66
|
+
def _prepare_render(self, auto_wrap: bool = False, show_cursor: bool = False) -> None:
|
|
67
|
+
"""Prepare the screen for renderization."""
|
|
68
|
+
self.screen.add_watcher(self.invalidate)
|
|
69
|
+
Terminal.set_auto_wrap(auto_wrap)
|
|
70
|
+
Terminal.set_show_cursor(show_cursor)
|
|
71
|
+
self.screen.clear()
|
|
72
|
+
self.cursor.save()
|
|
73
|
+
|
|
74
|
+
def _loop(self, break_keys: List[Keyboard] = None) -> Keyboard:
|
|
75
|
+
"""Loop and wait for a keypress. Render the component if required."""
|
|
76
|
+
|
|
77
|
+
break_keys = break_keys or Keyboard.break_keys()
|
|
78
|
+
keypress = Keyboard.VK_NONE
|
|
79
|
+
|
|
80
|
+
# Wait for user interaction
|
|
81
|
+
while not self._done and keypress not in break_keys:
|
|
82
|
+
|
|
83
|
+
# Menu Renderization
|
|
84
|
+
if self._re_render:
|
|
85
|
+
self.render()
|
|
86
|
+
# Navigation input
|
|
87
|
+
keypress = self.handle_keypress()
|
|
88
|
+
|
|
89
|
+
self.cursor.end()
|
|
90
|
+
self.cursor.erase(Direction.DOWN)
|
|
91
|
+
self.cursor.reset_mode()
|
|
92
|
+
self.cursor.writeln("\n")
|
|
93
|
+
|
|
94
|
+
return keypress
|
|
95
|
+
|
|
96
|
+
def draw_line(self, line_fmt: str, *args: Any) -> None:
|
|
97
|
+
"""Draws a formatted component line respecting the specified max_columns.
|
|
98
|
+
:param line_fmt: the line format.
|
|
99
|
+
:param args: the format arguments.
|
|
100
|
+
"""
|
|
101
|
+
self.writeln(elide_text(line_fmt.format(*args), self.columns) + "%NC%")
|
|
102
|
+
|
|
103
|
+
def draw_navbar(self, navbar: str) -> None:
|
|
104
|
+
"""Draws the component navigation bar respecting the specified max_columns.
|
|
105
|
+
:param navbar: the component's navigation bar.
|
|
106
|
+
"""
|
|
107
|
+
self.write(navbar)
|
|
108
|
+
|
|
109
|
+
def draw_selector(self, is_selected: bool = False, has_bg_color: bool = True) -> Awesome:
|
|
110
|
+
"""Draws and highlight the selected component line.
|
|
111
|
+
:param is_selected: whether to set a selected foreground color or not.
|
|
112
|
+
:param has_bg_color: whether to set a background or not.
|
|
113
|
+
"""
|
|
114
|
+
prefs = TUIPreferences.INSTANCE
|
|
115
|
+
if is_selected:
|
|
116
|
+
selector = prefs.selected_icon
|
|
117
|
+
if has_bg_color:
|
|
118
|
+
self.write(prefs.sel_bg_color.code)
|
|
119
|
+
self.write(prefs.highlight_color.code)
|
|
120
|
+
else:
|
|
121
|
+
selector = prefs.unselected_icon
|
|
122
|
+
self.write(prefs.text_color.code)
|
|
123
|
+
|
|
124
|
+
return selector
|
|
125
|
+
|
|
126
|
+
def write(self, obj: Any) -> None:
|
|
127
|
+
"""Write the string representation of the object to the screen."""
|
|
128
|
+
self.terminal.echo(obj, end="")
|
|
129
|
+
|
|
130
|
+
def writeln(self, obj: Any) -> None:
|
|
131
|
+
"""Write the string representation of the object to the screen, appending a new line."""
|
|
132
|
+
self.terminal.echo(obj)
|
|
133
|
+
|
|
134
|
+
def invalidate(self) -> None:
|
|
135
|
+
"""Invalidate current TUI renderization."""
|
|
136
|
+
self.screen.clear()
|
|
137
|
+
self.cursor.save()
|
|
138
|
+
self.render()
|
|
139
|
+
|
|
140
|
+
@abstractmethod
|
|
141
|
+
def execute(self) -> Optional[T | List[T]]:
|
|
142
|
+
"""Execute the main TUI component flow."""
|
|
143
|
+
|
|
144
|
+
@abstractmethod
|
|
145
|
+
def render(self) -> None:
|
|
146
|
+
"""Renders the TUI component."""
|
|
147
|
+
|
|
148
|
+
@abstractmethod
|
|
149
|
+
def navbar(self, **kwargs) -> str:
|
|
150
|
+
"""Get the TUI component's navigation bar (optional)."""
|
|
151
|
+
|
|
152
|
+
@abstractmethod
|
|
153
|
+
def handle_keypress(self) -> Keyboard:
|
|
154
|
+
"""Handle a keyboard press."""
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
# -*- coding: utf-8 -*-
|
|
3
|
+
|
|
4
|
+
"""
|
|
5
|
+
@project: HsPyLib-Clitt
|
|
6
|
+
@package: clitt.core.tui
|
|
7
|
+
@file: tui_preferences.py
|
|
8
|
+
@created: Tue, 4 May 2021
|
|
9
|
+
@author: <B>H</B>ugo <B>S</B>aporetti <B>J</B>unior"
|
|
10
|
+
@site: https://github.com/yorevs/hspylib
|
|
11
|
+
@license: MIT - Please refer to <https://opensource.org/licenses/MIT>
|
|
12
|
+
|
|
13
|
+
Copyright·(c)·2024,·HSPyLib
|
|
14
|
+
"""
|
|
15
|
+
|
|
16
|
+
from clitt.core.icons.font_awesome.form_icons import FormIcons
|
|
17
|
+
from clitt.core.icons.font_awesome.nav_icons import Awesome, NavIcons
|
|
18
|
+
from clitt.core.preferences import Preferences
|
|
19
|
+
from hspylib.modules.cli.vt100.vt_color import VtColor
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
class TUIPreferences(Preferences):
|
|
23
|
+
"""Terminal UI Preferences class."""
|
|
24
|
+
|
|
25
|
+
INSTANCE = None
|
|
26
|
+
|
|
27
|
+
def __init__(self):
|
|
28
|
+
super().__init__("hhs.clitt")
|
|
29
|
+
|
|
30
|
+
@property
|
|
31
|
+
def max_rows(self) -> int:
|
|
32
|
+
return max(3, self.get_preference("max.rows", 10))
|
|
33
|
+
|
|
34
|
+
@property
|
|
35
|
+
def items_per_line(self) -> int:
|
|
36
|
+
return max(2, self.get_preference("items.per.line", 6))
|
|
37
|
+
|
|
38
|
+
@property
|
|
39
|
+
def title_line_length(self) -> int:
|
|
40
|
+
return max(15, self.get_preference("title.line.len", 30))
|
|
41
|
+
|
|
42
|
+
@property
|
|
43
|
+
def title_color(self) -> VtColor:
|
|
44
|
+
return self.get_preference("title.color", VtColor.ORANGE)
|
|
45
|
+
|
|
46
|
+
@property
|
|
47
|
+
def caption_color(self) -> VtColor:
|
|
48
|
+
return self.get_preference("caption.color", VtColor.WHITE)
|
|
49
|
+
|
|
50
|
+
@property
|
|
51
|
+
def text_color(self) -> VtColor:
|
|
52
|
+
return self.get_preference("text.color", VtColor.WHITE)
|
|
53
|
+
|
|
54
|
+
@property
|
|
55
|
+
def success_color(self) -> VtColor:
|
|
56
|
+
return self.get_preference("success.color", VtColor.GREEN)
|
|
57
|
+
|
|
58
|
+
@property
|
|
59
|
+
def warning_color(self) -> VtColor:
|
|
60
|
+
return self.get_preference("warning.color", VtColor.YELLOW)
|
|
61
|
+
|
|
62
|
+
@property
|
|
63
|
+
def error_color(self) -> VtColor:
|
|
64
|
+
return self.get_preference("error.color", VtColor.RED)
|
|
65
|
+
|
|
66
|
+
@property
|
|
67
|
+
def highlight_color(self) -> VtColor:
|
|
68
|
+
return self.get_preference("highlight.color", VtColor.CYAN)
|
|
69
|
+
|
|
70
|
+
@property
|
|
71
|
+
def navbar_color(self) -> VtColor:
|
|
72
|
+
return self.get_preference("navbar.color", VtColor.YELLOW)
|
|
73
|
+
|
|
74
|
+
@property
|
|
75
|
+
def tooltip_color(self) -> VtColor:
|
|
76
|
+
return self.get_preference("tooltip.color", VtColor.GREEN)
|
|
77
|
+
|
|
78
|
+
@property
|
|
79
|
+
def breadcrumb_color(self) -> VtColor:
|
|
80
|
+
return self.get_preference("breadcrumb.color", VtColor.compose(VtColor.BG_BLUE, VtColor.WHITE))
|
|
81
|
+
|
|
82
|
+
@property
|
|
83
|
+
def sel_bg_color(self) -> VtColor:
|
|
84
|
+
return self.get_preference("sel.bg.color", VtColor.BLUE)
|
|
85
|
+
|
|
86
|
+
@property
|
|
87
|
+
def selected_icon(self) -> Awesome:
|
|
88
|
+
return self.get_preference("selected.icon", NavIcons.POINTER)
|
|
89
|
+
|
|
90
|
+
@property
|
|
91
|
+
def unselected_icon(self) -> Awesome:
|
|
92
|
+
return self.get_preference("unselected.icon", Awesome.no_icon())
|
|
93
|
+
|
|
94
|
+
@property
|
|
95
|
+
def checked_icon(self) -> Awesome:
|
|
96
|
+
return self.get_preference("checked.icon", FormIcons.MARKED)
|
|
97
|
+
|
|
98
|
+
@property
|
|
99
|
+
def unchecked_icon(self) -> Awesome:
|
|
100
|
+
return self.get_preference("unchecked.icon", FormIcons.UNMARKED)
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
assert (tui_preferences := TUIPreferences().INSTANCE) is not None, "Failed to create TUIPreferences instance"
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
# -*- coding: utf-8 -*-
|
|
3
|
+
|
|
4
|
+
"""
|
|
5
|
+
@project: HsPyLib
|
|
6
|
+
@package: clitt.utils
|
|
7
|
+
@file: git_utils.py
|
|
8
|
+
@created: Nov 14, 2019
|
|
9
|
+
@author: <B>H</B>ugo <B>S</B>aporetti <B>J</B>unior
|
|
10
|
+
@site: https://github.com/yorevs/hspylib
|
|
11
|
+
@license: MIT - Please refer to <https://opensource.org/licenses/MIT>
|
|
12
|
+
|
|
13
|
+
Copyright·(c)·2024,·HSPyLib
|
|
14
|
+
"""
|
|
15
|
+
from clitt.core.term.terminal import Terminal
|
|
16
|
+
from hspylib.modules.application.exit_status import ExitStatus
|
|
17
|
+
from typing import Tuple
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
class GitTools:
|
|
21
|
+
"""TODO"""
|
|
22
|
+
|
|
23
|
+
@staticmethod
|
|
24
|
+
def top_level_dir() -> Tuple[str, ExitStatus]:
|
|
25
|
+
"""TODO"""
|
|
26
|
+
return Terminal.shell_exec("git rev-parse --show-toplevel")
|
|
27
|
+
|
|
28
|
+
@staticmethod
|
|
29
|
+
def current_branch() -> Tuple[str, ExitStatus]:
|
|
30
|
+
"""TODO"""
|
|
31
|
+
return Terminal.shell_exec("git symbolic-ref --short HEAD")
|
|
32
|
+
|
|
33
|
+
@staticmethod
|
|
34
|
+
def changelog(from_tag: str, to_tag: str) -> Tuple[str, ExitStatus]:
|
|
35
|
+
"""TODO"""
|
|
36
|
+
return Terminal.shell_exec(f"git log --oneline --pretty='format:%h %ad %s' --date=short {from_tag}^..{to_tag}^")
|
|
37
|
+
|
|
38
|
+
@staticmethod
|
|
39
|
+
def unreleased() -> Tuple[str, ExitStatus]:
|
|
40
|
+
"""TODO"""
|
|
41
|
+
latest_tag = Terminal.shell_exec("git describe --tags --abbrev=0 HEAD^")
|
|
42
|
+
return Terminal.shell_exec(f"git log --oneline --pretty='format:%h %ad %s' --date=short '{latest_tag}'..HEAD")
|
|
43
|
+
|
|
44
|
+
@staticmethod
|
|
45
|
+
def release_date(tag_name: str) -> Tuple[str, ExitStatus]:
|
|
46
|
+
"""TODO"""
|
|
47
|
+
return Terminal.shell_exec(f"git log -1 --pretty='format:%ad' --date=short {tag_name}")
|
|
48
|
+
|
|
49
|
+
@staticmethod
|
|
50
|
+
def tag_list() -> Tuple[str, ExitStatus]:
|
|
51
|
+
"""TODO"""
|
|
52
|
+
return Terminal.shell_exec("git log --tags --simplify-by-decoration --pretty='format:%ci %d'")
|
|
53
|
+
|
|
54
|
+
@staticmethod
|
|
55
|
+
def create_tag(version: str, commit_id: str = "HEAD", description: str = None) -> Tuple[str, ExitStatus]:
|
|
56
|
+
"""TODO"""
|
|
57
|
+
return Terminal.shell_exec(f"git tag -a v{version} {commit_id} -m '{description or version}'")
|
|
58
|
+
|
|
59
|
+
@staticmethod
|
|
60
|
+
def search_logs(filter_by: str = ".*") -> Tuple[str, ExitStatus]:
|
|
61
|
+
"""TODO"""
|
|
62
|
+
return Terminal.shell_exec(f"git log --grep='{filter_by}' --pretty=format:'%h %ad %s' --date=short")
|
|
63
|
+
|
|
64
|
+
@staticmethod
|
|
65
|
+
def show_file(filename: str, commit_id: str = "HEAD") -> Tuple[str, ExitStatus]:
|
|
66
|
+
return Terminal.shell_exec(f"git show {commit_id}:{filename}")
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
# -*- coding: utf-8 -*-
|
|
3
|
+
|
|
4
|
+
"""
|
|
5
|
+
@project: HsPyLib-Clitt
|
|
6
|
+
@package: clitt
|
|
7
|
+
@file: __classpath__.py
|
|
8
|
+
@created: Fri, 23 Dec 2022
|
|
9
|
+
@author: "<B>H</B>ugo <B>S</B>aporetti <B>J</B>unior")"
|
|
10
|
+
@site: "https://github.com/yorevs/hspylib")
|
|
11
|
+
@license: MIT - Please refer to <https://opensource.org/licenses/MIT>
|
|
12
|
+
|
|
13
|
+
Copyright·(c)·2024,·HSPyLib
|
|
14
|
+
"""
|
|
15
|
+
|
|
16
|
+
from hspylib.core.metaclass.classpath import Classpath
|
|
17
|
+
from hspylib.core.tools.commons import get_path, run_dir
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
class _Classpath(Classpath):
|
|
21
|
+
"""Provide a class to help locating user-defined classes, packages, sources and resources."""
|
|
22
|
+
|
|
23
|
+
def __init__(self):
|
|
24
|
+
super().__init__(get_path(__file__), get_path(run_dir()), (get_path(__file__) / "resources"))
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
# Instantiate the classpath singleton
|
|
28
|
+
assert (classpath := _Classpath().INSTANCE) is not None, "Failed to create Classpath instance"
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
# -*- coding: utf-8 -*-
|
|
3
|
+
|
|
4
|
+
"""
|
|
5
|
+
@project: hspylib
|
|
6
|
+
@package: hspylib
|
|
7
|
+
@file: __main__.py
|
|
8
|
+
@created: Tue, 4 May 2021
|
|
9
|
+
@author: <B>H</B>ugo <B>S</B>aporetti <B>J</B>unior"
|
|
10
|
+
@site: https://github.com/yorevs/hspylib
|
|
11
|
+
@license: MIT - Please refer to <https://opensource.org/licenses/MIT>
|
|
12
|
+
|
|
13
|
+
Copyright·(c)·2024,·HSPyLib
|
|
14
|
+
"""
|
|
15
|
+
from clitt.__classpath__ import classpath
|
|
16
|
+
from clitt.addons.appman.appman import AppManager
|
|
17
|
+
from clitt.addons.appman.appman_enums import AppExtension, AppType
|
|
18
|
+
from clitt.addons.widman.widman import WidgetManager
|
|
19
|
+
from clitt.core.tui.tui_application import TUIApplication
|
|
20
|
+
from hspylib.core.enums.charset import Charset
|
|
21
|
+
from hspylib.core.enums.enumeration import Enumeration
|
|
22
|
+
from hspylib.core.tools.commons import run_dir, syserr
|
|
23
|
+
from hspylib.core.tools.text_tools import strip_linebreaks
|
|
24
|
+
from hspylib.modules.application.exit_status import ExitStatus
|
|
25
|
+
from hspylib.modules.application.version import Version
|
|
26
|
+
|
|
27
|
+
import sys
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
class Main(TUIApplication):
|
|
31
|
+
"""HsPyLib CLI Terminal Tools - Create professional CLI applications."""
|
|
32
|
+
|
|
33
|
+
# The welcome message
|
|
34
|
+
DESCRIPTION = classpath.get_source("welcome.txt").read_text(encoding=Charset.UTF_8.val)
|
|
35
|
+
|
|
36
|
+
# Location of the .version file
|
|
37
|
+
VERSION_DIR = classpath.source_path()
|
|
38
|
+
|
|
39
|
+
class Addon(Enumeration):
|
|
40
|
+
"""HsPyLib addon types."""
|
|
41
|
+
|
|
42
|
+
# fmt: off
|
|
43
|
+
APPMAN = 'appman'
|
|
44
|
+
WIDGETS = 'widgets'
|
|
45
|
+
# fmt: on
|
|
46
|
+
|
|
47
|
+
@property
|
|
48
|
+
def val(self) -> str:
|
|
49
|
+
return str(self.value)
|
|
50
|
+
|
|
51
|
+
def __init__(self, app_name: str):
|
|
52
|
+
version = Version.load(load_dir=self.VERSION_DIR)
|
|
53
|
+
super().__init__(app_name, version, self.DESCRIPTION.format(version))
|
|
54
|
+
|
|
55
|
+
def _setup_arguments(self) -> None:
|
|
56
|
+
"""Initialize application parameters and options."""
|
|
57
|
+
|
|
58
|
+
# fmt: off
|
|
59
|
+
self._with_chained_args('application', 'the HsPyLib-Clitt addon to run') \
|
|
60
|
+
.argument(
|
|
61
|
+
self.Addon.APPMAN.val,
|
|
62
|
+
'app Application Manager: Create HsPyLib-Clitt based python applications') \
|
|
63
|
+
.add_option(
|
|
64
|
+
'dest-dir', 'd', 'dest-dir',
|
|
65
|
+
'the destination directory. If omitted, the current directory will be used.',
|
|
66
|
+
nargs='?', default=self._run_dir) \
|
|
67
|
+
.add_parameter(
|
|
68
|
+
'app-name', 'the application name', nargs='?') \
|
|
69
|
+
.add_parameter(
|
|
70
|
+
'app-type',
|
|
71
|
+
'the application type. Appman is going to scaffold a basic application based on the app type',
|
|
72
|
+
choices=AppType.choices(), nargs='?') \
|
|
73
|
+
.add_parameter(
|
|
74
|
+
'app-ext',
|
|
75
|
+
'"gradle" is going to initialize you project with gradle (requires gradle). '
|
|
76
|
+
'"git" is going to initialize a git repository (requires git)', nargs='*') \
|
|
77
|
+
.argument(self.Addon.WIDGETS.val, 'app Widgets Manager: Execute an HsPyLib widget') \
|
|
78
|
+
.add_parameter(
|
|
79
|
+
'widget-name',
|
|
80
|
+
'the name of the widget to be executed. If omitted, all available widgets will be '
|
|
81
|
+
'presented in a dashboard',
|
|
82
|
+
nargs='?') \
|
|
83
|
+
.add_parameter(
|
|
84
|
+
'widget-args', "the widget's arguments (if applicable)", nargs='*')
|
|
85
|
+
|
|
86
|
+
def _main(self, *params, **kwargs) -> ExitStatus:
|
|
87
|
+
"""Main entry point handler."""
|
|
88
|
+
return self._exec_application()
|
|
89
|
+
|
|
90
|
+
def _exec_application(self) -> ExitStatus:
|
|
91
|
+
"""Execute the application main flow."""
|
|
92
|
+
|
|
93
|
+
app = self.get_arg("application")
|
|
94
|
+
if app == self.Addon.APPMAN.val:
|
|
95
|
+
self.start_appman()
|
|
96
|
+
elif app == self.Addon.WIDGETS.val:
|
|
97
|
+
self.start_widman()
|
|
98
|
+
else:
|
|
99
|
+
syserr(f"### Invalid Addon application: {app}")
|
|
100
|
+
self.usage(ExitStatus.FAILED)
|
|
101
|
+
|
|
102
|
+
return ExitStatus.SUCCESS
|
|
103
|
+
|
|
104
|
+
def start_widman(self) -> None:
|
|
105
|
+
"""Start the Widman application."""
|
|
106
|
+
addon = WidgetManager(self)
|
|
107
|
+
widget_name = self.get_arg("widget-name")
|
|
108
|
+
if widget_name:
|
|
109
|
+
widget_args = list(map(strip_linebreaks, self.get_arg("widget-args")))
|
|
110
|
+
addon.execute(widget_name, *widget_args)
|
|
111
|
+
else:
|
|
112
|
+
addon.dashboard()
|
|
113
|
+
|
|
114
|
+
def start_appman(self) -> None:
|
|
115
|
+
"""Start the Appman application."""
|
|
116
|
+
addon = AppManager(self)
|
|
117
|
+
app_type = self.get_arg("app-type")
|
|
118
|
+
if app_type:
|
|
119
|
+
app_ext = self.get_arg("app-ext")
|
|
120
|
+
addon.create(
|
|
121
|
+
self.get_arg("app-name"),
|
|
122
|
+
AppType.of_value(app_type),
|
|
123
|
+
list(map(AppExtension.value_of, app_ext)) if app_ext else [],
|
|
124
|
+
self.get_arg("dest-dir") or run_dir(),
|
|
125
|
+
)
|
|
126
|
+
else:
|
|
127
|
+
args = addon.prompt()
|
|
128
|
+
if args:
|
|
129
|
+
app_ext = []
|
|
130
|
+
if args.initialize_gradle:
|
|
131
|
+
app_ext.append(AppExtension.GRADLE)
|
|
132
|
+
if args.initialize_git:
|
|
133
|
+
app_ext.append(AppExtension.GIT)
|
|
134
|
+
addon.create(args.app_name, AppType.of_value(args.app_type), list(app_ext), args.dest_dir or run_dir())
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
# Application entry point
|
|
138
|
+
if __name__ == "__main__":
|
|
139
|
+
Main("clitt").INSTANCE.run(sys.argv[1:])
|