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,66 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env python3
|
|
2
|
-
# -*- coding: utf-8 -*-
|
|
3
|
-
|
|
4
|
-
"""
|
|
5
|
-
@project: HsPyLib
|
|
6
|
-
@package: clitt.utils
|
|
7
|
-
@file: git_utils.py
|
|
8
|
-
@created: Nov 14, 2019
|
|
9
|
-
@author: <B>H</B>ugo <B>S</B>aporetti <B>J</B>unior
|
|
10
|
-
@site: https://github.com/yorevs/hspylib
|
|
11
|
-
@license: MIT - Please refer to <https://opensource.org/licenses/MIT>
|
|
12
|
-
|
|
13
|
-
Copyright·(c)·2024,·HSPyLib
|
|
14
|
-
"""
|
|
15
|
-
from clitt.core.term.terminal import Terminal
|
|
16
|
-
from hspylib.modules.application.exit_status import ExitStatus
|
|
17
|
-
from typing import Tuple
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
class GitTools:
|
|
21
|
-
"""TODO"""
|
|
22
|
-
|
|
23
|
-
@staticmethod
|
|
24
|
-
def top_level_dir() -> Tuple[str, ExitStatus]:
|
|
25
|
-
"""TODO"""
|
|
26
|
-
return Terminal.shell_exec("git rev-parse --show-toplevel")
|
|
27
|
-
|
|
28
|
-
@staticmethod
|
|
29
|
-
def current_branch() -> Tuple[str, ExitStatus]:
|
|
30
|
-
"""TODO"""
|
|
31
|
-
return Terminal.shell_exec("git symbolic-ref --short HEAD")
|
|
32
|
-
|
|
33
|
-
@staticmethod
|
|
34
|
-
def changelog(from_tag: str, to_tag: str) -> Tuple[str, ExitStatus]:
|
|
35
|
-
"""TODO"""
|
|
36
|
-
return Terminal.shell_exec(f"git log --oneline --pretty='format:%h %ad %s' --date=short {from_tag}^..{to_tag}^")
|
|
37
|
-
|
|
38
|
-
@staticmethod
|
|
39
|
-
def unreleased() -> Tuple[str, ExitStatus]:
|
|
40
|
-
"""TODO"""
|
|
41
|
-
latest_tag = Terminal.shell_exec("git describe --tags --abbrev=0 HEAD^")
|
|
42
|
-
return Terminal.shell_exec(f"git log --oneline --pretty='format:%h %ad %s' --date=short '{latest_tag}'..HEAD")
|
|
43
|
-
|
|
44
|
-
@staticmethod
|
|
45
|
-
def release_date(tag_name: str) -> Tuple[str, ExitStatus]:
|
|
46
|
-
"""TODO"""
|
|
47
|
-
return Terminal.shell_exec(f"git log -1 --pretty='format:%ad' --date=short {tag_name}")
|
|
48
|
-
|
|
49
|
-
@staticmethod
|
|
50
|
-
def tag_list() -> Tuple[str, ExitStatus]:
|
|
51
|
-
"""TODO"""
|
|
52
|
-
return Terminal.shell_exec("git log --tags --simplify-by-decoration --pretty='format:%ci %d'")
|
|
53
|
-
|
|
54
|
-
@staticmethod
|
|
55
|
-
def create_tag(version: str, commit_id: str = "HEAD", description: str = None) -> Tuple[str, ExitStatus]:
|
|
56
|
-
"""TODO"""
|
|
57
|
-
return Terminal.shell_exec(f"git tag -a v{version} {commit_id} -m '{description or version}'")
|
|
58
|
-
|
|
59
|
-
@staticmethod
|
|
60
|
-
def search_logs(filter_by: str = ".*") -> Tuple[str, ExitStatus]:
|
|
61
|
-
"""TODO"""
|
|
62
|
-
return Terminal.shell_exec(f"git log --grep='{filter_by}' --pretty=format:'%h %ad %s' --date=short")
|
|
63
|
-
|
|
64
|
-
@staticmethod
|
|
65
|
-
def show_file(filename: str, commit_id: str = "HEAD") -> Tuple[str, ExitStatus]:
|
|
66
|
-
return Terminal.shell_exec(f"git show {commit_id}:{filename}")
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env python3
|
|
2
|
-
# -*- coding: utf-8 -*-
|
|
3
|
-
|
|
4
|
-
"""
|
|
5
|
-
@project: HsPyLib-Clitt
|
|
6
|
-
@package: clitt
|
|
7
|
-
@file: __classpath__.py
|
|
8
|
-
@created: Fri, 23 Dec 2022
|
|
9
|
-
@author: "<B>H</B>ugo <B>S</B>aporetti <B>J</B>unior")"
|
|
10
|
-
@site: "https://github.com/yorevs/hspylib")
|
|
11
|
-
@license: MIT - Please refer to <https://opensource.org/licenses/MIT>
|
|
12
|
-
|
|
13
|
-
Copyright·(c)·2024,·HSPyLib
|
|
14
|
-
"""
|
|
15
|
-
|
|
16
|
-
from hspylib.core.metaclass.classpath import Classpath
|
|
17
|
-
from hspylib.core.tools.commons import get_path, run_dir
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
class _Classpath(Classpath):
|
|
21
|
-
"""TODO"""
|
|
22
|
-
|
|
23
|
-
def __init__(self):
|
|
24
|
-
super().__init__(get_path(__file__), get_path(run_dir()), (get_path(__file__) / "resources"))
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
# Instantiate the classpath singleton
|
|
28
|
-
assert _Classpath().INSTANCE is not None, "Failed to create Classpath instance"
|
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env python3
|
|
2
|
-
# -*- coding: utf-8 -*-
|
|
3
|
-
|
|
4
|
-
"""
|
|
5
|
-
@project: hspylib
|
|
6
|
-
@package: hspylib
|
|
7
|
-
@file: __main__.py
|
|
8
|
-
@created: Tue, 4 May 2021
|
|
9
|
-
@author: <B>H</B>ugo <B>S</B>aporetti <B>J</B>unior"
|
|
10
|
-
@site: https://github.com/yorevs/hspylib
|
|
11
|
-
@license: MIT - Please refer to <https://opensource.org/licenses/MIT>
|
|
12
|
-
|
|
13
|
-
Copyright·(c)·2024,·HSPyLib
|
|
14
|
-
"""
|
|
15
|
-
from clitt.__classpath__ import _Classpath
|
|
16
|
-
from clitt.addons.appman.appman import AppManager
|
|
17
|
-
from clitt.addons.appman.appman_enums import AppExtension, AppType
|
|
18
|
-
from clitt.addons.widman.widman import WidgetManager
|
|
19
|
-
from clitt.core.tui.tui_application import TUIApplication
|
|
20
|
-
from hspylib.core.enums.charset import Charset
|
|
21
|
-
from hspylib.core.enums.enumeration import Enumeration
|
|
22
|
-
from hspylib.core.tools.commons import run_dir, syserr
|
|
23
|
-
from hspylib.core.tools.text_tools import strip_linebreaks
|
|
24
|
-
from hspylib.modules.application.exit_status import ExitStatus
|
|
25
|
-
from hspylib.modules.application.version import Version
|
|
26
|
-
|
|
27
|
-
import sys
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
class Main(TUIApplication):
|
|
31
|
-
"""HsPyLib CLI Terminal Tools - Create professional CLI applications."""
|
|
32
|
-
|
|
33
|
-
# The welcome message
|
|
34
|
-
DESCRIPTION = _Classpath.get_source_path("welcome.txt").read_text(encoding=Charset.UTF_8.val)
|
|
35
|
-
|
|
36
|
-
# Location of the .version file
|
|
37
|
-
VERSION_DIR = _Classpath.source_path()
|
|
38
|
-
|
|
39
|
-
class Addon(Enumeration):
|
|
40
|
-
"""HsPyLib addon types."""
|
|
41
|
-
|
|
42
|
-
# fmt: off
|
|
43
|
-
APPMAN = 'appman'
|
|
44
|
-
WIDGETS = 'widgets'
|
|
45
|
-
# fmt: on
|
|
46
|
-
|
|
47
|
-
@property
|
|
48
|
-
def val(self) -> str:
|
|
49
|
-
return str(self.value)
|
|
50
|
-
|
|
51
|
-
def __init__(self, app_name: str):
|
|
52
|
-
version = Version.load(load_dir=self.VERSION_DIR)
|
|
53
|
-
super().__init__(app_name, version, self.DESCRIPTION.format(version))
|
|
54
|
-
|
|
55
|
-
def _setup_arguments(self) -> None:
|
|
56
|
-
"""Initialize application parameters and options."""
|
|
57
|
-
|
|
58
|
-
# fmt: off
|
|
59
|
-
self._with_chained_args('application', 'the HsPyLib-Clitt addon to run') \
|
|
60
|
-
.argument(
|
|
61
|
-
self.Addon.APPMAN.val,
|
|
62
|
-
'app Application Manager: Create HsPyLib-Clitt based python applications') \
|
|
63
|
-
.add_option(
|
|
64
|
-
'dest-dir', 'd', 'dest-dir',
|
|
65
|
-
'the destination directory. If omitted, the current directory will be used.',
|
|
66
|
-
nargs='?', default=self._run_dir) \
|
|
67
|
-
.add_parameter(
|
|
68
|
-
'app-name', 'the application name', nargs='?') \
|
|
69
|
-
.add_parameter(
|
|
70
|
-
'app-type',
|
|
71
|
-
'the application type. Appman is going to scaffold a basic application based on the app type',
|
|
72
|
-
choices=AppType.choices(), nargs='?') \
|
|
73
|
-
.add_parameter(
|
|
74
|
-
'app-ext',
|
|
75
|
-
'"gradle" is going to initialize you project with gradle (requires gradle). '
|
|
76
|
-
'"git" is going to initialize a git repository (requires git)', nargs='*') \
|
|
77
|
-
.argument(self.Addon.WIDGETS.val, 'app Widgets Manager: Execute an HsPyLib widget') \
|
|
78
|
-
.add_parameter(
|
|
79
|
-
'widget-name',
|
|
80
|
-
'the name of the widget to be executed. If omitted, all available widgets will be '
|
|
81
|
-
'presented in a dashboard',
|
|
82
|
-
nargs='?') \
|
|
83
|
-
.add_parameter(
|
|
84
|
-
'widget-args', "the widget's arguments (if applicable)", nargs='*')
|
|
85
|
-
|
|
86
|
-
def _main(self, *params, **kwargs) -> ExitStatus:
|
|
87
|
-
"""Main entry point handler."""
|
|
88
|
-
return self._exec_application()
|
|
89
|
-
|
|
90
|
-
def _exec_application(self) -> ExitStatus:
|
|
91
|
-
"""Execute the application main flow."""
|
|
92
|
-
|
|
93
|
-
app = self.get_arg("application")
|
|
94
|
-
if app == self.Addon.APPMAN.val:
|
|
95
|
-
self.start_appman()
|
|
96
|
-
elif app == self.Addon.WIDGETS.val:
|
|
97
|
-
self.start_widman()
|
|
98
|
-
else:
|
|
99
|
-
syserr(f"### Invalid Addon application: {app}")
|
|
100
|
-
self.usage(ExitStatus.FAILED)
|
|
101
|
-
|
|
102
|
-
return ExitStatus.SUCCESS
|
|
103
|
-
|
|
104
|
-
def start_widman(self) -> None:
|
|
105
|
-
"""Start the Widman application."""
|
|
106
|
-
addon = WidgetManager(self)
|
|
107
|
-
widget_name = self.get_arg("widget-name")
|
|
108
|
-
if widget_name:
|
|
109
|
-
widget_args = list(map(strip_linebreaks, self.get_arg("widget-args")))
|
|
110
|
-
addon.execute(widget_name, *widget_args)
|
|
111
|
-
else:
|
|
112
|
-
addon.dashboard()
|
|
113
|
-
|
|
114
|
-
def start_appman(self) -> None:
|
|
115
|
-
"""Start the Appman application."""
|
|
116
|
-
addon = AppManager(self)
|
|
117
|
-
app_type = self.get_arg("app-type")
|
|
118
|
-
if app_type:
|
|
119
|
-
app_ext = self.get_arg("app-ext")
|
|
120
|
-
addon.create(
|
|
121
|
-
self.get_arg("app-name"),
|
|
122
|
-
AppType.of_value(app_type),
|
|
123
|
-
list(map(AppExtension.value_of, app_ext)) if app_ext else [],
|
|
124
|
-
self.get_arg("dest-dir") or run_dir(),
|
|
125
|
-
)
|
|
126
|
-
else:
|
|
127
|
-
args = addon.prompt()
|
|
128
|
-
if args:
|
|
129
|
-
app_ext = []
|
|
130
|
-
if args.initialize_gradle:
|
|
131
|
-
app_ext.append(AppExtension.GRADLE)
|
|
132
|
-
if args.initialize_git:
|
|
133
|
-
app_ext.append(AppExtension.GIT)
|
|
134
|
-
addon.create(args.app_name, AppType.of_value(args.app_type), list(app_ext), args.dest_dir or run_dir())
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
# Application entry point
|
|
138
|
-
if __name__ == "__main__":
|
|
139
|
-
Main("clitt").INSTANCE.run(sys.argv[1:])
|
|
@@ -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.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'
|