hspylib-clitt 0.9.116__py3-none-any.whl → 0.9.118__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/__classpath__.py +2 -2
- clitt/__init__.py +3 -3
- clitt/__main__.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/appman/templates/main_qt_view.py.tpl +1 -1
- 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/exception/exceptions.py +1 -0
- 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 +33 -8
- clitt/core/term/cursor.py +19 -4
- clitt/core/term/screen.py +16 -1
- clitt/core/term/terminal.py +16 -17
- clitt/core/tui/__init__.py +3 -3
- clitt/core/tui/line_input/__init__.py +3 -3
- clitt/core/tui/line_input/keyboard_input.py +36 -35
- clitt/core/tui/line_input/line_input.py +5 -17
- clitt/core/tui/mchoose/__init__.py +3 -3
- clitt/core/tui/mchoose/mchoose.py +2 -3
- clitt/core/tui/mchoose/menu_choose.py +6 -14
- clitt/core/tui/mdashboard/__init__.py +3 -3
- clitt/core/tui/mdashboard/menu_dashboard.py +2 -8
- 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/mselect/menu_select.py +2 -3
- clitt/core/tui/table/__init__.py +3 -3
- clitt/core/tui/tui_application.py +8 -21
- clitt/core/tui/tui_component.py +4 -5
- clitt/core/tui/tui_preferences.py +1 -1
- clitt/utils/__init__.py +3 -3
- {hspylib_clitt-0.9.116.dist-info → hspylib_clitt-0.9.118.dist-info}/METADATA +2 -2
- hspylib_clitt-0.9.118.dist-info/RECORD +97 -0
- {hspylib_clitt-0.9.116.dist-info → hspylib_clitt-0.9.118.dist-info}/WHEEL +1 -1
- {hspylib_clitt-0.9.116.dist-info → hspylib_clitt-0.9.118.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 -18
- 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 -82
- build/lib/build/lib/build/lib/build/lib/clitt/core/term/cursor.py +0 -159
- build/lib/build/lib/build/lib/build/lib/clitt/core/term/screen.py +0 -91
- build/lib/build/lib/build/lib/build/lib/clitt/core/term/terminal.py +0 -203
- 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 -228
- build/lib/build/lib/build/lib/build/lib/clitt/core/tui/line_input/line_input.py +0 -43
- 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 -44
- build/lib/build/lib/build/lib/build/lib/clitt/core/tui/mchoose/menu_choose.py +0 -200
- 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 -154
- 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 -171
- 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 -65
- build/lib/build/lib/build/lib/build/lib/clitt/core/tui/tui_component.py +0 -155
- 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 -18
- 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 -82
- build/lib/build/lib/build/lib/clitt/core/term/cursor.py +0 -159
- build/lib/build/lib/build/lib/clitt/core/term/screen.py +0 -91
- build/lib/build/lib/build/lib/clitt/core/term/terminal.py +0 -203
- 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 -228
- build/lib/build/lib/build/lib/clitt/core/tui/line_input/line_input.py +0 -43
- 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 -44
- build/lib/build/lib/build/lib/clitt/core/tui/mchoose/menu_choose.py +0 -200
- 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 -154
- 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 -171
- 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 -65
- build/lib/build/lib/build/lib/clitt/core/tui/tui_component.py +0 -155
- 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 -18
- 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 -82
- build/lib/build/lib/clitt/core/term/cursor.py +0 -159
- build/lib/build/lib/clitt/core/term/screen.py +0 -91
- build/lib/build/lib/clitt/core/term/terminal.py +0 -203
- 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 -228
- build/lib/build/lib/clitt/core/tui/line_input/line_input.py +0 -43
- build/lib/build/lib/clitt/core/tui/mchoose/__init__.py +0 -12
- build/lib/build/lib/clitt/core/tui/mchoose/mchoose.py +0 -44
- build/lib/build/lib/clitt/core/tui/mchoose/menu_choose.py +0 -200
- 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 -154
- 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 -171
- 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 -65
- build/lib/build/lib/clitt/core/tui/tui_component.py +0 -155
- 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 -18
- 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 -82
- build/lib/clitt/core/term/cursor.py +0 -159
- build/lib/clitt/core/term/screen.py +0 -91
- build/lib/clitt/core/term/terminal.py +0 -203
- 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 -228
- build/lib/clitt/core/tui/line_input/line_input.py +0 -43
- build/lib/clitt/core/tui/mchoose/__init__.py +0 -12
- build/lib/clitt/core/tui/mchoose/mchoose.py +0 -44
- build/lib/clitt/core/tui/mchoose/menu_choose.py +0 -200
- 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 -154
- 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 -171
- 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 -65
- build/lib/clitt/core/tui/tui_component.py +0 -155
- 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.116.dist-info/RECORD +0 -413
|
@@ -1,305 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env python3
|
|
2
|
-
# -*- coding: utf-8 -*-
|
|
3
|
-
|
|
4
|
-
"""
|
|
5
|
-
@project: HsPyLib-Clitt
|
|
6
|
-
@package: clitt.addons.appman
|
|
7
|
-
@file: appman.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.addons.appman.appman_enums import AppExtension, AppType
|
|
16
|
-
from clitt.core.term.terminal import Terminal
|
|
17
|
-
from clitt.core.tui.minput.input_validator import InputValidator
|
|
18
|
-
from clitt.core.tui.minput.minput import MenuInput, minput
|
|
19
|
-
from hspylib.core.enums.charset import Charset
|
|
20
|
-
from hspylib.core.enums.http_code import HttpCode
|
|
21
|
-
from hspylib.core.metaclass.singleton import Singleton
|
|
22
|
-
from hspylib.core.namespace import Namespace
|
|
23
|
-
from hspylib.core.preconditions import check_argument
|
|
24
|
-
from hspylib.core.tools.commons import get_path, syserr, sysout
|
|
25
|
-
from hspylib.core.tools.text_tools import camelcase, ensure_endswith
|
|
26
|
-
from hspylib.modules.application.application import Application
|
|
27
|
-
from hspylib.modules.application.exit_status import ExitStatus
|
|
28
|
-
from hspylib.modules.application.version import Version
|
|
29
|
-
from hspylib.modules.fetch.fetch import get
|
|
30
|
-
from textwrap import dedent
|
|
31
|
-
from typing import List
|
|
32
|
-
|
|
33
|
-
import os
|
|
34
|
-
import stat
|
|
35
|
-
import urllib3
|
|
36
|
-
|
|
37
|
-
HERE = get_path(__file__)
|
|
38
|
-
|
|
39
|
-
INITIAL_REVISION = Version.initial()
|
|
40
|
-
|
|
41
|
-
WELCOME_MESSAGE = f"My Application v{INITIAL_REVISION}"
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
class AppManager(metaclass=Singleton):
|
|
45
|
-
"""HsPyLib application manager that helps creating HsPyLib based applications and widgets."""
|
|
46
|
-
|
|
47
|
-
# The directory containing all template files
|
|
48
|
-
TEMPLATES = HERE / "templates"
|
|
49
|
-
|
|
50
|
-
# The general gradle properties
|
|
51
|
-
GRADLE_PROPS = dedent(
|
|
52
|
-
"""
|
|
53
|
-
app_name = '{}'
|
|
54
|
-
app_version = '{}'
|
|
55
|
-
|
|
56
|
-
pythonVersion=3
|
|
57
|
-
pyrccVersion=5
|
|
58
|
-
|
|
59
|
-
author="<Author>")
|
|
60
|
-
mailTo="<MailTo")
|
|
61
|
-
siteUrl="<SiteUrl>")
|
|
62
|
-
"""
|
|
63
|
-
)
|
|
64
|
-
|
|
65
|
-
@staticmethod
|
|
66
|
-
def prompt() -> Namespace:
|
|
67
|
-
"""Prompt for the application info."""
|
|
68
|
-
# fmt: off
|
|
69
|
-
form_fields = MenuInput.builder() \
|
|
70
|
-
.field() \
|
|
71
|
-
.label('App Name') \
|
|
72
|
-
.validator(InputValidator.words()) \
|
|
73
|
-
.min_max_length(1, 40) \
|
|
74
|
-
.value('my_app') \
|
|
75
|
-
.build() \
|
|
76
|
-
.field() \
|
|
77
|
-
.label('App Type') \
|
|
78
|
-
.itype('select') \
|
|
79
|
-
.value(f"{AppType.APP}|{AppType.QT_APP}|{AppType.WIDGET}") \
|
|
80
|
-
.build() \
|
|
81
|
-
.field() \
|
|
82
|
-
.label('Dest Dir') \
|
|
83
|
-
.validator(InputValidator.anything()) \
|
|
84
|
-
.min_max_length(3, 80) \
|
|
85
|
-
.value(os.getenv('HOME', os.getcwd())) \
|
|
86
|
-
.build() \
|
|
87
|
-
.field() \
|
|
88
|
-
.label('Initialize gradle') \
|
|
89
|
-
.itype('checkbox') \
|
|
90
|
-
.value(True) \
|
|
91
|
-
.build() \
|
|
92
|
-
.field() \
|
|
93
|
-
.label('Initialize git') \
|
|
94
|
-
.itype('checkbox') \
|
|
95
|
-
.value(True) \
|
|
96
|
-
.build() \
|
|
97
|
-
.build()
|
|
98
|
-
# fmt: on
|
|
99
|
-
return minput(form_fields)
|
|
100
|
-
|
|
101
|
-
def __init__(self, parent_app: Application) -> None:
|
|
102
|
-
self._parent_app = parent_app
|
|
103
|
-
self._app_name = None
|
|
104
|
-
self._app_dir = None
|
|
105
|
-
self._init_gradle_flag = False
|
|
106
|
-
self._init_git_flag = False
|
|
107
|
-
|
|
108
|
-
def create(self, app_name: str, app_type: AppType, app_ext: List[AppExtension], dest_dir: str) -> None:
|
|
109
|
-
"""Create the application based on the parameters.
|
|
110
|
-
:param app_name the application name.
|
|
111
|
-
:param app_type the application type (qt-app, widgets, ...)
|
|
112
|
-
:param app_ext the application extensions (gradle, git, ...).
|
|
113
|
-
:param dest_dir the project destination directory (dest_dir/app_name).
|
|
114
|
-
"""
|
|
115
|
-
sysout(f'Creating "{app_name}" at {dest_dir}')
|
|
116
|
-
try:
|
|
117
|
-
check_argument(os.path.exists(dest_dir), "Destination not found: {}", dest_dir)
|
|
118
|
-
self._app_name = app_name
|
|
119
|
-
if app_type == AppType.APP:
|
|
120
|
-
self._app_dir = f"{dest_dir}/{app_name}"
|
|
121
|
-
self._create_app(app_name, app_ext)
|
|
122
|
-
elif app_type == AppType.WIDGET:
|
|
123
|
-
self._app_dir = f"{dest_dir}"
|
|
124
|
-
self._create_widget(app_name)
|
|
125
|
-
elif app_type == AppType.QT_APP:
|
|
126
|
-
self._app_dir = f"{dest_dir}/{app_name}"
|
|
127
|
-
self._create_qt_app(app_name, app_ext)
|
|
128
|
-
else:
|
|
129
|
-
raise TypeError(f"Unsupported application type: {app_type}")
|
|
130
|
-
except OSError as err:
|
|
131
|
-
syserr(f'Could not create application "{app_name}"!\n => {str(err)}')
|
|
132
|
-
self._parent_app.exit(ExitStatus.FAILED.val)
|
|
133
|
-
|
|
134
|
-
sysout(f"Successfully created the {app_type.value} {app_name}")
|
|
135
|
-
|
|
136
|
-
def _create_app(self, app_name: str, app_ext: List[AppExtension]) -> None:
|
|
137
|
-
"""Create a Simple HsPyLib application.
|
|
138
|
-
:param app_name the application name.
|
|
139
|
-
:param app_ext the application extensions (gradle, git, ...).
|
|
140
|
-
"""
|
|
141
|
-
sysout(f"Application: {app_name}")
|
|
142
|
-
self._create_base_app_struct(app_name)
|
|
143
|
-
self._mkfile(
|
|
144
|
-
f"src/main/{self._app_name}/__main__.py",
|
|
145
|
-
(self.TEMPLATES / "main.py.tpl").read_text().replace("%APP_NAME%", self._app_name),
|
|
146
|
-
)
|
|
147
|
-
self._apply_extensions(app_name, app_ext)
|
|
148
|
-
|
|
149
|
-
def _create_qt_app(self, app_name: str, app_ext: List[AppExtension]) -> None:
|
|
150
|
-
"""Create an HsPyLib QT application.
|
|
151
|
-
:param app_name the application name.
|
|
152
|
-
:param app_ext the application extensions (gradle, git, ...).
|
|
153
|
-
"""
|
|
154
|
-
sysout(f"QT Application: {app_name}")
|
|
155
|
-
self._create_base_app_struct(app_name)
|
|
156
|
-
self._mkdir(f"src/main/{self._app_name}/resources/forms")
|
|
157
|
-
self._mkfile(
|
|
158
|
-
f"src/main/{self._app_name}/resources/forms/main_qt_view.ui",
|
|
159
|
-
(self.TEMPLATES / "main_qt_view.ui.tpl").read_text(),
|
|
160
|
-
)
|
|
161
|
-
self._mkdir(f"src/main/{self._app_name}/view")
|
|
162
|
-
self._mkfile(
|
|
163
|
-
f"src/main/{self._app_name}/view/main_qt_view.py",
|
|
164
|
-
(self.TEMPLATES / "main_qt_view.py.tpl").read_text().replace("%APP_NAME%", self._app_name),
|
|
165
|
-
)
|
|
166
|
-
self._mkfile(
|
|
167
|
-
f"src/main/{self._app_name}/__main__.py",
|
|
168
|
-
(self.TEMPLATES / "main_qt.py.tpl").read_text().replace("%APP_NAME%", self._app_name),
|
|
169
|
-
)
|
|
170
|
-
self._apply_extensions(app_name, app_ext)
|
|
171
|
-
|
|
172
|
-
def _create_widget(self, app_name: str) -> None:
|
|
173
|
-
"""Create an HsPyLib Widget application.
|
|
174
|
-
:param app_name the application name.
|
|
175
|
-
"""
|
|
176
|
-
widget_name = camelcase(app_name).replace("_", "").replace(" ", "")
|
|
177
|
-
sysout(f"Widget: {widget_name}")
|
|
178
|
-
self._mkfile(
|
|
179
|
-
f"widget_{app_name.lower()}.py",
|
|
180
|
-
(self.TEMPLATES / "widget.py.tpl")
|
|
181
|
-
.read_text()
|
|
182
|
-
.replace("_WIDGET_NAME_", f"{camelcase(app_name, capitalized=True)}"),
|
|
183
|
-
)
|
|
184
|
-
|
|
185
|
-
def _create_base_app_struct(self, app_name: str) -> None:
|
|
186
|
-
"""Create a base HsPyLib application structure and files.
|
|
187
|
-
:param app_name the application name.
|
|
188
|
-
"""
|
|
189
|
-
self._mkdir()
|
|
190
|
-
self._mkfile("README.md", f"# {app_name}")
|
|
191
|
-
self._mkfile("MANIFEST.in")
|
|
192
|
-
self._mkdir("src")
|
|
193
|
-
self._mkdir("src/test")
|
|
194
|
-
self._mkfile("src/test/test_main.py", (self.TEMPLATES / "test_main.py.tpl").read_text())
|
|
195
|
-
self._mkdir("src/test/resources")
|
|
196
|
-
self._mkfile("src/test/resources/application-test.properties", "# Main test application property file")
|
|
197
|
-
self._mkdir("src/main")
|
|
198
|
-
self._mkdir(f"src/main/{self._app_name}")
|
|
199
|
-
self._mkfile(f"src/main/{self._app_name}/__classpath__.py", (self.TEMPLATES / "classpath.py.tpl").read_text())
|
|
200
|
-
self._mkfile(f"src/main/{self._app_name}/.version", str(INITIAL_REVISION))
|
|
201
|
-
self._mkfile(f"src/main/{self._app_name}/welcome.txt", WELCOME_MESSAGE)
|
|
202
|
-
self._mkdir(f"src/main/{self._app_name}/resources")
|
|
203
|
-
self._mkfile(f"src/main/{self._app_name}/resources/application.properties", "# Main application property file")
|
|
204
|
-
self._mkfile(".env", "# Type in here the environment variables your app requires")
|
|
205
|
-
self._mkfile("run.sh", (self.TEMPLATES / "run.sh.tpl").read_text().replace("%APP_NAME%", self._app_name))
|
|
206
|
-
self._chmod("run.sh")
|
|
207
|
-
|
|
208
|
-
def _mkdir(self, folder_name: str = "") -> None:
|
|
209
|
-
"""Create a directory from the destination path, or the destination path itself.
|
|
210
|
-
:param folder_name the directory to be created.
|
|
211
|
-
"""
|
|
212
|
-
dir_path = f"{self._app_dir}/{folder_name}"
|
|
213
|
-
sysout(f" |- {dir_path}")
|
|
214
|
-
os.mkdir(dir_path)
|
|
215
|
-
|
|
216
|
-
def _mkfile(self, file_name: str, file_content: str = "") -> None:
|
|
217
|
-
"""Create a file from the destination path with the specified content.
|
|
218
|
-
:param file_name the file name.
|
|
219
|
-
:param file_content the text based content of the file.
|
|
220
|
-
"""
|
|
221
|
-
file_path = f"{self._app_dir}/{file_name}"
|
|
222
|
-
sysout(f" |- {file_path}")
|
|
223
|
-
with open(f"{file_path}", "w", encoding=Charset.UTF_8.val) as fh:
|
|
224
|
-
fh.write(ensure_endswith(file_content, os.linesep))
|
|
225
|
-
|
|
226
|
-
def _chmod(self, file_name: str) -> None:
|
|
227
|
-
"""Give execute permissions to the file.
|
|
228
|
-
:param file_name the file name
|
|
229
|
-
"""
|
|
230
|
-
file_path = f"{self._app_dir}/{file_name}"
|
|
231
|
-
st = os.stat(file_path)
|
|
232
|
-
os.chmod(file_path, st.st_mode | stat.S_IEXEC)
|
|
233
|
-
|
|
234
|
-
def _apply_extensions(self, app_name: str, app_ext: List[AppExtension]) -> None:
|
|
235
|
-
"""Apply the selected extensions to the app.
|
|
236
|
-
:param app_name the application name.
|
|
237
|
-
:param app_ext the application extensions (gradle, git, ...).
|
|
238
|
-
"""
|
|
239
|
-
result = True
|
|
240
|
-
|
|
241
|
-
if result and AppExtension.GIT in app_ext:
|
|
242
|
-
sysout("Initializing git repository")
|
|
243
|
-
result &= self._init_git()
|
|
244
|
-
if result and AppExtension.GRADLE in app_ext:
|
|
245
|
-
sysout("Applying gradle extensions")
|
|
246
|
-
result &= self._init_gradle(app_name)
|
|
247
|
-
|
|
248
|
-
if result:
|
|
249
|
-
sysout("All app extensions successfully applied!")
|
|
250
|
-
else:
|
|
251
|
-
syserr("Failed to apply app extensions!")
|
|
252
|
-
|
|
253
|
-
def _init_gradle(self, app_name: str) -> bool:
|
|
254
|
-
"""Initialize the as a gradle project.
|
|
255
|
-
:param app_name the application name.
|
|
256
|
-
"""
|
|
257
|
-
sysout(f'Initializing "{app_name}" gradle project [press ENTER to continue] ...')
|
|
258
|
-
output, exit_code = Terminal.shell_exec(
|
|
259
|
-
f"gradle init --project-name {app_name} --type basic --dsl groovy", cwd=self._app_dir
|
|
260
|
-
)
|
|
261
|
-
sysout(f"Gradle execution result: {exit_code}%EOL%{output}%EOL%")
|
|
262
|
-
|
|
263
|
-
if exit_code == ExitStatus.SUCCESS:
|
|
264
|
-
sysout("Downloading gradle extensions ...")
|
|
265
|
-
self._download_gradle_ext("badges.gradle")
|
|
266
|
-
self._download_gradle_ext("build-info.gradle")
|
|
267
|
-
self._download_gradle_ext("dependencies.gradle")
|
|
268
|
-
self._download_gradle_ext("docgen.gradle")
|
|
269
|
-
self._download_gradle_ext("docker.gradle")
|
|
270
|
-
self._download_gradle_ext("pypi-publish.gradle")
|
|
271
|
-
self._download_gradle_ext("python.gradle")
|
|
272
|
-
sysout("Creating gradle files")
|
|
273
|
-
self._mkfile("gradle.properties", self.GRADLE_PROPS.format(self._app_name, INITIAL_REVISION).strip())
|
|
274
|
-
self._mkfile(
|
|
275
|
-
"build.gradle", (self.TEMPLATES / "build.gradle.tpl").read_text().replace("%APP_NAME%", self._app_name)
|
|
276
|
-
)
|
|
277
|
-
self._mkfile("dependencies.hspd", (self.TEMPLATES / "dependencies.hspd.tpl").read_text())
|
|
278
|
-
sysout("Building gradle project, please wait ...")
|
|
279
|
-
output, exit_code = Terminal.shell_exec("./gradlew buildOnly", cwd=self._app_dir)
|
|
280
|
-
sysout(f"Gradle execution result: {output}")
|
|
281
|
-
|
|
282
|
-
return exit_code == ExitStatus.SUCCESS
|
|
283
|
-
|
|
284
|
-
def _init_git(self) -> bool:
|
|
285
|
-
"""Initialize a git repository for the project."""
|
|
286
|
-
self._mkfile(".gitignore", (self.TEMPLATES / "gitignore.tpl").read_text())
|
|
287
|
-
sysout("Initializing git repository ...")
|
|
288
|
-
output, exit_code = Terminal.shell_exec("git init", cwd=self._app_dir)
|
|
289
|
-
sysout(f"Git init result: {exit_code}%EOL%{output}%EOL%")
|
|
290
|
-
if exit_code:
|
|
291
|
-
sysout("Creating first commit")
|
|
292
|
-
Terminal.shell_exec("git add .", cwd=self._app_dir)
|
|
293
|
-
output, exit_code = Terminal.shell_exec('git commit -m "First commit [@HsPyLib]"', cwd=self._app_dir)
|
|
294
|
-
sysout(f"Git commit result: {exit_code}%EOL%{output}%EOL%")
|
|
295
|
-
|
|
296
|
-
return exit_code == ExitStatus.SUCCESS
|
|
297
|
-
|
|
298
|
-
def _download_gradle_ext(self, gradle_ext: str) -> None:
|
|
299
|
-
"""Download a gradle extension from the HsPyLib repository.
|
|
300
|
-
:param gradle_ext the HsPyLib gradle extension to download.
|
|
301
|
-
"""
|
|
302
|
-
urllib3.disable_warnings() # Disable this warning because we trust our project repo
|
|
303
|
-
resp = get(f"https://raw.githubusercontent.com/yorevs/hspylib/master/gradle/{gradle_ext}")
|
|
304
|
-
check_argument(resp.status_code == HttpCode.OK, "Unable to download extension: '{}'", gradle_ext)
|
|
305
|
-
self._mkfile(f"gradle/{gradle_ext}", resp.body)
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env python3
|
|
2
|
-
# -*- coding: utf-8 -*-
|
|
3
|
-
|
|
4
|
-
"""
|
|
5
|
-
@project: HsPyLib-Clitt
|
|
6
|
-
@package: clitt.addons.appman
|
|
7
|
-
@file: appman_enums.py
|
|
8
|
-
@created: Fri, 29 Jul 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
|
-
from hspylib.core.enums.enumeration import Enumeration
|
|
16
|
-
from typing import List
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
class AppExtension(Enumeration):
|
|
20
|
-
"""Appman available extensions."""
|
|
21
|
-
|
|
22
|
-
# fmt: off
|
|
23
|
-
GRADLE = 'gradle'
|
|
24
|
-
GIT = 'git'
|
|
25
|
-
# fmt: on
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
class AppType(Enumeration):
|
|
29
|
-
"""Appman supported application types."""
|
|
30
|
-
|
|
31
|
-
# fmt: off
|
|
32
|
-
APP = 'app'
|
|
33
|
-
QT_APP = 'qt-app'
|
|
34
|
-
WIDGET = 'widget'
|
|
35
|
-
# fmt: on
|
|
36
|
-
|
|
37
|
-
@staticmethod
|
|
38
|
-
def choices() -> List[str]:
|
|
39
|
-
return AppType.values()
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
# _*_ coding: utf-8 _*_
|
|
2
|
-
#
|
|
3
|
-
# hspylib-clitt v0.9.116
|
|
4
|
-
#
|
|
5
|
-
# Package: main.build.lib.build.lib.clitt.addons.widman
|
|
6
|
-
"""Package initialization."""
|
|
7
|
-
|
|
8
|
-
__all__ = [
|
|
9
|
-
'widget',
|
|
10
|
-
'widget_entry',
|
|
11
|
-
'widgets',
|
|
12
|
-
'widman'
|
|
13
|
-
]
|
|
14
|
-
__version__ = '0.9.116'
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env python3
|
|
2
|
-
# -*- coding: utf-8 -*-
|
|
3
|
-
|
|
4
|
-
"""
|
|
5
|
-
@project: HsPyLib-Clitt
|
|
6
|
-
@package: clitt.addons.widman
|
|
7
|
-
@file: widget.py
|
|
8
|
-
@created: Fri, 29 Jul 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 abc import ABC, abstractmethod
|
|
17
|
-
from clitt.core.icons.font_awesome.awesome import Awesome
|
|
18
|
-
from hspylib.modules.application.exit_status import ExitStatus
|
|
19
|
-
from hspylib.modules.application.version import Version
|
|
20
|
-
from textwrap import dedent
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
class Widget(ABC):
|
|
24
|
-
"""HsPyLib_Widman base class. All widgets must inherit from this class to properly work."""
|
|
25
|
-
|
|
26
|
-
_USAGE_FMT = dedent(
|
|
27
|
-
"""
|
|
28
|
-
HsPyLib Widget: {} v{}
|
|
29
|
-
|
|
30
|
-
{}
|
|
31
|
-
|
|
32
|
-
{}
|
|
33
|
-
"""
|
|
34
|
-
)
|
|
35
|
-
|
|
36
|
-
def __init__(self, icon: Awesome, name: str, tooltip: str, usage: str, version: Version):
|
|
37
|
-
self._icon = icon
|
|
38
|
-
self._name = name
|
|
39
|
-
self._tooltip = tooltip
|
|
40
|
-
self._usage = usage
|
|
41
|
-
self._version = version
|
|
42
|
-
|
|
43
|
-
@abstractmethod
|
|
44
|
-
def execute(self, *args) -> ExitStatus:
|
|
45
|
-
"""Execute the widget main flow.
|
|
46
|
-
:param args the widget arguments
|
|
47
|
-
"""
|
|
48
|
-
|
|
49
|
-
def cleanup(self) -> None:
|
|
50
|
-
"""Execute the widget cleanup."""
|
|
51
|
-
|
|
52
|
-
def icon(self) -> Awesome:
|
|
53
|
-
"""Return the widget icon."""
|
|
54
|
-
return self._icon
|
|
55
|
-
|
|
56
|
-
def name(self) -> str:
|
|
57
|
-
"""Return the name about the widget."""
|
|
58
|
-
return self._name
|
|
59
|
-
|
|
60
|
-
def tooltip(self) -> str:
|
|
61
|
-
"""Return a tooltip information about the widget."""
|
|
62
|
-
return self._tooltip
|
|
63
|
-
|
|
64
|
-
def version(self) -> str:
|
|
65
|
-
"""Return the version of the widget."""
|
|
66
|
-
return str(self._version)
|
|
67
|
-
|
|
68
|
-
def usage(self) -> str:
|
|
69
|
-
"""Return a usage message about the widget."""
|
|
70
|
-
return self._USAGE_FMT.format(self._name, self._version, self._tooltip, self._usage)
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env python3
|
|
2
|
-
# -*- coding: utf-8 -*-
|
|
3
|
-
|
|
4
|
-
"""
|
|
5
|
-
@project: HsPyLib-Clitt
|
|
6
|
-
@package: clitt.addons.widman
|
|
7
|
-
@file: widget_entry.py
|
|
8
|
-
@created: Fri, 04 Jun 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 hspylib.core.tools.text_tools import camelcase
|
|
16
|
-
|
|
17
|
-
import os
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
class WidgetEntry:
|
|
21
|
-
"""Placeholder object for a HsPyLib::Widman Widget and details about it."""
|
|
22
|
-
|
|
23
|
-
# fmt: off
|
|
24
|
-
MODULE_PREFIX = "widget_"
|
|
25
|
-
CLASS_PREFIX = "Widget"
|
|
26
|
-
# fmt: on
|
|
27
|
-
|
|
28
|
-
def __init__(self, file: str, path: str):
|
|
29
|
-
self._module = os.path.splitext(file)[0]
|
|
30
|
-
self._name = camelcase(self.module.replace(self.MODULE_PREFIX, ""), capitalized=True)
|
|
31
|
-
self._clazz = f"{self.CLASS_PREFIX}{self.name.replace('_', '')}"
|
|
32
|
-
self._path = path
|
|
33
|
-
|
|
34
|
-
def __str__(self):
|
|
35
|
-
return f"{self.name}: {self.module}.{self.clazz} => {self.path}"
|
|
36
|
-
|
|
37
|
-
def __repr__(self):
|
|
38
|
-
return str(self)
|
|
39
|
-
|
|
40
|
-
@property
|
|
41
|
-
def name(self) -> str:
|
|
42
|
-
return self._name
|
|
43
|
-
|
|
44
|
-
@property
|
|
45
|
-
def module(self) -> str:
|
|
46
|
-
return self._module
|
|
47
|
-
|
|
48
|
-
@property
|
|
49
|
-
def clazz(self) -> str:
|
|
50
|
-
return self._clazz
|
|
51
|
-
|
|
52
|
-
@property
|
|
53
|
-
def path(self) -> str:
|
|
54
|
-
return self._path
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
# _*_ coding: utf-8 _*_
|
|
2
|
-
#
|
|
3
|
-
# hspylib-clitt v0.9.116
|
|
4
|
-
#
|
|
5
|
-
# Package: main.build.lib.build.lib.clitt.addons.widman.widgets
|
|
6
|
-
"""Package initialization."""
|
|
7
|
-
|
|
8
|
-
__all__ = [
|
|
9
|
-
'widget_free',
|
|
10
|
-
'widget_punch',
|
|
11
|
-
'widget_send_msg',
|
|
12
|
-
'widget_time_calc'
|
|
13
|
-
]
|
|
14
|
-
__version__ = '0.9.116'
|
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env python3
|
|
2
|
-
# -*- coding: utf-8 -*-
|
|
3
|
-
|
|
4
|
-
"""
|
|
5
|
-
@project: HsPyLib-Clitt
|
|
6
|
-
@package: clitt.addons.widman.widgets
|
|
7
|
-
@file: widget_free.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.addons.widman.widget import Widget
|
|
16
|
-
from clitt.core.icons.font_awesome.widget_icons import WidgetIcons
|
|
17
|
-
from clitt.core.term.terminal import Terminal
|
|
18
|
-
from concurrent import futures
|
|
19
|
-
from hspylib.core.tools.commons import human_readable_bytes, sysout
|
|
20
|
-
from hspylib.modules.application.exit_status import ExitStatus
|
|
21
|
-
from hspylib.modules.application.version import Version
|
|
22
|
-
from hspylib.modules.cli.keyboard import Keyboard
|
|
23
|
-
from textwrap import dedent
|
|
24
|
-
from time import sleep
|
|
25
|
-
|
|
26
|
-
import re
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
class WidgetFree(Widget):
|
|
30
|
-
"""HsPyLib Widget to Report current system memory usage"""
|
|
31
|
-
|
|
32
|
-
# fmt: off
|
|
33
|
-
WIDGET_ICON = WidgetIcons.CHIP
|
|
34
|
-
WIDGET_NAME = "Free"
|
|
35
|
-
VERSION = Version(0, 2, 0)
|
|
36
|
-
TOOLTIP = "Report system memory usage."
|
|
37
|
-
USAGE = "Usage: Free"
|
|
38
|
-
# fmt: on
|
|
39
|
-
|
|
40
|
-
def __init__(self) -> None:
|
|
41
|
-
super().__init__(self.WIDGET_ICON, self.WIDGET_NAME, self.TOOLTIP, self.USAGE, self.VERSION)
|
|
42
|
-
self._is_alive = True
|
|
43
|
-
self._report_interval = 1.5
|
|
44
|
-
self._exit_code = ExitStatus.SUCCESS
|
|
45
|
-
|
|
46
|
-
def execute(self, *args) -> ExitStatus:
|
|
47
|
-
with futures.ThreadPoolExecutor() as executor:
|
|
48
|
-
done = False
|
|
49
|
-
while not done and not Keyboard.kbhit():
|
|
50
|
-
future = executor.submit(self._report_usage)
|
|
51
|
-
done = not future.result()
|
|
52
|
-
if not done:
|
|
53
|
-
sleep(self._report_interval)
|
|
54
|
-
return self._exit_code
|
|
55
|
-
|
|
56
|
-
# pylint: disable=too-many-locals
|
|
57
|
-
@staticmethod
|
|
58
|
-
def _report_usage() -> bool:
|
|
59
|
-
"""Display the memory usage for the cycle."""
|
|
60
|
-
ps, ec1 = Terminal.shell_exec("ps -caxm -orss,comm") # Get process info
|
|
61
|
-
vm, ec2 = Terminal.shell_exec("vm_stat") # Grabbing memory characteristics
|
|
62
|
-
|
|
63
|
-
if ec1 == ExitStatus.SUCCESS and ec2 == ExitStatus.SUCCESS and ps:
|
|
64
|
-
process_lines = ps.split("\n") # Iterate processes
|
|
65
|
-
sep = re.compile(" +")
|
|
66
|
-
rss_total = 0 # kB
|
|
67
|
-
|
|
68
|
-
for row in range(1, len(process_lines)):
|
|
69
|
-
row_text = process_lines[row].strip()
|
|
70
|
-
row_elements = sep.split(row_text)
|
|
71
|
-
if re.match("^[0-9]+$", row_elements[0]):
|
|
72
|
-
rss = float(row_elements[0]) * 1024
|
|
73
|
-
else:
|
|
74
|
-
rss = 0
|
|
75
|
-
rss_total += rss
|
|
76
|
-
|
|
77
|
-
vm_lines = vm.split("\n") # Process vm_stat
|
|
78
|
-
sep = re.compile(": +")
|
|
79
|
-
vm_stats = {}
|
|
80
|
-
|
|
81
|
-
for row in range(1, len(vm_lines) - 2):
|
|
82
|
-
row_text = vm_lines[row].strip()
|
|
83
|
-
row_elements = sep.split(row_text)
|
|
84
|
-
vm_stats[(row_elements[0])] = int(row_elements[1].strip("\\.")) * 4096
|
|
85
|
-
|
|
86
|
-
wired, wu = human_readable_bytes(vm_stats["Pages wired down"])
|
|
87
|
-
active, au = human_readable_bytes(vm_stats["Pages active"])
|
|
88
|
-
inactive, iu = human_readable_bytes(vm_stats["Pages inactive"])
|
|
89
|
-
free, fu = human_readable_bytes(vm_stats["Pages free"])
|
|
90
|
-
real, ru = human_readable_bytes(rss_total) # Total memory
|
|
91
|
-
|
|
92
|
-
sysout(
|
|
93
|
-
dedent(
|
|
94
|
-
f"""
|
|
95
|
-
%HOM%%ED2%%MOD(0)%
|
|
96
|
-
%ORANGE%Reporting system memory usage:%NC%
|
|
97
|
-
{'-' * 30}
|
|
98
|
-
%GREEN% Wired Memory: {wired:6s} {wu:2s}
|
|
99
|
-
%GREEN% Active Memory: {active:6s} {au:2s}
|
|
100
|
-
%GREEN%Inactive Memory: {inactive:6s} {iu:2s}
|
|
101
|
-
%GREEN% Free Memory: {free:6s} {fu:2s}
|
|
102
|
-
%GREEN% Real Memory: {real:6s} {ru:2s}
|
|
103
|
-
|
|
104
|
-
%YELLOW%Press [Enter] to exit ..."""
|
|
105
|
-
)
|
|
106
|
-
)
|
|
107
|
-
|
|
108
|
-
return True
|
|
109
|
-
|
|
110
|
-
return False
|