hspylib-clitt 0.9.119__py3-none-any.whl → 0.9.121__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.
- 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/tui/__init__.py +3 -3
- clitt/core/tui/line_input/__init__.py +3 -3
- clitt/core/tui/line_input/keyboard_input.py +85 -78
- 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/minput/menu_input.py +7 -15
- 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.119.dist-info → hspylib_clitt-0.9.121.dist-info}/METADATA +2 -2
- hspylib_clitt-0.9.121.dist-info/RECORD +97 -0
- {hspylib_clitt-0.9.119.dist-info → hspylib_clitt-0.9.121.dist-info}/top_level.txt +0 -1
- build/lib/build/lib/build/lib/build/lib/clitt/__classpath__.py +0 -28
- build/lib/build/lib/build/lib/build/lib/clitt/__init__.py +0 -13
- build/lib/build/lib/build/lib/build/lib/clitt/__main__.py +0 -139
- build/lib/build/lib/build/lib/build/lib/clitt/addons/__init__.py +0 -12
- build/lib/build/lib/build/lib/build/lib/clitt/addons/appman/__init__.py +0 -13
- build/lib/build/lib/build/lib/build/lib/clitt/addons/appman/appman.py +0 -305
- build/lib/build/lib/build/lib/build/lib/clitt/addons/appman/appman_enums.py +0 -39
- build/lib/build/lib/build/lib/build/lib/clitt/addons/appman/templates/__init__.py +0 -11
- build/lib/build/lib/build/lib/build/lib/clitt/addons/widman/__init__.py +0 -14
- build/lib/build/lib/build/lib/build/lib/clitt/addons/widman/widget.py +0 -70
- build/lib/build/lib/build/lib/build/lib/clitt/addons/widman/widget_entry.py +0 -54
- build/lib/build/lib/build/lib/build/lib/clitt/addons/widman/widgets/__init__.py +0 -14
- build/lib/build/lib/build/lib/build/lib/clitt/addons/widman/widgets/widget_free.py +0 -110
- build/lib/build/lib/build/lib/build/lib/clitt/addons/widman/widgets/widget_punch.py +0 -246
- build/lib/build/lib/build/lib/build/lib/clitt/addons/widman/widgets/widget_send_msg.py +0 -272
- build/lib/build/lib/build/lib/build/lib/clitt/addons/widman/widgets/widget_time_calc.py +0 -146
- build/lib/build/lib/build/lib/build/lib/clitt/addons/widman/widman.py +0 -123
- build/lib/build/lib/build/lib/build/lib/clitt/core/__init__.py +0 -15
- build/lib/build/lib/build/lib/build/lib/clitt/core/exception/__init__.py +0 -11
- build/lib/build/lib/build/lib/build/lib/clitt/core/exception/exceptions.py +0 -19
- build/lib/build/lib/build/lib/build/lib/clitt/core/icons/__init__.py +0 -12
- build/lib/build/lib/build/lib/build/lib/clitt/core/icons/emojis/__init__.py +0 -12
- build/lib/build/lib/build/lib/build/lib/clitt/core/icons/emojis/emojis.py +0 -41
- build/lib/build/lib/build/lib/build/lib/clitt/core/icons/emojis/face_smiling.py +0 -40
- build/lib/build/lib/build/lib/build/lib/clitt/core/icons/font_awesome/__init__.py +0 -18
- build/lib/build/lib/build/lib/build/lib/clitt/core/icons/font_awesome/app_icons.py +0 -55
- build/lib/build/lib/build/lib/build/lib/clitt/core/icons/font_awesome/awesome.py +0 -76
- build/lib/build/lib/build/lib/build/lib/clitt/core/icons/font_awesome/dashboard_icons.py +0 -93
- build/lib/build/lib/build/lib/build/lib/clitt/core/icons/font_awesome/form_icons.py +0 -69
- build/lib/build/lib/build/lib/build/lib/clitt/core/icons/font_awesome/game_icons.py +0 -59
- build/lib/build/lib/build/lib/build/lib/clitt/core/icons/font_awesome/nav_icons.py +0 -42
- build/lib/build/lib/build/lib/build/lib/clitt/core/icons/font_awesome/trickplay_icons.py +0 -39
- build/lib/build/lib/build/lib/build/lib/clitt/core/icons/font_awesome/widget_icons.py +0 -37
- build/lib/build/lib/build/lib/build/lib/clitt/core/preferences.py +0 -87
- build/lib/build/lib/build/lib/build/lib/clitt/core/term/__init__.py +0 -14
- build/lib/build/lib/build/lib/build/lib/clitt/core/term/commons.py +0 -106
- build/lib/build/lib/build/lib/build/lib/clitt/core/term/cursor.py +0 -174
- build/lib/build/lib/build/lib/build/lib/clitt/core/term/screen.py +0 -106
- build/lib/build/lib/build/lib/build/lib/clitt/core/term/terminal.py +0 -202
- build/lib/build/lib/build/lib/build/lib/clitt/core/tui/__init__.py +0 -20
- build/lib/build/lib/build/lib/build/lib/clitt/core/tui/line_input/__init__.py +0 -12
- build/lib/build/lib/build/lib/build/lib/clitt/core/tui/line_input/keyboard_input.py +0 -229
- build/lib/build/lib/build/lib/build/lib/clitt/core/tui/line_input/line_input.py +0 -31
- build/lib/build/lib/build/lib/build/lib/clitt/core/tui/mchoose/__init__.py +0 -12
- build/lib/build/lib/build/lib/build/lib/clitt/core/tui/mchoose/mchoose.py +0 -43
- build/lib/build/lib/build/lib/build/lib/clitt/core/tui/mchoose/menu_choose.py +0 -192
- build/lib/build/lib/build/lib/build/lib/clitt/core/tui/mdashboard/__init__.py +0 -14
- build/lib/build/lib/build/lib/build/lib/clitt/core/tui/mdashboard/dashboard_builder.py +0 -54
- build/lib/build/lib/build/lib/build/lib/clitt/core/tui/mdashboard/dashboard_item.py +0 -31
- build/lib/build/lib/build/lib/build/lib/clitt/core/tui/mdashboard/mdashboard.py +0 -26
- build/lib/build/lib/build/lib/build/lib/clitt/core/tui/mdashboard/menu_dashboard.py +0 -148
- build/lib/build/lib/build/lib/build/lib/clitt/core/tui/menu/__init__.py +0 -16
- build/lib/build/lib/build/lib/build/lib/clitt/core/tui/menu/tui_menu.py +0 -111
- build/lib/build/lib/build/lib/build/lib/clitt/core/tui/menu/tui_menu_action.py +0 -47
- build/lib/build/lib/build/lib/build/lib/clitt/core/tui/menu/tui_menu_factory.py +0 -117
- build/lib/build/lib/build/lib/build/lib/clitt/core/tui/menu/tui_menu_item.py +0 -196
- build/lib/build/lib/build/lib/build/lib/clitt/core/tui/menu/tui_menu_ui.py +0 -98
- build/lib/build/lib/build/lib/build/lib/clitt/core/tui/menu/tui_menu_view.py +0 -57
- build/lib/build/lib/build/lib/build/lib/clitt/core/tui/minput/__init__.py +0 -19
- build/lib/build/lib/build/lib/build/lib/clitt/core/tui/minput/access_type.py +0 -26
- build/lib/build/lib/build/lib/build/lib/clitt/core/tui/minput/field_builder.py +0 -117
- build/lib/build/lib/build/lib/build/lib/clitt/core/tui/minput/form_builder.py +0 -72
- build/lib/build/lib/build/lib/build/lib/clitt/core/tui/minput/form_field.py +0 -180
- build/lib/build/lib/build/lib/build/lib/clitt/core/tui/minput/input_type.py +0 -30
- build/lib/build/lib/build/lib/build/lib/clitt/core/tui/minput/input_validator.py +0 -98
- build/lib/build/lib/build/lib/build/lib/clitt/core/tui/minput/menu_input.py +0 -292
- build/lib/build/lib/build/lib/build/lib/clitt/core/tui/minput/minput.py +0 -44
- build/lib/build/lib/build/lib/build/lib/clitt/core/tui/minput/minput_utils.py +0 -156
- build/lib/build/lib/build/lib/build/lib/clitt/core/tui/mselect/__init__.py +0 -12
- build/lib/build/lib/build/lib/build/lib/clitt/core/tui/mselect/menu_select.py +0 -170
- build/lib/build/lib/build/lib/build/lib/clitt/core/tui/mselect/mselect.py +0 -36
- build/lib/build/lib/build/lib/build/lib/clitt/core/tui/table/__init__.py +0 -12
- build/lib/build/lib/build/lib/build/lib/clitt/core/tui/table/table_enums.py +0 -47
- build/lib/build/lib/build/lib/build/lib/clitt/core/tui/table/table_renderer.py +0 -339
- build/lib/build/lib/build/lib/build/lib/clitt/core/tui/tui_application.py +0 -52
- build/lib/build/lib/build/lib/build/lib/clitt/core/tui/tui_component.py +0 -154
- build/lib/build/lib/build/lib/build/lib/clitt/core/tui/tui_preferences.py +0 -103
- build/lib/build/lib/build/lib/build/lib/clitt/utils/__init__.py +0 -11
- build/lib/build/lib/build/lib/build/lib/clitt/utils/git_utils.py +0 -66
- build/lib/build/lib/build/lib/clitt/__classpath__.py +0 -28
- build/lib/build/lib/build/lib/clitt/__init__.py +0 -13
- build/lib/build/lib/build/lib/clitt/__main__.py +0 -139
- build/lib/build/lib/build/lib/clitt/addons/__init__.py +0 -12
- build/lib/build/lib/build/lib/clitt/addons/appman/__init__.py +0 -13
- build/lib/build/lib/build/lib/clitt/addons/appman/appman.py +0 -305
- build/lib/build/lib/build/lib/clitt/addons/appman/appman_enums.py +0 -39
- build/lib/build/lib/build/lib/clitt/addons/appman/templates/__init__.py +0 -11
- build/lib/build/lib/build/lib/clitt/addons/widman/__init__.py +0 -14
- build/lib/build/lib/build/lib/clitt/addons/widman/widget.py +0 -70
- build/lib/build/lib/build/lib/clitt/addons/widman/widget_entry.py +0 -54
- build/lib/build/lib/build/lib/clitt/addons/widman/widgets/__init__.py +0 -14
- build/lib/build/lib/build/lib/clitt/addons/widman/widgets/widget_free.py +0 -110
- build/lib/build/lib/build/lib/clitt/addons/widman/widgets/widget_punch.py +0 -246
- build/lib/build/lib/build/lib/clitt/addons/widman/widgets/widget_send_msg.py +0 -272
- build/lib/build/lib/build/lib/clitt/addons/widman/widgets/widget_time_calc.py +0 -146
- build/lib/build/lib/build/lib/clitt/addons/widman/widman.py +0 -123
- build/lib/build/lib/build/lib/clitt/core/__init__.py +0 -15
- build/lib/build/lib/build/lib/clitt/core/exception/__init__.py +0 -11
- build/lib/build/lib/build/lib/clitt/core/exception/exceptions.py +0 -19
- build/lib/build/lib/build/lib/clitt/core/icons/__init__.py +0 -12
- build/lib/build/lib/build/lib/clitt/core/icons/emojis/__init__.py +0 -12
- build/lib/build/lib/build/lib/clitt/core/icons/emojis/emojis.py +0 -41
- build/lib/build/lib/build/lib/clitt/core/icons/emojis/face_smiling.py +0 -40
- build/lib/build/lib/build/lib/clitt/core/icons/font_awesome/__init__.py +0 -18
- build/lib/build/lib/build/lib/clitt/core/icons/font_awesome/app_icons.py +0 -55
- build/lib/build/lib/build/lib/clitt/core/icons/font_awesome/awesome.py +0 -76
- build/lib/build/lib/build/lib/clitt/core/icons/font_awesome/dashboard_icons.py +0 -93
- build/lib/build/lib/build/lib/clitt/core/icons/font_awesome/form_icons.py +0 -69
- build/lib/build/lib/build/lib/clitt/core/icons/font_awesome/game_icons.py +0 -59
- build/lib/build/lib/build/lib/clitt/core/icons/font_awesome/nav_icons.py +0 -42
- build/lib/build/lib/build/lib/clitt/core/icons/font_awesome/trickplay_icons.py +0 -39
- build/lib/build/lib/build/lib/clitt/core/icons/font_awesome/widget_icons.py +0 -37
- build/lib/build/lib/build/lib/clitt/core/preferences.py +0 -87
- build/lib/build/lib/build/lib/clitt/core/term/__init__.py +0 -14
- build/lib/build/lib/build/lib/clitt/core/term/commons.py +0 -106
- build/lib/build/lib/build/lib/clitt/core/term/cursor.py +0 -174
- build/lib/build/lib/build/lib/clitt/core/term/screen.py +0 -106
- build/lib/build/lib/build/lib/clitt/core/term/terminal.py +0 -202
- build/lib/build/lib/build/lib/clitt/core/tui/__init__.py +0 -20
- build/lib/build/lib/build/lib/clitt/core/tui/line_input/__init__.py +0 -12
- build/lib/build/lib/build/lib/clitt/core/tui/line_input/keyboard_input.py +0 -229
- build/lib/build/lib/build/lib/clitt/core/tui/line_input/line_input.py +0 -31
- build/lib/build/lib/build/lib/clitt/core/tui/mchoose/__init__.py +0 -12
- build/lib/build/lib/build/lib/clitt/core/tui/mchoose/mchoose.py +0 -43
- build/lib/build/lib/build/lib/clitt/core/tui/mchoose/menu_choose.py +0 -192
- build/lib/build/lib/build/lib/clitt/core/tui/mdashboard/__init__.py +0 -14
- build/lib/build/lib/build/lib/clitt/core/tui/mdashboard/dashboard_builder.py +0 -54
- build/lib/build/lib/build/lib/clitt/core/tui/mdashboard/dashboard_item.py +0 -31
- build/lib/build/lib/build/lib/clitt/core/tui/mdashboard/mdashboard.py +0 -26
- build/lib/build/lib/build/lib/clitt/core/tui/mdashboard/menu_dashboard.py +0 -148
- build/lib/build/lib/build/lib/clitt/core/tui/menu/__init__.py +0 -16
- build/lib/build/lib/build/lib/clitt/core/tui/menu/tui_menu.py +0 -111
- build/lib/build/lib/build/lib/clitt/core/tui/menu/tui_menu_action.py +0 -47
- build/lib/build/lib/build/lib/clitt/core/tui/menu/tui_menu_factory.py +0 -117
- build/lib/build/lib/build/lib/clitt/core/tui/menu/tui_menu_item.py +0 -196
- build/lib/build/lib/build/lib/clitt/core/tui/menu/tui_menu_ui.py +0 -98
- build/lib/build/lib/build/lib/clitt/core/tui/menu/tui_menu_view.py +0 -57
- build/lib/build/lib/build/lib/clitt/core/tui/minput/__init__.py +0 -19
- build/lib/build/lib/build/lib/clitt/core/tui/minput/access_type.py +0 -26
- build/lib/build/lib/build/lib/clitt/core/tui/minput/field_builder.py +0 -117
- build/lib/build/lib/build/lib/clitt/core/tui/minput/form_builder.py +0 -72
- build/lib/build/lib/build/lib/clitt/core/tui/minput/form_field.py +0 -180
- build/lib/build/lib/build/lib/clitt/core/tui/minput/input_type.py +0 -30
- build/lib/build/lib/build/lib/clitt/core/tui/minput/input_validator.py +0 -98
- build/lib/build/lib/build/lib/clitt/core/tui/minput/menu_input.py +0 -292
- build/lib/build/lib/build/lib/clitt/core/tui/minput/minput.py +0 -44
- build/lib/build/lib/build/lib/clitt/core/tui/minput/minput_utils.py +0 -156
- build/lib/build/lib/build/lib/clitt/core/tui/mselect/__init__.py +0 -12
- build/lib/build/lib/build/lib/clitt/core/tui/mselect/menu_select.py +0 -170
- build/lib/build/lib/build/lib/clitt/core/tui/mselect/mselect.py +0 -36
- build/lib/build/lib/build/lib/clitt/core/tui/table/__init__.py +0 -12
- build/lib/build/lib/build/lib/clitt/core/tui/table/table_enums.py +0 -47
- build/lib/build/lib/build/lib/clitt/core/tui/table/table_renderer.py +0 -339
- build/lib/build/lib/build/lib/clitt/core/tui/tui_application.py +0 -52
- build/lib/build/lib/build/lib/clitt/core/tui/tui_component.py +0 -154
- build/lib/build/lib/build/lib/clitt/core/tui/tui_preferences.py +0 -103
- build/lib/build/lib/build/lib/clitt/utils/__init__.py +0 -11
- build/lib/build/lib/build/lib/clitt/utils/git_utils.py +0 -66
- build/lib/build/lib/clitt/__classpath__.py +0 -28
- build/lib/build/lib/clitt/__init__.py +0 -13
- build/lib/build/lib/clitt/__main__.py +0 -139
- build/lib/build/lib/clitt/addons/__init__.py +0 -12
- build/lib/build/lib/clitt/addons/appman/__init__.py +0 -13
- build/lib/build/lib/clitt/addons/appman/appman.py +0 -305
- build/lib/build/lib/clitt/addons/appman/appman_enums.py +0 -39
- build/lib/build/lib/clitt/addons/appman/templates/__init__.py +0 -11
- build/lib/build/lib/clitt/addons/widman/__init__.py +0 -14
- build/lib/build/lib/clitt/addons/widman/widget.py +0 -70
- build/lib/build/lib/clitt/addons/widman/widget_entry.py +0 -54
- build/lib/build/lib/clitt/addons/widman/widgets/__init__.py +0 -14
- build/lib/build/lib/clitt/addons/widman/widgets/widget_free.py +0 -110
- build/lib/build/lib/clitt/addons/widman/widgets/widget_punch.py +0 -246
- build/lib/build/lib/clitt/addons/widman/widgets/widget_send_msg.py +0 -272
- build/lib/build/lib/clitt/addons/widman/widgets/widget_time_calc.py +0 -146
- build/lib/build/lib/clitt/addons/widman/widman.py +0 -123
- build/lib/build/lib/clitt/core/__init__.py +0 -15
- build/lib/build/lib/clitt/core/exception/__init__.py +0 -11
- build/lib/build/lib/clitt/core/exception/exceptions.py +0 -19
- build/lib/build/lib/clitt/core/icons/__init__.py +0 -12
- build/lib/build/lib/clitt/core/icons/emojis/__init__.py +0 -12
- build/lib/build/lib/clitt/core/icons/emojis/emojis.py +0 -41
- build/lib/build/lib/clitt/core/icons/emojis/face_smiling.py +0 -40
- build/lib/build/lib/clitt/core/icons/font_awesome/__init__.py +0 -18
- build/lib/build/lib/clitt/core/icons/font_awesome/app_icons.py +0 -55
- build/lib/build/lib/clitt/core/icons/font_awesome/awesome.py +0 -76
- build/lib/build/lib/clitt/core/icons/font_awesome/dashboard_icons.py +0 -93
- build/lib/build/lib/clitt/core/icons/font_awesome/form_icons.py +0 -69
- build/lib/build/lib/clitt/core/icons/font_awesome/game_icons.py +0 -59
- build/lib/build/lib/clitt/core/icons/font_awesome/nav_icons.py +0 -42
- build/lib/build/lib/clitt/core/icons/font_awesome/trickplay_icons.py +0 -39
- build/lib/build/lib/clitt/core/icons/font_awesome/widget_icons.py +0 -37
- build/lib/build/lib/clitt/core/preferences.py +0 -87
- build/lib/build/lib/clitt/core/term/__init__.py +0 -14
- build/lib/build/lib/clitt/core/term/commons.py +0 -106
- build/lib/build/lib/clitt/core/term/cursor.py +0 -174
- build/lib/build/lib/clitt/core/term/screen.py +0 -106
- build/lib/build/lib/clitt/core/term/terminal.py +0 -202
- build/lib/build/lib/clitt/core/tui/__init__.py +0 -20
- build/lib/build/lib/clitt/core/tui/line_input/__init__.py +0 -12
- build/lib/build/lib/clitt/core/tui/line_input/keyboard_input.py +0 -229
- build/lib/build/lib/clitt/core/tui/line_input/line_input.py +0 -31
- build/lib/build/lib/clitt/core/tui/mchoose/__init__.py +0 -12
- build/lib/build/lib/clitt/core/tui/mchoose/mchoose.py +0 -43
- build/lib/build/lib/clitt/core/tui/mchoose/menu_choose.py +0 -192
- build/lib/build/lib/clitt/core/tui/mdashboard/__init__.py +0 -14
- build/lib/build/lib/clitt/core/tui/mdashboard/dashboard_builder.py +0 -54
- build/lib/build/lib/clitt/core/tui/mdashboard/dashboard_item.py +0 -31
- build/lib/build/lib/clitt/core/tui/mdashboard/mdashboard.py +0 -26
- build/lib/build/lib/clitt/core/tui/mdashboard/menu_dashboard.py +0 -148
- build/lib/build/lib/clitt/core/tui/menu/__init__.py +0 -16
- build/lib/build/lib/clitt/core/tui/menu/tui_menu.py +0 -111
- build/lib/build/lib/clitt/core/tui/menu/tui_menu_action.py +0 -47
- build/lib/build/lib/clitt/core/tui/menu/tui_menu_factory.py +0 -117
- build/lib/build/lib/clitt/core/tui/menu/tui_menu_item.py +0 -196
- build/lib/build/lib/clitt/core/tui/menu/tui_menu_ui.py +0 -98
- build/lib/build/lib/clitt/core/tui/menu/tui_menu_view.py +0 -57
- build/lib/build/lib/clitt/core/tui/minput/__init__.py +0 -19
- build/lib/build/lib/clitt/core/tui/minput/access_type.py +0 -26
- build/lib/build/lib/clitt/core/tui/minput/field_builder.py +0 -117
- build/lib/build/lib/clitt/core/tui/minput/form_builder.py +0 -72
- build/lib/build/lib/clitt/core/tui/minput/form_field.py +0 -180
- build/lib/build/lib/clitt/core/tui/minput/input_type.py +0 -30
- build/lib/build/lib/clitt/core/tui/minput/input_validator.py +0 -98
- build/lib/build/lib/clitt/core/tui/minput/menu_input.py +0 -292
- build/lib/build/lib/clitt/core/tui/minput/minput.py +0 -44
- build/lib/build/lib/clitt/core/tui/minput/minput_utils.py +0 -156
- build/lib/build/lib/clitt/core/tui/mselect/__init__.py +0 -12
- build/lib/build/lib/clitt/core/tui/mselect/menu_select.py +0 -170
- build/lib/build/lib/clitt/core/tui/mselect/mselect.py +0 -36
- build/lib/build/lib/clitt/core/tui/table/__init__.py +0 -12
- build/lib/build/lib/clitt/core/tui/table/table_enums.py +0 -47
- build/lib/build/lib/clitt/core/tui/table/table_renderer.py +0 -339
- build/lib/build/lib/clitt/core/tui/tui_application.py +0 -52
- build/lib/build/lib/clitt/core/tui/tui_component.py +0 -154
- build/lib/build/lib/clitt/core/tui/tui_preferences.py +0 -103
- build/lib/build/lib/clitt/utils/__init__.py +0 -11
- build/lib/build/lib/clitt/utils/git_utils.py +0 -66
- build/lib/clitt/__classpath__.py +0 -28
- build/lib/clitt/__init__.py +0 -13
- build/lib/clitt/__main__.py +0 -139
- build/lib/clitt/addons/__init__.py +0 -12
- build/lib/clitt/addons/appman/__init__.py +0 -13
- build/lib/clitt/addons/appman/appman.py +0 -305
- build/lib/clitt/addons/appman/appman_enums.py +0 -39
- build/lib/clitt/addons/appman/templates/__init__.py +0 -11
- build/lib/clitt/addons/widman/__init__.py +0 -14
- build/lib/clitt/addons/widman/widget.py +0 -70
- build/lib/clitt/addons/widman/widget_entry.py +0 -54
- build/lib/clitt/addons/widman/widgets/__init__.py +0 -14
- build/lib/clitt/addons/widman/widgets/widget_free.py +0 -110
- build/lib/clitt/addons/widman/widgets/widget_punch.py +0 -246
- build/lib/clitt/addons/widman/widgets/widget_send_msg.py +0 -272
- build/lib/clitt/addons/widman/widgets/widget_time_calc.py +0 -146
- build/lib/clitt/addons/widman/widman.py +0 -123
- build/lib/clitt/core/__init__.py +0 -15
- build/lib/clitt/core/exception/__init__.py +0 -11
- build/lib/clitt/core/exception/exceptions.py +0 -19
- build/lib/clitt/core/icons/__init__.py +0 -12
- build/lib/clitt/core/icons/emojis/__init__.py +0 -12
- build/lib/clitt/core/icons/emojis/emojis.py +0 -41
- build/lib/clitt/core/icons/emojis/face_smiling.py +0 -40
- build/lib/clitt/core/icons/font_awesome/__init__.py +0 -18
- build/lib/clitt/core/icons/font_awesome/app_icons.py +0 -55
- build/lib/clitt/core/icons/font_awesome/awesome.py +0 -76
- build/lib/clitt/core/icons/font_awesome/dashboard_icons.py +0 -93
- build/lib/clitt/core/icons/font_awesome/form_icons.py +0 -69
- build/lib/clitt/core/icons/font_awesome/game_icons.py +0 -59
- build/lib/clitt/core/icons/font_awesome/nav_icons.py +0 -42
- build/lib/clitt/core/icons/font_awesome/trickplay_icons.py +0 -39
- build/lib/clitt/core/icons/font_awesome/widget_icons.py +0 -37
- build/lib/clitt/core/preferences.py +0 -87
- build/lib/clitt/core/term/__init__.py +0 -14
- build/lib/clitt/core/term/commons.py +0 -106
- build/lib/clitt/core/term/cursor.py +0 -174
- build/lib/clitt/core/term/screen.py +0 -106
- build/lib/clitt/core/term/terminal.py +0 -202
- build/lib/clitt/core/tui/__init__.py +0 -20
- build/lib/clitt/core/tui/line_input/__init__.py +0 -12
- build/lib/clitt/core/tui/line_input/keyboard_input.py +0 -229
- build/lib/clitt/core/tui/line_input/line_input.py +0 -31
- build/lib/clitt/core/tui/mchoose/__init__.py +0 -12
- build/lib/clitt/core/tui/mchoose/mchoose.py +0 -43
- build/lib/clitt/core/tui/mchoose/menu_choose.py +0 -192
- build/lib/clitt/core/tui/mdashboard/__init__.py +0 -14
- build/lib/clitt/core/tui/mdashboard/dashboard_builder.py +0 -54
- build/lib/clitt/core/tui/mdashboard/dashboard_item.py +0 -31
- build/lib/clitt/core/tui/mdashboard/mdashboard.py +0 -26
- build/lib/clitt/core/tui/mdashboard/menu_dashboard.py +0 -148
- build/lib/clitt/core/tui/menu/__init__.py +0 -16
- build/lib/clitt/core/tui/menu/tui_menu.py +0 -111
- build/lib/clitt/core/tui/menu/tui_menu_action.py +0 -47
- build/lib/clitt/core/tui/menu/tui_menu_factory.py +0 -117
- build/lib/clitt/core/tui/menu/tui_menu_item.py +0 -196
- build/lib/clitt/core/tui/menu/tui_menu_ui.py +0 -98
- build/lib/clitt/core/tui/menu/tui_menu_view.py +0 -57
- build/lib/clitt/core/tui/minput/__init__.py +0 -19
- build/lib/clitt/core/tui/minput/access_type.py +0 -26
- build/lib/clitt/core/tui/minput/field_builder.py +0 -117
- build/lib/clitt/core/tui/minput/form_builder.py +0 -72
- build/lib/clitt/core/tui/minput/form_field.py +0 -180
- build/lib/clitt/core/tui/minput/input_type.py +0 -30
- build/lib/clitt/core/tui/minput/input_validator.py +0 -98
- build/lib/clitt/core/tui/minput/menu_input.py +0 -292
- build/lib/clitt/core/tui/minput/minput.py +0 -44
- build/lib/clitt/core/tui/minput/minput_utils.py +0 -156
- build/lib/clitt/core/tui/mselect/__init__.py +0 -12
- build/lib/clitt/core/tui/mselect/menu_select.py +0 -170
- build/lib/clitt/core/tui/mselect/mselect.py +0 -36
- build/lib/clitt/core/tui/table/__init__.py +0 -12
- build/lib/clitt/core/tui/table/table_enums.py +0 -47
- build/lib/clitt/core/tui/table/table_renderer.py +0 -339
- build/lib/clitt/core/tui/tui_application.py +0 -52
- build/lib/clitt/core/tui/tui_component.py +0 -154
- build/lib/clitt/core/tui/tui_preferences.py +0 -103
- build/lib/clitt/utils/__init__.py +0 -11
- build/lib/clitt/utils/git_utils.py +0 -66
- hspylib_clitt-0.9.119.dist-info/RECORD +0 -413
- {hspylib_clitt-0.9.119.dist-info → hspylib_clitt-0.9.121.dist-info}/WHEEL +0 -0
|
@@ -1,192 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env python3
|
|
2
|
-
# -*- coding: utf-8 -*-
|
|
3
|
-
|
|
4
|
-
"""
|
|
5
|
-
@project: HsPyLib
|
|
6
|
-
@package: clitt.core.tui.mchoose
|
|
7
|
-
@file: menu_choose.py
|
|
8
|
-
@created: Wed, 17 May 2023
|
|
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.icons.font_awesome.nav_icons import NavIcons
|
|
16
|
-
from clitt.core.term.commons import Direction, Portion
|
|
17
|
-
from clitt.core.tui.tui_component import TUIComponent
|
|
18
|
-
from hspylib.core.tools.commons import to_bool
|
|
19
|
-
from hspylib.core.tools.dict_tools import get_or_default
|
|
20
|
-
from hspylib.modules.cli.keyboard import Keyboard
|
|
21
|
-
from typing import List, Optional, TypeAlias, TypeVar
|
|
22
|
-
|
|
23
|
-
T = TypeVar("T")
|
|
24
|
-
|
|
25
|
-
MChooseItems: TypeAlias = List[T]
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
class MenuChoose(TUIComponent):
|
|
29
|
-
"""Terminal UI menu choose input method."""
|
|
30
|
-
|
|
31
|
-
NAV_ICONS = NavIcons.compose(NavIcons.UP, NavIcons.DOWN)
|
|
32
|
-
|
|
33
|
-
ROW_OFFSET = 5
|
|
34
|
-
|
|
35
|
-
MIN_ROWS = 3
|
|
36
|
-
|
|
37
|
-
def __init__(self, title: str, items: MChooseItems, checked: bool | List[bool] = False):
|
|
38
|
-
|
|
39
|
-
super().__init__(title)
|
|
40
|
-
self.items = items
|
|
41
|
-
self.show_from = 0
|
|
42
|
-
self.show_to = self._max_rows()
|
|
43
|
-
self.diff_index = self.show_to - self.show_from
|
|
44
|
-
self.sel_index = 0
|
|
45
|
-
self.max_line_length = max(len(str(item)) for item in items)
|
|
46
|
-
# Initialize all options
|
|
47
|
-
if isinstance(checked, bool):
|
|
48
|
-
self.sel_options = [checked for _ in range(len(items))]
|
|
49
|
-
else:
|
|
50
|
-
# Check both sizes
|
|
51
|
-
self.sel_options = [get_or_default(checked, i, 0) for i in range(len(items))]
|
|
52
|
-
|
|
53
|
-
def execute(self) -> Optional[MChooseItems]:
|
|
54
|
-
if len(self.items) == 0:
|
|
55
|
-
return None
|
|
56
|
-
|
|
57
|
-
self._prepare_render()
|
|
58
|
-
keypress = self._loop()
|
|
59
|
-
|
|
60
|
-
return [op for idx, op in enumerate(self.items) if self.sel_options[idx]] if keypress.isEnter() else None
|
|
61
|
-
|
|
62
|
-
def render(self) -> None:
|
|
63
|
-
length = len(self.items)
|
|
64
|
-
self.cursor.restore()
|
|
65
|
-
self.writeln(f"{self.prefs.title_color.placeholder}{self.title}%EOL%%NC%")
|
|
66
|
-
|
|
67
|
-
for idx in range(self.show_from, self.show_to):
|
|
68
|
-
if idx >= length:
|
|
69
|
-
break # When the index is greater than the number of items, stop rendering
|
|
70
|
-
|
|
71
|
-
option_line = str(self.items[idx])
|
|
72
|
-
self.cursor.erase(Portion.LINE)
|
|
73
|
-
# Print the selector if the index is currently selected
|
|
74
|
-
selector = self.draw_selector(idx == self.sel_index)
|
|
75
|
-
mark = self.prefs.checked_icon if to_bool(self.sel_options[idx]) else self.prefs.unchecked_icon
|
|
76
|
-
# fmt: off
|
|
77
|
-
line_fmt = (
|
|
78
|
-
" {:>" + f"{len(str(length))}" + "} "
|
|
79
|
-
+ "{:>" + f"{len(selector)}" + "} "
|
|
80
|
-
+ "{:>" + f"{len(str(mark))}" + "} "
|
|
81
|
-
+ "{:<" + f"{self.max_line_length}" + "} "
|
|
82
|
-
)
|
|
83
|
-
# fmt: on
|
|
84
|
-
self.draw_line(line_fmt, idx + 1, selector, mark, option_line)
|
|
85
|
-
|
|
86
|
-
self.draw_navbar(self.navbar(to=length))
|
|
87
|
-
self._re_render = False
|
|
88
|
-
|
|
89
|
-
def navbar(self, **kwargs) -> str:
|
|
90
|
-
return (
|
|
91
|
-
f"%EOL%{self.prefs.navbar_color.placeholder}"
|
|
92
|
-
f"[Enter] Accept [{self.NAV_ICONS}] "
|
|
93
|
-
f"Navigate [Space] Mark [I] Invert [Esc] Quit [1..{kwargs['to']}] Goto: %NC%"
|
|
94
|
-
)
|
|
95
|
-
|
|
96
|
-
def handle_keypress(self) -> Keyboard:
|
|
97
|
-
if keypress := Keyboard.wait_keystroke():
|
|
98
|
-
match keypress:
|
|
99
|
-
case _ as key if key in Keyboard.break_keys():
|
|
100
|
-
self._done = True
|
|
101
|
-
case Keyboard.VK_UP:
|
|
102
|
-
self._handle_key_up()
|
|
103
|
-
case Keyboard.VK_DOWN:
|
|
104
|
-
self._handle_key_down()
|
|
105
|
-
case Keyboard.VK_TAB:
|
|
106
|
-
self._handle_tab()
|
|
107
|
-
case Keyboard.VK_SHIFT_TAB:
|
|
108
|
-
self._handle_shift_tab()
|
|
109
|
-
case Keyboard.VK_SPACE:
|
|
110
|
-
self._handle_space()
|
|
111
|
-
case _ as key if key in [Keyboard.VK_i, Keyboard.VK_I]:
|
|
112
|
-
self._handle_key_i()
|
|
113
|
-
case _ as key if key in Keyboard.digits():
|
|
114
|
-
self._handle_digit(keypress)
|
|
115
|
-
|
|
116
|
-
return keypress
|
|
117
|
-
|
|
118
|
-
def _handle_digit(self, digit: Keyboard) -> None:
|
|
119
|
-
"""TODO"""
|
|
120
|
-
length = len(self.items)
|
|
121
|
-
typed_index = digit.value
|
|
122
|
-
self.write(f"{digit.value}") # echo the digit typed
|
|
123
|
-
index_len = 1
|
|
124
|
-
while len(typed_index) < len(str(length)):
|
|
125
|
-
keystroke = Keyboard.wait_keystroke()
|
|
126
|
-
if not keystroke or not keystroke.isdigit():
|
|
127
|
-
typed_index = None if keystroke != Keyboard.VK_ENTER else typed_index
|
|
128
|
-
break
|
|
129
|
-
typed_index = f"{typed_index}{keystroke.value if keystroke else ''}"
|
|
130
|
-
self.write(f"{keystroke.value if keystroke else ''}")
|
|
131
|
-
index_len += 1
|
|
132
|
-
# Erase the index typed by the user
|
|
133
|
-
self.cursor.move(index_len, Direction.LEFT)
|
|
134
|
-
self.cursor.erase(Direction.RIGHT)
|
|
135
|
-
if typed_index and 1 <= int(typed_index) <= length:
|
|
136
|
-
self.show_to = max(int(typed_index), self.diff_index)
|
|
137
|
-
self.show_from = self.show_to - self.diff_index
|
|
138
|
-
self.sel_index = int(typed_index) - 1
|
|
139
|
-
self._re_render = True
|
|
140
|
-
|
|
141
|
-
def _handle_key_up(self) -> None:
|
|
142
|
-
"""TODO"""
|
|
143
|
-
if self.sel_index == self.show_from and self.show_from > 0:
|
|
144
|
-
self.show_from -= 1
|
|
145
|
-
self.show_to -= 1
|
|
146
|
-
if self.sel_index - 1 >= 0:
|
|
147
|
-
self.sel_index -= 1
|
|
148
|
-
self._re_render = True
|
|
149
|
-
|
|
150
|
-
def _handle_key_down(self) -> None:
|
|
151
|
-
"""TODO"""
|
|
152
|
-
length = len(self.items)
|
|
153
|
-
if self.sel_index + 1 == self.show_to and self.show_to < length:
|
|
154
|
-
self.show_from += 1
|
|
155
|
-
self.show_to += 1
|
|
156
|
-
if self.sel_index + 1 < length:
|
|
157
|
-
self.sel_index += 1
|
|
158
|
-
self._re_render = True
|
|
159
|
-
|
|
160
|
-
def _handle_tab(self) -> None:
|
|
161
|
-
"""TODO"""
|
|
162
|
-
length = len(self.items)
|
|
163
|
-
page_index = min(self.show_to + self.diff_index, length)
|
|
164
|
-
self.show_to = max(page_index, self.diff_index)
|
|
165
|
-
self.show_from = self.show_to - self.diff_index
|
|
166
|
-
self.sel_index = self.show_from
|
|
167
|
-
self._re_render = True
|
|
168
|
-
|
|
169
|
-
def _handle_shift_tab(self) -> None:
|
|
170
|
-
"""TODO"""
|
|
171
|
-
page_index = max(self.show_from - self.diff_index, 0)
|
|
172
|
-
self.show_from = min(page_index, self.diff_index)
|
|
173
|
-
self.show_to = self.show_from + self.diff_index
|
|
174
|
-
self.sel_index = self.show_from
|
|
175
|
-
self._re_render = True
|
|
176
|
-
|
|
177
|
-
def _handle_space(self) -> None:
|
|
178
|
-
"""TODO"""
|
|
179
|
-
if self.sel_options[self.sel_index] == 0:
|
|
180
|
-
self.sel_options[self.sel_index] = 1
|
|
181
|
-
else:
|
|
182
|
-
self.sel_options[self.sel_index] = 0
|
|
183
|
-
self._re_render = True
|
|
184
|
-
|
|
185
|
-
def _handle_key_i(self) -> None:
|
|
186
|
-
"""TODO"""
|
|
187
|
-
self.sel_options = [(0 if op == 1 else 1) for op in self.sel_options]
|
|
188
|
-
self._re_render = True
|
|
189
|
-
|
|
190
|
-
def _max_rows(self) -> int:
|
|
191
|
-
screen_lines = self.screen.lines - self.ROW_OFFSET
|
|
192
|
-
return min(self.prefs.max_rows, screen_lines)
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
# _*_ coding: utf-8 _*_
|
|
2
|
-
#
|
|
3
|
-
# hspylib-clitt v0.9.119
|
|
4
|
-
#
|
|
5
|
-
# Package: main.build.lib.build.lib.build.lib.build.lib.clitt.core.tui.mdashboard
|
|
6
|
-
"""Package initialization."""
|
|
7
|
-
|
|
8
|
-
__all__ = [
|
|
9
|
-
'dashboard_builder',
|
|
10
|
-
'dashboard_item',
|
|
11
|
-
'mdashboard',
|
|
12
|
-
'menu_dashboard'
|
|
13
|
-
]
|
|
14
|
-
__version__ = '0.9.119'
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env python3
|
|
2
|
-
# -*- coding: utf-8 -*-
|
|
3
|
-
|
|
4
|
-
"""
|
|
5
|
-
@project: HsPyLib
|
|
6
|
-
@package: clitt.core.tui.mdashboard
|
|
7
|
-
@file: dashboard_builder.py
|
|
8
|
-
@created: Thu, 20 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.core.icons.font_awesome.awesome import Awesome
|
|
16
|
-
from clitt.core.tui.mdashboard.dashboard_item import DashboardItem
|
|
17
|
-
from typing import Callable, List, Optional
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
class DashboardBuilder:
|
|
21
|
-
"""Dashboard builder."""
|
|
22
|
-
|
|
23
|
-
@staticmethod
|
|
24
|
-
class DashboardItemBuilder:
|
|
25
|
-
"""Dashboard item builder."""
|
|
26
|
-
|
|
27
|
-
def __init__(self, parent: "DashboardBuilder"):
|
|
28
|
-
self._parent = parent
|
|
29
|
-
self._item = DashboardItem()
|
|
30
|
-
|
|
31
|
-
def icon(self, icon: Awesome) -> "DashboardBuilder.DashboardItemBuilder":
|
|
32
|
-
self._item.icon = icon
|
|
33
|
-
return self
|
|
34
|
-
|
|
35
|
-
def tooltip(self, tooltip: str) -> "DashboardBuilder.DashboardItemBuilder":
|
|
36
|
-
self._item.tooltip = tooltip
|
|
37
|
-
return self
|
|
38
|
-
|
|
39
|
-
def on_trigger(self, on_trigger: Callable) -> Optional["DashboardBuilder.DashboardItemBuilder"]:
|
|
40
|
-
self._item.on_trigger = on_trigger
|
|
41
|
-
return self
|
|
42
|
-
|
|
43
|
-
def build(self) -> "DashboardBuilder":
|
|
44
|
-
self._parent.items.append(self._item)
|
|
45
|
-
return self._parent
|
|
46
|
-
|
|
47
|
-
def __init__(self):
|
|
48
|
-
self.items = []
|
|
49
|
-
|
|
50
|
-
def item(self) -> DashboardItemBuilder:
|
|
51
|
-
return DashboardBuilder.DashboardItemBuilder(self)
|
|
52
|
-
|
|
53
|
-
def build(self) -> List[DashboardItem]:
|
|
54
|
-
return self.items
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env python3
|
|
2
|
-
# -*- coding: utf-8 -*-
|
|
3
|
-
|
|
4
|
-
"""
|
|
5
|
-
@project: HsPyLib
|
|
6
|
-
@package: clitt.core.tui.mdashboard
|
|
7
|
-
@file: dashboard_item.py
|
|
8
|
-
@created: Thu, 20 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.core.icons.font_awesome.awesome import Awesome
|
|
16
|
-
from typing import Callable, Optional
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
class DashboardItem:
|
|
20
|
-
"""Represent a dashboard item."""
|
|
21
|
-
|
|
22
|
-
def __init__(self, icon: Awesome = None, tooltip: str = None, on_trigger: Optional[Callable] = None):
|
|
23
|
-
self.icon = icon
|
|
24
|
-
self.tooltip = tooltip
|
|
25
|
-
self.on_trigger = on_trigger
|
|
26
|
-
|
|
27
|
-
def __str__(self):
|
|
28
|
-
return f'{self.icon} "{self.tooltip}" -> {self.on_trigger}'
|
|
29
|
-
|
|
30
|
-
def __repr__(self):
|
|
31
|
-
return str(self)
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env python3
|
|
2
|
-
# -*- coding: utf-8 -*-
|
|
3
|
-
|
|
4
|
-
"""
|
|
5
|
-
@project: HsPyLib
|
|
6
|
-
@package: clitt.core.tui.mdashboard
|
|
7
|
-
@file: mdashboard.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.core.tui.mdashboard.dashboard_item import DashboardItem
|
|
16
|
-
from clitt.core.tui.mdashboard.menu_dashboard import MenuDashBoard
|
|
17
|
-
from typing import List, Optional
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
def mdashboard(items: List[DashboardItem], title: str = "Please select one item") -> Optional[DashboardItem]:
|
|
21
|
-
"""
|
|
22
|
-
Wrapper for the Menu Dashboard.
|
|
23
|
-
:param items: the provided dashboard items to select from.
|
|
24
|
-
:param title: the title to be displayed before the options.
|
|
25
|
-
"""
|
|
26
|
-
return MenuDashBoard(title, items).execute()
|
|
@@ -1,148 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env python3
|
|
2
|
-
# -*- coding: utf-8 -*-
|
|
3
|
-
|
|
4
|
-
"""
|
|
5
|
-
@project: HsPyLib
|
|
6
|
-
@package: clitt.core.tui.mdashboard
|
|
7
|
-
@file: menu_dashboard.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.core.icons.font_awesome.nav_icons import NavIcons
|
|
16
|
-
from clitt.core.term.commons import Direction, Portion
|
|
17
|
-
from clitt.core.tui.mdashboard.dashboard_builder import DashboardBuilder
|
|
18
|
-
from clitt.core.tui.mdashboard.dashboard_item import DashboardItem
|
|
19
|
-
from clitt.core.tui.tui_component import TUIComponent
|
|
20
|
-
from hspylib.core.preconditions import check_state
|
|
21
|
-
from hspylib.modules.cli.keyboard import Keyboard
|
|
22
|
-
from typing import List, Optional, TypeAlias
|
|
23
|
-
|
|
24
|
-
DashboardMatrix: TypeAlias = List[List[str]]
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
class MenuDashBoard(TUIComponent):
|
|
28
|
-
"""A dashboard is a type of graphical user interface which provides at-a-glance views."""
|
|
29
|
-
|
|
30
|
-
# fmt: off
|
|
31
|
-
ICN = "x" # x mars the spot if the icon.
|
|
32
|
-
|
|
33
|
-
# Selected cell template.
|
|
34
|
-
CELL_TPL = [
|
|
35
|
-
[" ", " ", " ", " ", " ", " ", " "],
|
|
36
|
-
[" ", " ", " ", ICN, " ", " ", " "],
|
|
37
|
-
[" ", " ", " ", " ", " ", " ", " "],
|
|
38
|
-
]
|
|
39
|
-
|
|
40
|
-
# Unselected cell template.
|
|
41
|
-
SEL_CELL_TPL = [
|
|
42
|
-
[" ", "╭", " ", " ", " ", "╮", " "],
|
|
43
|
-
[" ", " ", " ", ICN, " ", " ", " "],
|
|
44
|
-
[" ", "╰", " ", " ", " ", "╯", " "],
|
|
45
|
-
]
|
|
46
|
-
# fmt: on
|
|
47
|
-
|
|
48
|
-
NAV_ICONS = NavIcons.compose(NavIcons.LEFT, NavIcons.DOWN, NavIcons.UP, NavIcons.RIGHT)
|
|
49
|
-
|
|
50
|
-
COLUMN_OFFSET = 10
|
|
51
|
-
|
|
52
|
-
MIN_COLUMNS = 2
|
|
53
|
-
|
|
54
|
-
@classmethod
|
|
55
|
-
def builder(cls) -> DashboardBuilder:
|
|
56
|
-
return DashboardBuilder()
|
|
57
|
-
|
|
58
|
-
def __init__(self, title: str, items: List[DashboardItem]):
|
|
59
|
-
super().__init__(title)
|
|
60
|
-
self._items = items
|
|
61
|
-
self._tab_index = 0
|
|
62
|
-
check_state(
|
|
63
|
-
len(self.CELL_TPL) == len(self.SEL_CELL_TPL) and len(self.CELL_TPL[0]) == len(self.SEL_CELL_TPL[0]),
|
|
64
|
-
"Invalid CELL definitions. Selected and Unselected matrices should have the same lengths.",
|
|
65
|
-
)
|
|
66
|
-
|
|
67
|
-
def execute(self) -> Optional[DashboardItem]:
|
|
68
|
-
if (len(self._items)) == 0:
|
|
69
|
-
return None
|
|
70
|
-
|
|
71
|
-
self._prepare_render()
|
|
72
|
-
keypress = self._loop()
|
|
73
|
-
selected = self._items[self._tab_index] if keypress == Keyboard.VK_ENTER else None
|
|
74
|
-
|
|
75
|
-
if selected and selected.on_trigger:
|
|
76
|
-
selected.on_trigger()
|
|
77
|
-
|
|
78
|
-
return selected
|
|
79
|
-
|
|
80
|
-
def render(self) -> None:
|
|
81
|
-
self.cursor.restore()
|
|
82
|
-
self.writeln(f"{self.prefs.title_color.placeholder}{self.title}%EOL%%NC%")
|
|
83
|
-
|
|
84
|
-
for idx, item in enumerate(self._items):
|
|
85
|
-
self._draw_item(idx, item, MenuDashBoard.CELL_TPL if self._tab_index != idx else MenuDashBoard.SEL_CELL_TPL)
|
|
86
|
-
|
|
87
|
-
self.cursor.erase(Portion.LINE)
|
|
88
|
-
self.cursor.move_to(column=1)
|
|
89
|
-
self.draw_navbar(self.navbar())
|
|
90
|
-
self._re_render = False
|
|
91
|
-
|
|
92
|
-
def navbar(self, **kwargs) -> str:
|
|
93
|
-
return (
|
|
94
|
-
f"{NavIcons.POINTER} %GREEN%{self._items[self._tab_index].tooltip}%NC%"
|
|
95
|
-
f"%EOL%{self.prefs.navbar_color.placeholder}%EOL%"
|
|
96
|
-
f"[Enter] Select Navigate {self.NAV_ICONS} Next [Tab] [Esc] Quit %NC%"
|
|
97
|
-
)
|
|
98
|
-
|
|
99
|
-
def handle_keypress(self) -> Keyboard:
|
|
100
|
-
length = len(self._items)
|
|
101
|
-
if keypress := Keyboard.wait_keystroke():
|
|
102
|
-
match keypress:
|
|
103
|
-
case _ as key if key in [Keyboard.VK_ESC, Keyboard.VK_ENTER]:
|
|
104
|
-
self._done = True
|
|
105
|
-
case Keyboard.VK_UP:
|
|
106
|
-
self._tab_index = max(0, self._tab_index - self._items_per_line())
|
|
107
|
-
case Keyboard.VK_DOWN:
|
|
108
|
-
self._tab_index = min(length - 1, self._tab_index + self._items_per_line())
|
|
109
|
-
case _ as key if key in [Keyboard.VK_LEFT, Keyboard.VK_SHIFT_TAB]:
|
|
110
|
-
self._tab_index = max(0, self._tab_index - 1)
|
|
111
|
-
case _ as key if key in [Keyboard.VK_RIGHT, Keyboard.VK_TAB]:
|
|
112
|
-
self._tab_index = min(length - 1, self._tab_index + 1)
|
|
113
|
-
|
|
114
|
-
self._re_render = True
|
|
115
|
-
|
|
116
|
-
return keypress
|
|
117
|
-
|
|
118
|
-
def _draw_item(self, item_idx: int, item: DashboardItem, cell_template: DashboardMatrix) -> None:
|
|
119
|
-
"""Print the specified dashboard item at the given index.
|
|
120
|
-
:param item_idx: the item index.
|
|
121
|
-
:param item: the dashboard item.
|
|
122
|
-
:param cell_template: the template of the dashboard cell (selected or unselected).
|
|
123
|
-
"""
|
|
124
|
-
|
|
125
|
-
num_cols, num_rows = len(cell_template[0]), len(cell_template)
|
|
126
|
-
|
|
127
|
-
for row in range(0, num_rows):
|
|
128
|
-
for col in range(0, num_cols):
|
|
129
|
-
cur_cell = cell_template[row][col]
|
|
130
|
-
# Print current cell
|
|
131
|
-
self.write(f"{item.icon if cur_cell == self.ICN else cur_cell}")
|
|
132
|
-
# Move to the next the next row
|
|
133
|
-
self.cursor.move(1, Direction.DOWN)
|
|
134
|
-
self.cursor.move(num_cols, Direction.LEFT)
|
|
135
|
-
|
|
136
|
-
if item_idx > 0 and (item_idx + 1) % self._items_per_line() == 0:
|
|
137
|
-
# Break the line
|
|
138
|
-
self.cursor.move(1, Direction.DOWN)
|
|
139
|
-
self.cursor.move(num_cols * self._items_per_line(), Direction.LEFT)
|
|
140
|
-
elif item_idx + 1 < len(self._items):
|
|
141
|
-
# Continue on the same line
|
|
142
|
-
self.cursor.move(num_rows, Direction.UP)
|
|
143
|
-
self.cursor.move(num_cols, Direction.RIGHT)
|
|
144
|
-
|
|
145
|
-
def _items_per_line(self) -> int:
|
|
146
|
-
"""TODO"""
|
|
147
|
-
screen_columns = self.screen.columns - self.COLUMN_OFFSET
|
|
148
|
-
return max(self.MIN_COLUMNS, min(self.prefs.items_per_line, screen_columns))
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
# _*_ coding: utf-8 _*_
|
|
2
|
-
#
|
|
3
|
-
# hspylib-clitt v0.9.119
|
|
4
|
-
#
|
|
5
|
-
# Package: main.build.lib.build.lib.build.lib.build.lib.clitt.core.tui.menu
|
|
6
|
-
"""Package initialization."""
|
|
7
|
-
|
|
8
|
-
__all__ = [
|
|
9
|
-
'tui_menu',
|
|
10
|
-
'tui_menu_action',
|
|
11
|
-
'tui_menu_factory',
|
|
12
|
-
'tui_menu_item',
|
|
13
|
-
'tui_menu_ui',
|
|
14
|
-
'tui_menu_view'
|
|
15
|
-
]
|
|
16
|
-
__version__ = '0.9.119'
|
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env python3
|
|
2
|
-
# -*- coding: utf-8 -*-
|
|
3
|
-
|
|
4
|
-
"""
|
|
5
|
-
@project: HsPyLib
|
|
6
|
-
@package: clitt.core.tui.menu
|
|
7
|
-
@file: tui_menu.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 abc import ABC
|
|
17
|
-
from clitt.core.icons.font_awesome.nav_icons import NavIcons
|
|
18
|
-
from clitt.core.tui.minput.input_validator import InputValidator
|
|
19
|
-
from clitt.core.tui.minput.menu_input import MenuInput
|
|
20
|
-
from clitt.core.tui.minput.minput import minput
|
|
21
|
-
from clitt.core.tui.tui_component import TUIComponent
|
|
22
|
-
from hspylib.core.namespace import Namespace
|
|
23
|
-
from hspylib.modules.cli.keyboard import Keyboard
|
|
24
|
-
from typing import Callable, Optional, TypeAlias
|
|
25
|
-
|
|
26
|
-
OnTrigger_Cb: TypeAlias = Callable[["TUIMenu"], Optional["TUIMenu"]]
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
class TUIMenu(TUIComponent, ABC):
|
|
30
|
-
"""Provide a base class for terminal UI menus."""
|
|
31
|
-
|
|
32
|
-
@staticmethod
|
|
33
|
-
def prompt(
|
|
34
|
-
label: str, dest: str = None, min_length: int = 1, max_length: int = 32, validator: InputValidator = None
|
|
35
|
-
) -> Optional[Namespace]:
|
|
36
|
-
# fmt: off
|
|
37
|
-
form_fields = (
|
|
38
|
-
MenuInput.builder()
|
|
39
|
-
.field()
|
|
40
|
-
.label(label)
|
|
41
|
-
.dest(dest or label)
|
|
42
|
-
.validator(validator or InputValidator.words())
|
|
43
|
-
.min_max_length(min_length, max_length)
|
|
44
|
-
.build()
|
|
45
|
-
.build()
|
|
46
|
-
)
|
|
47
|
-
# fmt: on
|
|
48
|
-
|
|
49
|
-
return minput(form_fields)
|
|
50
|
-
|
|
51
|
-
def __init__(
|
|
52
|
-
self,
|
|
53
|
-
parent: Optional["TUIMenu"] = None,
|
|
54
|
-
title: str = "",
|
|
55
|
-
tooltip: str = "",
|
|
56
|
-
default_on_trigger_cb: OnTrigger_Cb = None,
|
|
57
|
-
):
|
|
58
|
-
super().__init__(title)
|
|
59
|
-
self._tooltip = tooltip
|
|
60
|
-
self._parent = parent
|
|
61
|
-
self._on_trigger = default_on_trigger_cb or self._default_trigger_cb
|
|
62
|
-
|
|
63
|
-
def __str__(self) -> str:
|
|
64
|
-
return self._title
|
|
65
|
-
|
|
66
|
-
def __repr__(self) -> str:
|
|
67
|
-
return str(self)
|
|
68
|
-
|
|
69
|
-
@property
|
|
70
|
-
def parent(self) -> Optional["TUIMenu"]:
|
|
71
|
-
return self._parent
|
|
72
|
-
|
|
73
|
-
@property
|
|
74
|
-
def tooltip(self) -> str:
|
|
75
|
-
return self._tooltip
|
|
76
|
-
|
|
77
|
-
def handle_keypress(self) -> Keyboard:
|
|
78
|
-
if keypress := Keyboard.wait_keystroke():
|
|
79
|
-
match keypress:
|
|
80
|
-
case Keyboard.VK_ENTER | Keyboard.VK_ESC:
|
|
81
|
-
self._done = True
|
|
82
|
-
|
|
83
|
-
return keypress
|
|
84
|
-
|
|
85
|
-
def navbar(self, **kwargs) -> str:
|
|
86
|
-
return (
|
|
87
|
-
f"%EOL%{self.breadcrumb()}%ED0%"
|
|
88
|
-
f"%EOL%{self.prefs.navbar_color.placeholder}%EOL%"
|
|
89
|
-
f"[Enter] Back [Esc] Quit %EL0%%EOL%%EOL%%NC%"
|
|
90
|
-
)
|
|
91
|
-
|
|
92
|
-
def breadcrumb(self) -> str:
|
|
93
|
-
"""Provide a breadcrumb of menus for navigation purposes."""
|
|
94
|
-
return (
|
|
95
|
-
f"{self.prefs.breadcrumb_color.placeholder}"
|
|
96
|
-
f" {NavIcons.BREADCRUMB} {self.title} %NC%"
|
|
97
|
-
f"{self.prefs.tooltip_color.placeholder}"
|
|
98
|
-
)
|
|
99
|
-
|
|
100
|
-
def wait_keystroke(self, wait_message: str = "%YELLOW%%EOL%Press any key to continue%EOL%%NC%") -> None:
|
|
101
|
-
"""Wait for a keypress (blocking).
|
|
102
|
-
:param wait_message: the message to present to the user.
|
|
103
|
-
"""
|
|
104
|
-
self.writeln(wait_message)
|
|
105
|
-
Keyboard.wait_keystroke()
|
|
106
|
-
|
|
107
|
-
def _default_trigger_cb(self, source: Optional["TUIMenu"]) -> Optional["TUIMenu"]:
|
|
108
|
-
"""Provide a default trigger callback when a menu is activated. Provided a source menu, returns it's parent.
|
|
109
|
-
:param source: the source which invoked this menu.
|
|
110
|
-
"""
|
|
111
|
-
return self.parent
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env python3
|
|
2
|
-
# -*- coding: utf-8 -*-
|
|
3
|
-
|
|
4
|
-
"""
|
|
5
|
-
@project: HsPyLib
|
|
6
|
-
@package: clitt.core.tui.menu
|
|
7
|
-
@file: tui_menu_action.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.core.tui.menu.tui_menu import OnTrigger_Cb, TUIMenu
|
|
16
|
-
from clitt.core.tui.menu.tui_menu_ui import TUIMenuUi
|
|
17
|
-
from typing import Optional
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
class TUIMenuAction(TUIMenu):
|
|
21
|
-
"""Represent a menu item action. Each action trigger a callback function."""
|
|
22
|
-
|
|
23
|
-
def execute(self) -> Optional[TUIMenu]:
|
|
24
|
-
self.render()
|
|
25
|
-
ret_menu = self._on_trigger(self._parent)
|
|
26
|
-
if not ret_menu:
|
|
27
|
-
self.wait_keystroke()
|
|
28
|
-
return ret_menu if ret_menu else self._default_trigger_cb(self)
|
|
29
|
-
|
|
30
|
-
def render(self) -> None:
|
|
31
|
-
self.screen.cursor.restore()
|
|
32
|
-
TUIMenuUi.render_app_title()
|
|
33
|
-
|
|
34
|
-
def __init__(
|
|
35
|
-
self,
|
|
36
|
-
parent: TUIMenu,
|
|
37
|
-
title: Optional[str] = None,
|
|
38
|
-
tooltip: Optional[str] = None,
|
|
39
|
-
on_trigger: OnTrigger_Cb = None,
|
|
40
|
-
):
|
|
41
|
-
super().__init__(parent, title, tooltip)
|
|
42
|
-
self._parent = parent
|
|
43
|
-
self._on_trigger: OnTrigger_Cb = on_trigger or super()._default_trigger_cb
|
|
44
|
-
|
|
45
|
-
def on_trigger(self, cb_on_trigger: OnTrigger_Cb) -> None:
|
|
46
|
-
"""Setter for the on_trigger callback. It is called when a menu item is triggered."""
|
|
47
|
-
self._on_trigger = cb_on_trigger
|