hspylib-clitt 0.9.115__tar.gz → 0.9.117__tar.gz

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.

Files changed (104) hide show
  1. {hspylib-clitt-0.9.115/hspylib_clitt.egg-info → hspylib-clitt-0.9.117}/PKG-INFO +2 -2
  2. {hspylib-clitt-0.9.115 → hspylib-clitt-0.9.117}/README.md +1 -1
  3. hspylib-clitt-0.9.117/clitt/.version +1 -0
  4. {hspylib-clitt-0.9.115 → hspylib-clitt-0.9.117}/clitt/__classpath__.py +2 -2
  5. {hspylib-clitt-0.9.115 → hspylib-clitt-0.9.117}/clitt/__init__.py +2 -2
  6. {hspylib-clitt-0.9.115 → hspylib-clitt-0.9.117}/clitt/__main__.py +3 -3
  7. {hspylib-clitt-0.9.115 → hspylib-clitt-0.9.117}/clitt/addons/__init__.py +2 -2
  8. {hspylib-clitt-0.9.115 → hspylib-clitt-0.9.117}/clitt/addons/appman/__init__.py +2 -2
  9. {hspylib-clitt-0.9.115 → hspylib-clitt-0.9.117}/clitt/addons/appman/templates/__init__.py +2 -2
  10. {hspylib-clitt-0.9.115 → hspylib-clitt-0.9.117}/clitt/addons/appman/templates/main_qt_view.py.tpl +1 -1
  11. {hspylib-clitt-0.9.115 → hspylib-clitt-0.9.117}/clitt/addons/widman/__init__.py +2 -2
  12. {hspylib-clitt-0.9.115 → hspylib-clitt-0.9.117}/clitt/addons/widman/widgets/__init__.py +2 -2
  13. {hspylib-clitt-0.9.115 → hspylib-clitt-0.9.117}/clitt/core/__init__.py +2 -2
  14. {hspylib-clitt-0.9.115 → hspylib-clitt-0.9.117}/clitt/core/exception/__init__.py +2 -2
  15. {hspylib-clitt-0.9.115 → hspylib-clitt-0.9.117}/clitt/core/icons/__init__.py +2 -2
  16. {hspylib-clitt-0.9.115 → hspylib-clitt-0.9.117}/clitt/core/icons/emojis/__init__.py +2 -2
  17. {hspylib-clitt-0.9.115 → hspylib-clitt-0.9.117}/clitt/core/icons/font_awesome/__init__.py +2 -2
  18. {hspylib-clitt-0.9.115 → hspylib-clitt-0.9.117}/clitt/core/term/__init__.py +2 -2
  19. {hspylib-clitt-0.9.115 → hspylib-clitt-0.9.117}/clitt/core/term/cursor.py +1 -1
  20. {hspylib-clitt-0.9.115 → hspylib-clitt-0.9.117}/clitt/core/term/screen.py +1 -1
  21. {hspylib-clitt-0.9.115 → hspylib-clitt-0.9.117}/clitt/core/term/terminal.py +2 -2
  22. {hspylib-clitt-0.9.115 → hspylib-clitt-0.9.117}/clitt/core/tui/__init__.py +2 -2
  23. {hspylib-clitt-0.9.115 → hspylib-clitt-0.9.117}/clitt/core/tui/line_input/__init__.py +2 -2
  24. {hspylib-clitt-0.9.115 → hspylib-clitt-0.9.117}/clitt/core/tui/line_input/keyboard_input.py +34 -34
  25. {hspylib-clitt-0.9.115 → hspylib-clitt-0.9.117}/clitt/core/tui/line_input/line_input.py +5 -13
  26. {hspylib-clitt-0.9.115 → hspylib-clitt-0.9.117}/clitt/core/tui/mchoose/__init__.py +2 -2
  27. {hspylib-clitt-0.9.115 → hspylib-clitt-0.9.117}/clitt/core/tui/mdashboard/__init__.py +2 -2
  28. {hspylib-clitt-0.9.115 → hspylib-clitt-0.9.117}/clitt/core/tui/menu/__init__.py +2 -2
  29. {hspylib-clitt-0.9.115 → hspylib-clitt-0.9.117}/clitt/core/tui/minput/__init__.py +2 -2
  30. {hspylib-clitt-0.9.115 → hspylib-clitt-0.9.117}/clitt/core/tui/mselect/__init__.py +2 -2
  31. {hspylib-clitt-0.9.115 → hspylib-clitt-0.9.117}/clitt/core/tui/table/__init__.py +2 -2
  32. {hspylib-clitt-0.9.115 → hspylib-clitt-0.9.117}/clitt/core/tui/tui_application.py +11 -23
  33. {hspylib-clitt-0.9.115 → hspylib-clitt-0.9.117}/clitt/core/tui/tui_preferences.py +1 -1
  34. {hspylib-clitt-0.9.115 → hspylib-clitt-0.9.117}/clitt/utils/__init__.py +2 -2
  35. {hspylib-clitt-0.9.115 → hspylib-clitt-0.9.117/hspylib_clitt.egg-info}/PKG-INFO +2 -2
  36. {hspylib-clitt-0.9.115 → hspylib-clitt-0.9.117}/hspylib_clitt.egg-info/top_level.txt +0 -1
  37. hspylib-clitt-0.9.115/clitt/.version +0 -1
  38. {hspylib-clitt-0.9.115 → hspylib-clitt-0.9.117}/MANIFEST.in +0 -0
  39. {hspylib-clitt-0.9.115 → hspylib-clitt-0.9.117}/clitt/addons/appman/appman.py +0 -0
  40. {hspylib-clitt-0.9.115 → hspylib-clitt-0.9.117}/clitt/addons/appman/appman_enums.py +0 -0
  41. {hspylib-clitt-0.9.115 → hspylib-clitt-0.9.117}/clitt/addons/appman/templates/build.gradle.tpl +0 -0
  42. {hspylib-clitt-0.9.115 → hspylib-clitt-0.9.117}/clitt/addons/appman/templates/classpath.py.tpl +0 -0
  43. {hspylib-clitt-0.9.115 → hspylib-clitt-0.9.117}/clitt/addons/appman/templates/dependencies.hspd.tpl +0 -0
  44. {hspylib-clitt-0.9.115 → hspylib-clitt-0.9.117}/clitt/addons/appman/templates/gitignore.tpl +0 -0
  45. {hspylib-clitt-0.9.115 → hspylib-clitt-0.9.117}/clitt/addons/appman/templates/main.py.tpl +0 -0
  46. {hspylib-clitt-0.9.115 → hspylib-clitt-0.9.117}/clitt/addons/appman/templates/main_qt.py.tpl +0 -0
  47. {hspylib-clitt-0.9.115 → hspylib-clitt-0.9.117}/clitt/addons/appman/templates/main_qt_view.ui.tpl +0 -0
  48. {hspylib-clitt-0.9.115 → hspylib-clitt-0.9.117}/clitt/addons/appman/templates/run.sh.tpl +0 -0
  49. {hspylib-clitt-0.9.115 → hspylib-clitt-0.9.117}/clitt/addons/appman/templates/test_main.py.tpl +0 -0
  50. {hspylib-clitt-0.9.115 → hspylib-clitt-0.9.117}/clitt/addons/appman/templates/usage.txt.tpl +0 -0
  51. {hspylib-clitt-0.9.115 → hspylib-clitt-0.9.117}/clitt/addons/appman/templates/widget.py.tpl +0 -0
  52. {hspylib-clitt-0.9.115 → hspylib-clitt-0.9.117}/clitt/addons/widman/widget.py +0 -0
  53. {hspylib-clitt-0.9.115 → hspylib-clitt-0.9.117}/clitt/addons/widman/widget_entry.py +0 -0
  54. {hspylib-clitt-0.9.115 → hspylib-clitt-0.9.117}/clitt/addons/widman/widgets/widget_free.py +0 -0
  55. {hspylib-clitt-0.9.115 → hspylib-clitt-0.9.117}/clitt/addons/widman/widgets/widget_punch.py +0 -0
  56. {hspylib-clitt-0.9.115 → hspylib-clitt-0.9.117}/clitt/addons/widman/widgets/widget_send_msg.py +0 -0
  57. {hspylib-clitt-0.9.115 → hspylib-clitt-0.9.117}/clitt/addons/widman/widgets/widget_time_calc.py +0 -0
  58. {hspylib-clitt-0.9.115 → hspylib-clitt-0.9.117}/clitt/addons/widman/widman.py +0 -0
  59. {hspylib-clitt-0.9.115 → hspylib-clitt-0.9.117}/clitt/core/exception/exceptions.py +0 -0
  60. {hspylib-clitt-0.9.115 → hspylib-clitt-0.9.117}/clitt/core/icons/emojis/emojis.py +0 -0
  61. {hspylib-clitt-0.9.115 → hspylib-clitt-0.9.117}/clitt/core/icons/emojis/face_smiling.py +0 -0
  62. {hspylib-clitt-0.9.115 → hspylib-clitt-0.9.117}/clitt/core/icons/font_awesome/app_icons.py +0 -0
  63. {hspylib-clitt-0.9.115 → hspylib-clitt-0.9.117}/clitt/core/icons/font_awesome/awesome.py +0 -0
  64. {hspylib-clitt-0.9.115 → hspylib-clitt-0.9.117}/clitt/core/icons/font_awesome/dashboard_icons.py +0 -0
  65. {hspylib-clitt-0.9.115 → hspylib-clitt-0.9.117}/clitt/core/icons/font_awesome/form_icons.py +0 -0
  66. {hspylib-clitt-0.9.115 → hspylib-clitt-0.9.117}/clitt/core/icons/font_awesome/game_icons.py +0 -0
  67. {hspylib-clitt-0.9.115 → hspylib-clitt-0.9.117}/clitt/core/icons/font_awesome/nav_icons.py +0 -0
  68. {hspylib-clitt-0.9.115 → hspylib-clitt-0.9.117}/clitt/core/icons/font_awesome/trickplay_icons.py +0 -0
  69. {hspylib-clitt-0.9.115 → hspylib-clitt-0.9.117}/clitt/core/icons/font_awesome/widget_icons.py +0 -0
  70. {hspylib-clitt-0.9.115 → hspylib-clitt-0.9.117}/clitt/core/preferences.py +0 -0
  71. {hspylib-clitt-0.9.115 → hspylib-clitt-0.9.117}/clitt/core/term/commons.py +0 -0
  72. {hspylib-clitt-0.9.115 → hspylib-clitt-0.9.117}/clitt/core/tui/mchoose/mchoose.py +0 -0
  73. {hspylib-clitt-0.9.115 → hspylib-clitt-0.9.117}/clitt/core/tui/mchoose/menu_choose.py +0 -0
  74. {hspylib-clitt-0.9.115 → hspylib-clitt-0.9.117}/clitt/core/tui/mdashboard/dashboard_builder.py +0 -0
  75. {hspylib-clitt-0.9.115 → hspylib-clitt-0.9.117}/clitt/core/tui/mdashboard/dashboard_item.py +0 -0
  76. {hspylib-clitt-0.9.115 → hspylib-clitt-0.9.117}/clitt/core/tui/mdashboard/mdashboard.py +0 -0
  77. {hspylib-clitt-0.9.115 → hspylib-clitt-0.9.117}/clitt/core/tui/mdashboard/menu_dashboard.py +0 -0
  78. {hspylib-clitt-0.9.115 → hspylib-clitt-0.9.117}/clitt/core/tui/menu/tui_menu.py +0 -0
  79. {hspylib-clitt-0.9.115 → hspylib-clitt-0.9.117}/clitt/core/tui/menu/tui_menu_action.py +0 -0
  80. {hspylib-clitt-0.9.115 → hspylib-clitt-0.9.117}/clitt/core/tui/menu/tui_menu_factory.py +0 -0
  81. {hspylib-clitt-0.9.115 → hspylib-clitt-0.9.117}/clitt/core/tui/menu/tui_menu_item.py +0 -0
  82. {hspylib-clitt-0.9.115 → hspylib-clitt-0.9.117}/clitt/core/tui/menu/tui_menu_ui.py +0 -0
  83. {hspylib-clitt-0.9.115 → hspylib-clitt-0.9.117}/clitt/core/tui/menu/tui_menu_view.py +0 -0
  84. {hspylib-clitt-0.9.115 → hspylib-clitt-0.9.117}/clitt/core/tui/minput/access_type.py +0 -0
  85. {hspylib-clitt-0.9.115 → hspylib-clitt-0.9.117}/clitt/core/tui/minput/field_builder.py +0 -0
  86. {hspylib-clitt-0.9.115 → hspylib-clitt-0.9.117}/clitt/core/tui/minput/form_builder.py +0 -0
  87. {hspylib-clitt-0.9.115 → hspylib-clitt-0.9.117}/clitt/core/tui/minput/form_field.py +0 -0
  88. {hspylib-clitt-0.9.115 → hspylib-clitt-0.9.117}/clitt/core/tui/minput/input_type.py +0 -0
  89. {hspylib-clitt-0.9.115 → hspylib-clitt-0.9.117}/clitt/core/tui/minput/input_validator.py +0 -0
  90. {hspylib-clitt-0.9.115 → hspylib-clitt-0.9.117}/clitt/core/tui/minput/menu_input.py +0 -0
  91. {hspylib-clitt-0.9.115 → hspylib-clitt-0.9.117}/clitt/core/tui/minput/minput.py +0 -0
  92. {hspylib-clitt-0.9.115 → hspylib-clitt-0.9.117}/clitt/core/tui/minput/minput_utils.py +0 -0
  93. {hspylib-clitt-0.9.115 → hspylib-clitt-0.9.117}/clitt/core/tui/mselect/menu_select.py +0 -0
  94. {hspylib-clitt-0.9.115 → hspylib-clitt-0.9.117}/clitt/core/tui/mselect/mselect.py +0 -0
  95. {hspylib-clitt-0.9.115 → hspylib-clitt-0.9.117}/clitt/core/tui/table/table_enums.py +0 -0
  96. {hspylib-clitt-0.9.115 → hspylib-clitt-0.9.117}/clitt/core/tui/table/table_renderer.py +0 -0
  97. {hspylib-clitt-0.9.115 → hspylib-clitt-0.9.117}/clitt/core/tui/tui_component.py +0 -0
  98. {hspylib-clitt-0.9.115 → hspylib-clitt-0.9.117}/clitt/utils/git_utils.py +0 -0
  99. {hspylib-clitt-0.9.115 → hspylib-clitt-0.9.117}/clitt/welcome.txt +0 -0
  100. {hspylib-clitt-0.9.115 → hspylib-clitt-0.9.117}/hspylib_clitt.egg-info/SOURCES.txt +0 -0
  101. {hspylib-clitt-0.9.115 → hspylib-clitt-0.9.117}/hspylib_clitt.egg-info/dependency_links.txt +0 -0
  102. {hspylib-clitt-0.9.115 → hspylib-clitt-0.9.117}/hspylib_clitt.egg-info/requires.txt +0 -0
  103. {hspylib-clitt-0.9.115 → hspylib-clitt-0.9.117}/setup.cfg +0 -0
  104. {hspylib-clitt-0.9.115 → hspylib-clitt-0.9.117}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: hspylib-clitt
3
- Version: 0.9.115
3
+ Version: 0.9.117
4
4
  Summary: HsPyLib - CLI Terminal Tools
5
5
  Home-page: https://github.com/yorevs/hspylib
6
6
  Author: Hugo Saporetti Junior
@@ -35,7 +35,7 @@ Requires-Dist: urllib3<2.0.0
35
35
  ## Create professional CLI applications
36
36
 
37
37
  [![License](https://badgen.net/badge/license/MIT/gray)](LICENSE.md)
38
- [![Release](https://badgen.net/badge/release/v0.9.115/gray)](CHANGELOG.md#unreleased)
38
+ [![Release](https://badgen.net/badge/release/v0.9.117/gray)](CHANGELOG.md#unreleased)
39
39
  [![PyPi](https://badgen.net/badge/icon/python?icon=pypi&label)](https://pypi.org/project/hspylib-clitt)
40
40
  [![GitHub](https://badgen.net/badge/icon/github?icon=github&label)](https://github.com/yorevs/hspylib)
41
41
  [![Gitter](https://badgen.net/badge/icon/gitter?icon=gitter&label)](https://gitter.im/hspylib/community)
@@ -3,7 +3,7 @@
3
3
  ## Create professional CLI applications
4
4
 
5
5
  [![License](https://badgen.net/badge/license/MIT/gray)](LICENSE.md)
6
- [![Release](https://badgen.net/badge/release/v0.9.115/gray)](CHANGELOG.md#unreleased)
6
+ [![Release](https://badgen.net/badge/release/v0.9.117/gray)](CHANGELOG.md#unreleased)
7
7
  [![PyPi](https://badgen.net/badge/icon/python?icon=pypi&label)](https://pypi.org/project/hspylib-clitt)
8
8
  [![GitHub](https://badgen.net/badge/icon/github?icon=github&label)](https://github.com/yorevs/hspylib)
9
9
  [![Gitter](https://badgen.net/badge/icon/gitter?icon=gitter&label)](https://gitter.im/hspylib/community)
@@ -0,0 +1 @@
1
+ 0.9.117
@@ -18,11 +18,11 @@ from hspylib.core.tools.commons import get_path, run_dir
18
18
 
19
19
 
20
20
  class _Classpath(Classpath):
21
- """TODO"""
21
+ """Provide a class to help locating user-defined classes, packages, sources and resources."""
22
22
 
23
23
  def __init__(self):
24
24
  super().__init__(get_path(__file__), get_path(run_dir()), (get_path(__file__) / "resources"))
25
25
 
26
26
 
27
27
  # Instantiate the classpath singleton
28
- assert _Classpath().INSTANCE is not None, "Failed to create Classpath instance"
28
+ assert (classpath := _Classpath().INSTANCE) is not None, "Failed to create Classpath instance"
@@ -1,6 +1,6 @@
1
1
  # _*_ coding: utf-8 _*_
2
2
  #
3
- # hspylib-clitt v0.9.115
3
+ # hspylib-clitt v0.9.117
4
4
  #
5
5
  # Package: main.clitt
6
6
  """Package initialization."""
@@ -10,4 +10,4 @@ __all__ = [
10
10
  'core',
11
11
  'utils'
12
12
  ]
13
- __version__ = '0.9.115'
13
+ __version__ = '0.9.117'
@@ -12,7 +12,7 @@
12
12
 
13
13
  Copyright·(c)·2024,·HSPyLib
14
14
  """
15
- from clitt.__classpath__ import _Classpath
15
+ from clitt.__classpath__ import classpath
16
16
  from clitt.addons.appman.appman import AppManager
17
17
  from clitt.addons.appman.appman_enums import AppExtension, AppType
18
18
  from clitt.addons.widman.widman import WidgetManager
@@ -31,10 +31,10 @@ class Main(TUIApplication):
31
31
  """HsPyLib CLI Terminal Tools - Create professional CLI applications."""
32
32
 
33
33
  # The welcome message
34
- DESCRIPTION = _Classpath.get_source_path("welcome.txt").read_text(encoding=Charset.UTF_8.val)
34
+ DESCRIPTION = classpath.get_source("welcome.txt").read_text(encoding=Charset.UTF_8.val)
35
35
 
36
36
  # Location of the .version file
37
- VERSION_DIR = _Classpath.source_path()
37
+ VERSION_DIR = classpath.source_path()
38
38
 
39
39
  class Addon(Enumeration):
40
40
  """HsPyLib addon types."""
@@ -1,6 +1,6 @@
1
1
  # _*_ coding: utf-8 _*_
2
2
  #
3
- # hspylib-clitt v0.9.115
3
+ # hspylib-clitt v0.9.117
4
4
  #
5
5
  # Package: main.clitt.addons
6
6
  """Package initialization."""
@@ -9,4 +9,4 @@ __all__ = [
9
9
  'appman',
10
10
  'widman'
11
11
  ]
12
- __version__ = '0.9.115'
12
+ __version__ = '0.9.117'
@@ -1,6 +1,6 @@
1
1
  # _*_ coding: utf-8 _*_
2
2
  #
3
- # hspylib-clitt v0.9.115
3
+ # hspylib-clitt v0.9.117
4
4
  #
5
5
  # Package: main.clitt.addons.appman
6
6
  """Package initialization."""
@@ -10,4 +10,4 @@ __all__ = [
10
10
  'appman_enums',
11
11
  'templates'
12
12
  ]
13
- __version__ = '0.9.115'
13
+ __version__ = '0.9.117'
@@ -1,6 +1,6 @@
1
1
  # _*_ coding: utf-8 _*_
2
2
  #
3
- # hspylib-clitt v0.9.115
3
+ # hspylib-clitt v0.9.117
4
4
  #
5
5
  # Package: main.clitt.addons.appman.templates
6
6
  """Package initialization."""
@@ -8,4 +8,4 @@
8
8
  __all__ = [
9
9
 
10
10
  ]
11
- __version__ = '0.9.115'
11
+ __version__ = '0.9.117'
@@ -6,7 +6,7 @@ from %APP_NAME%.__classpath__ import _Classpath
6
6
 
7
7
  class MainQtView(QtView):
8
8
  """Main application view"""
9
- VERSION = _Classpath.get_source_path(".version").read_text(encoding=Charset.UTF_8.val)
9
+ VERSION = classpath.get_source(".version").read_text(encoding=Charset.UTF_8.val)
10
10
 
11
11
  FORMS_DIR = str(_Classpath.resource_path() / "forms")
12
12
 
@@ -1,6 +1,6 @@
1
1
  # _*_ coding: utf-8 _*_
2
2
  #
3
- # hspylib-clitt v0.9.115
3
+ # hspylib-clitt v0.9.117
4
4
  #
5
5
  # Package: main.clitt.addons.widman
6
6
  """Package initialization."""
@@ -11,4 +11,4 @@ __all__ = [
11
11
  'widgets',
12
12
  'widman'
13
13
  ]
14
- __version__ = '0.9.115'
14
+ __version__ = '0.9.117'
@@ -1,6 +1,6 @@
1
1
  # _*_ coding: utf-8 _*_
2
2
  #
3
- # hspylib-clitt v0.9.115
3
+ # hspylib-clitt v0.9.117
4
4
  #
5
5
  # Package: main.clitt.addons.widman.widgets
6
6
  """Package initialization."""
@@ -11,4 +11,4 @@ __all__ = [
11
11
  'widget_send_msg',
12
12
  'widget_time_calc'
13
13
  ]
14
- __version__ = '0.9.115'
14
+ __version__ = '0.9.117'
@@ -1,6 +1,6 @@
1
1
  # _*_ coding: utf-8 _*_
2
2
  #
3
- # hspylib-clitt v0.9.115
3
+ # hspylib-clitt v0.9.117
4
4
  #
5
5
  # Package: main.clitt.core
6
6
  """Package initialization."""
@@ -12,4 +12,4 @@ __all__ = [
12
12
  'term',
13
13
  'tui'
14
14
  ]
15
- __version__ = '0.9.115'
15
+ __version__ = '0.9.117'
@@ -1,6 +1,6 @@
1
1
  # _*_ coding: utf-8 _*_
2
2
  #
3
- # hspylib-clitt v0.9.115
3
+ # hspylib-clitt v0.9.117
4
4
  #
5
5
  # Package: main.clitt.core.exception
6
6
  """Package initialization."""
@@ -8,4 +8,4 @@
8
8
  __all__ = [
9
9
  'exceptions'
10
10
  ]
11
- __version__ = '0.9.115'
11
+ __version__ = '0.9.117'
@@ -1,6 +1,6 @@
1
1
  # _*_ coding: utf-8 _*_
2
2
  #
3
- # hspylib-clitt v0.9.115
3
+ # hspylib-clitt v0.9.117
4
4
  #
5
5
  # Package: main.clitt.core.icons
6
6
  """Package initialization."""
@@ -9,4 +9,4 @@ __all__ = [
9
9
  'emojis',
10
10
  'font_awesome'
11
11
  ]
12
- __version__ = '0.9.115'
12
+ __version__ = '0.9.117'
@@ -1,6 +1,6 @@
1
1
  # _*_ coding: utf-8 _*_
2
2
  #
3
- # hspylib-clitt v0.9.115
3
+ # hspylib-clitt v0.9.117
4
4
  #
5
5
  # Package: main.clitt.core.icons.emojis
6
6
  """Package initialization."""
@@ -9,4 +9,4 @@ __all__ = [
9
9
  'emojis',
10
10
  'face_smiling'
11
11
  ]
12
- __version__ = '0.9.115'
12
+ __version__ = '0.9.117'
@@ -1,6 +1,6 @@
1
1
  # _*_ coding: utf-8 _*_
2
2
  #
3
- # hspylib-clitt v0.9.115
3
+ # hspylib-clitt v0.9.117
4
4
  #
5
5
  # Package: main.clitt.core.icons.font_awesome
6
6
  """Package initialization."""
@@ -15,4 +15,4 @@ __all__ = [
15
15
  'trickplay_icons',
16
16
  'widget_icons'
17
17
  ]
18
- __version__ = '0.9.115'
18
+ __version__ = '0.9.117'
@@ -1,6 +1,6 @@
1
1
  # _*_ coding: utf-8 _*_
2
2
  #
3
- # hspylib-clitt v0.9.115
3
+ # hspylib-clitt v0.9.117
4
4
  #
5
5
  # Package: main.clitt.core.term
6
6
  """Package initialization."""
@@ -11,4 +11,4 @@ __all__ = [
11
11
  'screen',
12
12
  'terminal'
13
13
  ]
14
- __version__ = '0.9.115'
14
+ __version__ = '0.9.117'
@@ -156,4 +156,4 @@ class Cursor(metaclass=Singleton):
156
156
  return self.position
157
157
 
158
158
 
159
- assert Cursor().INSTANCE is not None, "Failed to create Cursor instance"
159
+ assert (cursor := Cursor().INSTANCE) is not None, "Failed to create Cursor instance"
@@ -88,4 +88,4 @@ class Screen(metaclass=Singleton):
88
88
  self._resize_timer.start()
89
89
 
90
90
 
91
- assert Screen().INSTANCE is not None, "Failed to create Screen instance"
91
+ assert (screen := Screen().INSTANCE) is not None, "Failed to create Screen instance"
@@ -55,7 +55,7 @@ class Terminal(metaclass=Singleton):
55
55
  del kwargs["stderr"]
56
56
  if "stdin" in kwargs:
57
57
  del kwargs["stdin"]
58
- commands = map(shlex.split, cmd_list)
58
+ commands = map(shlex.split, cmd_list) if 'shell' not in kwargs else cmd_list
59
59
  first_cmd, *rest_cmds = commands
60
60
  if len(rest_cmds) > 0:
61
61
  procs: List[Popen] = [Popen(first_cmd, stdout=PIPE, stderr=PIPE, **kwargs)]
@@ -200,4 +200,4 @@ class Terminal(metaclass=Singleton):
200
200
  return self.screen.cursor
201
201
 
202
202
 
203
- assert Terminal().INSTANCE is not None, "Failed to create Terminal instance"
203
+ assert (terminal := Terminal().INSTANCE) is not None, "Failed to create Terminal instance"
@@ -1,6 +1,6 @@
1
1
  # _*_ coding: utf-8 _*_
2
2
  #
3
- # hspylib-clitt v0.9.115
3
+ # hspylib-clitt v0.9.117
4
4
  #
5
5
  # Package: main.clitt.core.tui
6
6
  """Package initialization."""
@@ -17,4 +17,4 @@ __all__ = [
17
17
  'tui_component',
18
18
  'tui_preferences'
19
19
  ]
20
- __version__ = '0.9.115'
20
+ __version__ = '0.9.117'
@@ -1,6 +1,6 @@
1
1
  # _*_ coding: utf-8 _*_
2
2
  #
3
- # hspylib-clitt v0.9.115
3
+ # hspylib-clitt v0.9.117
4
4
  #
5
5
  # Package: main.clitt.core.tui.line_input
6
6
  """Package initialization."""
@@ -9,4 +9,4 @@ __all__ = [
9
9
  'keyboard_input',
10
10
  'line_input'
11
11
  ]
12
- __version__ = '0.9.115'
12
+ __version__ = '0.9.117'
@@ -13,12 +13,13 @@
13
13
  Copyright·(c)·2024,·HSPyLib
14
14
  """
15
15
 
16
+ from typing import Optional, List, Dict
17
+
16
18
  import pyperclip
17
19
  from hspylib.modules.cli.keyboard import Keyboard
18
20
  from hspylib.modules.cli.vt100.vt_color import VtColor
19
- from typing import Optional, List, Dict
20
21
 
21
- from clitt.core.term.commons import Direction, Portion
22
+ from clitt.core.term.commons import Direction
22
23
  from clitt.core.term.terminal import Terminal
23
24
  from clitt.core.tui.tui_component import TUIComponent
24
25
 
@@ -43,6 +44,7 @@ class KeyboardInput(TUIComponent):
43
44
  """Preload the input with the provided dictionary."""
44
45
  for entry in history:
45
46
  KeyboardInput._add_history(entry)
47
+ KeyboardInput._HIST_INDEX = 0
46
48
 
47
49
  @staticmethod
48
50
  def forget_history() -> None:
@@ -62,22 +64,23 @@ class KeyboardInput(TUIComponent):
62
64
  :param input_text: The input text to add to the history.
63
65
  """
64
66
  if input_text and input_text not in list(KeyboardInput._HISTORY.values())[1:]:
65
- KeyboardInput._HISTORY[max(1, len(KeyboardInput._HISTORY))] = input_text
66
- KeyboardInput._HIST_INDEX += 1
67
+ idx: int = max(1, len(KeyboardInput._HISTORY))
68
+ KeyboardInput._HISTORY[idx] = input_text
69
+ KeyboardInput._HIST_INDEX = idx
67
70
 
68
71
  @classmethod
69
72
  def _next_in_history(cls) -> Optional[str]:
70
- index = min(len(cls._HISTORY), cls._HIST_INDEX + 1)
73
+ index = min(len(cls._HISTORY) - 1, cls._HIST_INDEX + 1)
71
74
  text = cls._HISTORY.get(index, "")
72
- cls._HIST_INDEX = min(len(cls._HISTORY) - 1, index)
75
+ cls._HIST_INDEX = index
73
76
  return text or cls._HISTORY[0]
74
77
 
75
78
  @classmethod
76
79
  def _prev_in_history(cls) -> Optional[str]:
77
- index = max(1, cls._HIST_INDEX)
80
+ index = max(0, cls._HIST_INDEX - 1)
78
81
  text = cls._HISTORY.get(index, "")
79
- cls._HIST_INDEX = max(1, index - 1)
80
- return text
82
+ cls._HIST_INDEX = index
83
+ return text or cls._HISTORY[0]
81
84
 
82
85
  @classmethod
83
86
  def _undo(cls) -> Optional[str]:
@@ -93,9 +96,16 @@ class KeyboardInput(TUIComponent):
93
96
  cls._UNDO_HISTORY.append(cls._HISTORY[0])
94
97
  return text
95
98
 
96
- def __init__(self, prompt: str = "", prompt_color: VtColor = VtColor.NC):
99
+ def __init__(
100
+ self, prompt: str = "",
101
+ prompt_color: VtColor = VtColor.NC,
102
+ text_color: VtColor = VtColor.NC,
103
+ navbar_enable: bool = False
104
+ ):
97
105
  super().__init__(prompt)
98
106
  self._prompt_color = prompt_color
107
+ self._text_color = text_color
108
+ self._navbar_enable = navbar_enable
99
109
  self._input_index = 0
100
110
  self._input_text: str = ""
101
111
  self._HISTORY[0] = ""
@@ -114,7 +124,7 @@ class KeyboardInput(TUIComponent):
114
124
  keypress = Keyboard.VK_NONE
115
125
 
116
126
  # Wait for user interaction
117
- while not self._done and keypress not in break_keys:
127
+ while not self._done and keypress and keypress not in break_keys:
118
128
  # Menu Renderization
119
129
  if self._re_render:
120
130
  self.render()
@@ -124,8 +134,9 @@ class KeyboardInput(TUIComponent):
124
134
  return keypress
125
135
 
126
136
  def execute(self) -> Optional[str | Keyboard]:
137
+ self.write(f"{self._prompt_color.placeholder}{self.title}{self._text_color.placeholder}")
127
138
  self._prepare_render()
128
- keypress = self._loop()
139
+ keypress = self._loop() or Keyboard.VK_ESC
129
140
 
130
141
  if keypress.isEnter():
131
142
  self._add_history(self._input_text)
@@ -134,16 +145,15 @@ class KeyboardInput(TUIComponent):
134
145
  elif keypress == Keyboard.VK_ESC:
135
146
  self._input_text = None
136
147
 
137
- self.writeln("")
148
+ self.writeln("%NC%")
138
149
 
139
150
  return self._input_text
140
151
 
141
152
  def render(self) -> None:
142
153
  Terminal.set_show_cursor(False)
143
154
  self.cursor.restore()
144
- self._terminal.cursor.erase(Portion.LINE)
145
- self.write(f"{self._prompt_color.placeholder}{self.title}%NC%")
146
155
  self.write(self._input_text)
156
+ self._terminal.cursor.erase(Direction.RIGHT)
147
157
  self._re_render = False
148
158
  self._set_cursor_pos()
149
159
  Terminal.set_show_cursor()
@@ -158,42 +168,32 @@ class KeyboardInput(TUIComponent):
158
168
  if self._input_index > 0:
159
169
  self._input_index = max(0, self._input_index - 1)
160
170
  self._update_input(
161
- self._input_text[: self._input_index] + self._input_text[1 + self._input_index :]
171
+ self._input_text[: self._input_index] + self._input_text[1 + self._input_index:]
162
172
  )
163
173
  case Keyboard.VK_DELETE:
164
174
  self._update_input(
165
- self._input_text[: self._input_index] + self._input_text[1 + self._input_index :]
175
+ self._input_text[: self._input_index] + self._input_text[1 + self._input_index:]
166
176
  )
167
- case Keyboard.VK_CTRL_F:
177
+ case Keyboard.VK_CTRL_F: # Forget history
168
178
  self.forget_history()
169
- case Keyboard.VK_CTRL_P:
179
+ case Keyboard.VK_CTRL_P: # Paste from clipboard
170
180
  text = (pyperclip.paste() or '').replace("\n", "↵")
171
181
  self._update_input(
172
- self._input_text[: self._input_index] + text + self._input_text[self._input_index :]
182
+ self._input_text[: self._input_index] + text + self._input_text[self._input_index:]
173
183
  )
174
184
  self._input_index += len(text)
175
- case Keyboard.VK_CTRL_R:
185
+ case Keyboard.VK_CTRL_R: # Reset contents
176
186
  self._input_index = 0
177
187
  self._update_input("")
178
- case Keyboard.VK_CTRL_U: # Undo
179
- undo_text = self._undo()
180
- self._input_text = undo_text
181
- self._input_index = self.length
182
- self._HISTORY[0] = self._input_text
183
- case Keyboard.VK_CTRL_K: # redo
184
- redo_text = self._redo()
185
- self._input_text = redo_text if redo_text else self._input_text
186
- self._input_index = self.length
187
- self._HISTORY[0] = self._input_text
188
188
  case Keyboard.VK_LEFT:
189
189
  self._input_index = max(0, self._input_index - 1)
190
190
  case Keyboard.VK_RIGHT:
191
191
  self._input_index = min(self.length, self._input_index + 1)
192
192
  case Keyboard.VK_UP:
193
- self._input_text = self._prev_in_history()
193
+ self._input_text = self._next_in_history()
194
194
  self._input_index = self.length
195
195
  case Keyboard.VK_DOWN:
196
- self._input_text = self._next_in_history()
196
+ self._input_text = self._prev_in_history()
197
197
  self._input_index = self.length
198
198
  case Keyboard.VK_HOME:
199
199
  self._input_index = 0
@@ -201,7 +201,7 @@ class KeyboardInput(TUIComponent):
201
201
  self._input_index = self.length
202
202
  case _ as key if key.val.isprintable():
203
203
  self._update_input(
204
- self._input_text[: self._input_index] + key.val + self._input_text[self._input_index :]
204
+ self._input_text[: self._input_index] + key.val + self._input_text[self._input_index:]
205
205
  )
206
206
  self._input_index += 1
207
207
  case _ as key if key in Keyboard.break_keys():
@@ -22,22 +22,14 @@ from clitt.core.tui.line_input.keyboard_input import KeyboardInput
22
22
  def line_input(
23
23
  prompt: str = "",
24
24
  prompt_color: VtColor = VtColor.NC,
25
+ text_color: VtColor = VtColor.NC,
26
+ navbar_enable: bool = False
25
27
  ) -> Optional[str | Keyboard]:
26
28
  """Read a string from standard input.
27
29
  :param prompt: The message to be displayed to the user.
28
30
  :param prompt_color: The color of the prompt text.
31
+ :param text_color: The color of the input text.
32
+ :param navbar_enable: Whether to display the navbar or not.
29
33
  """
30
- ptt = KeyboardInput(prompt, prompt_color)
34
+ ptt = KeyboardInput(prompt, prompt_color, text_color, navbar_enable)
31
35
  return ptt.execute()
32
-
33
-
34
- if __name__ == "__main__":
35
- hist = ["Hugo", "Joao", "Koko", "Hugo"]
36
- KeyboardInput.preload_history(hist)
37
- print("-=" * 30)
38
- while (i := line_input("What is it? ")) not in ["bye", ""]:
39
- if isinstance(i, Keyboard):
40
- print(i)
41
- else:
42
- print("Input:", i)
43
- print(KeyboardInput.history())
@@ -1,6 +1,6 @@
1
1
  # _*_ coding: utf-8 _*_
2
2
  #
3
- # hspylib-clitt v0.9.115
3
+ # hspylib-clitt v0.9.117
4
4
  #
5
5
  # Package: main.clitt.core.tui.mchoose
6
6
  """Package initialization."""
@@ -9,4 +9,4 @@ __all__ = [
9
9
  'mchoose',
10
10
  'menu_choose'
11
11
  ]
12
- __version__ = '0.9.115'
12
+ __version__ = '0.9.117'
@@ -1,6 +1,6 @@
1
1
  # _*_ coding: utf-8 _*_
2
2
  #
3
- # hspylib-clitt v0.9.115
3
+ # hspylib-clitt v0.9.117
4
4
  #
5
5
  # Package: main.clitt.core.tui.mdashboard
6
6
  """Package initialization."""
@@ -11,4 +11,4 @@ __all__ = [
11
11
  'mdashboard',
12
12
  'menu_dashboard'
13
13
  ]
14
- __version__ = '0.9.115'
14
+ __version__ = '0.9.117'
@@ -1,6 +1,6 @@
1
1
  # _*_ coding: utf-8 _*_
2
2
  #
3
- # hspylib-clitt v0.9.115
3
+ # hspylib-clitt v0.9.117
4
4
  #
5
5
  # Package: main.clitt.core.tui.menu
6
6
  """Package initialization."""
@@ -13,4 +13,4 @@ __all__ = [
13
13
  'tui_menu_ui',
14
14
  'tui_menu_view'
15
15
  ]
16
- __version__ = '0.9.115'
16
+ __version__ = '0.9.117'
@@ -1,6 +1,6 @@
1
1
  # _*_ coding: utf-8 _*_
2
2
  #
3
- # hspylib-clitt v0.9.115
3
+ # hspylib-clitt v0.9.117
4
4
  #
5
5
  # Package: main.clitt.core.tui.minput
6
6
  """Package initialization."""
@@ -16,4 +16,4 @@ __all__ = [
16
16
  'minput',
17
17
  'minput_utils'
18
18
  ]
19
- __version__ = '0.9.115'
19
+ __version__ = '0.9.117'
@@ -1,6 +1,6 @@
1
1
  # _*_ coding: utf-8 _*_
2
2
  #
3
- # hspylib-clitt v0.9.115
3
+ # hspylib-clitt v0.9.117
4
4
  #
5
5
  # Package: main.clitt.core.tui.mselect
6
6
  """Package initialization."""
@@ -9,4 +9,4 @@ __all__ = [
9
9
  'menu_select',
10
10
  'mselect'
11
11
  ]
12
- __version__ = '0.9.115'
12
+ __version__ = '0.9.117'
@@ -1,6 +1,6 @@
1
1
  # _*_ coding: utf-8 _*_
2
2
  #
3
- # hspylib-clitt v0.9.115
3
+ # hspylib-clitt v0.9.117
4
4
  #
5
5
  # Package: main.clitt.core.tui.table
6
6
  """Package initialization."""
@@ -9,4 +9,4 @@ __all__ = [
9
9
  'table_enums',
10
10
  'table_renderer'
11
11
  ]
12
- __version__ = '0.9.115'
12
+ __version__ = '0.9.117'
@@ -12,16 +12,17 @@
12
12
 
13
13
  Copyright·(c)·2024,·HSPyLib
14
14
  """
15
- from clitt.core.term.cursor import Cursor
16
- from clitt.core.term.screen import Screen
17
- from clitt.core.term.terminal import Terminal
15
+ import os
16
+ import sys
17
+
18
+ from hspylib.core.metaclass.classpath import AnyPath
18
19
  from hspylib.core.metaclass.singleton import AbstractSingleton
19
20
  from hspylib.modules.application.application import Application
20
21
  from hspylib.modules.application.exit_status import ExitStatus
21
22
  from hspylib.modules.application.version import Version
22
23
 
23
- import os
24
- import sys
24
+ from clitt.core.term.screen import screen
25
+ from clitt.core.term.terminal import terminal
25
26
 
26
27
 
27
28
  class TUIApplication(Application, metaclass=AbstractSingleton):
@@ -34,25 +35,12 @@ class TUIApplication(Application, metaclass=AbstractSingleton):
34
35
  description: str = None,
35
36
  usage: str = None,
36
37
  epilog: str = None,
37
- resource_dir: str = None,
38
- log_dir: str = None,
38
+ resource_dir: AnyPath = None,
39
+ log_dir: AnyPath = None,
39
40
  ):
40
41
  super().__init__(name, version, description, usage, epilog, resource_dir, log_dir)
41
- self._terminal = Terminal.INSTANCE
42
42
  self._app_name = os.path.basename(sys.argv[0]) if name is None else name
43
43
 
44
- @property
45
- def terminal(self) -> Terminal():
46
- return self._terminal
47
-
48
- @property
49
- def screen(self) -> Screen():
50
- return self.terminal.screen
51
-
52
- @property
53
- def cursor(self) -> Cursor:
54
- return self.terminal.cursor
55
-
56
44
  def _setup_arguments(self) -> None:
57
45
  pass
58
46
 
@@ -60,6 +48,6 @@ class TUIApplication(Application, metaclass=AbstractSingleton):
60
48
  pass
61
49
 
62
50
  def _cleanup(self) -> None:
63
- if self.screen.alternate and self._exit_code == ExitStatus.SUCCESS:
64
- self.screen.alternate = not self.screen.alternate
65
- self.terminal.restore()
51
+ if screen.alternate and self._exit_code == ExitStatus.SUCCESS:
52
+ screen.alternate = not screen.alternate
53
+ terminal.restore()
@@ -100,4 +100,4 @@ class TUIPreferences(Preferences):
100
100
  return self.get_preference("unchecked.icon", FormIcons.UNMARKED)
101
101
 
102
102
 
103
- assert TUIPreferences().INSTANCE is not None, "Failed to create TUIPreferences instance"
103
+ assert (tui_preferences := TUIPreferences().INSTANCE) is not None, "Failed to create TUIPreferences instance"
@@ -1,6 +1,6 @@
1
1
  # _*_ coding: utf-8 _*_
2
2
  #
3
- # hspylib-clitt v0.9.115
3
+ # hspylib-clitt v0.9.117
4
4
  #
5
5
  # Package: main.clitt.utils
6
6
  """Package initialization."""
@@ -8,4 +8,4 @@
8
8
  __all__ = [
9
9
  'git_utils'
10
10
  ]
11
- __version__ = '0.9.115'
11
+ __version__ = '0.9.117'
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: hspylib-clitt
3
- Version: 0.9.115
3
+ Version: 0.9.117
4
4
  Summary: HsPyLib - CLI Terminal Tools
5
5
  Home-page: https://github.com/yorevs/hspylib
6
6
  Author: Hugo Saporetti Junior
@@ -35,7 +35,7 @@ Requires-Dist: urllib3<2.0.0
35
35
  ## Create professional CLI applications
36
36
 
37
37
  [![License](https://badgen.net/badge/license/MIT/gray)](LICENSE.md)
38
- [![Release](https://badgen.net/badge/release/v0.9.115/gray)](CHANGELOG.md#unreleased)
38
+ [![Release](https://badgen.net/badge/release/v0.9.117/gray)](CHANGELOG.md#unreleased)
39
39
  [![PyPi](https://badgen.net/badge/icon/python?icon=pypi&label)](https://pypi.org/project/hspylib-clitt)
40
40
  [![GitHub](https://badgen.net/badge/icon/github?icon=github&label)](https://github.com/yorevs/hspylib)
41
41
  [![Gitter](https://badgen.net/badge/icon/gitter?icon=gitter&label)](https://gitter.im/hspylib/community)
@@ -1 +0,0 @@
1
- 0.9.115