shoestring-assembler 0.0.7__tar.gz → 0.0.8__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.
Files changed (109) hide show
  1. {shoestring_assembler-0.0.7 → shoestring_assembler-0.0.8}/PKG-INFO +2 -2
  2. {shoestring_assembler-0.0.7 → shoestring_assembler-0.0.8}/docs/Makefile +1 -1
  3. shoestring_assembler-0.0.8/docs/_build/html/_static/file.png +0 -0
  4. shoestring_assembler-0.0.8/docs/_build/html/_static/minus.png +0 -0
  5. shoestring_assembler-0.0.8/docs/_build/html/_static/plus.png +0 -0
  6. shoestring_assembler-0.0.8/docs/api.rst +7 -0
  7. {shoestring_assembler-0.0.7 → shoestring_assembler-0.0.8}/docs/conf.py +41 -30
  8. shoestring_assembler-0.0.8/docs/generated/shoestring_assembler.rst +23 -0
  9. {shoestring_assembler-0.0.7 → shoestring_assembler-0.0.8}/docs/index.rst +5 -0
  10. {shoestring_assembler-0.0.7 → shoestring_assembler-0.0.8}/pyproject.toml +2 -2
  11. {shoestring_assembler-0.0.7 → shoestring_assembler-0.0.8}/src/shoestring_assembler/cli.py +37 -55
  12. {shoestring_assembler-0.0.7 → shoestring_assembler-0.0.8}/src/shoestring_assembler/constants.py +7 -5
  13. {shoestring_assembler-0.0.7 → shoestring_assembler-0.0.8}/src/shoestring_assembler/display.py +37 -31
  14. shoestring_assembler-0.0.8/src/shoestring_assembler/engine/action/assemble.py +270 -0
  15. shoestring_assembler-0.0.8/src/shoestring_assembler/engine/action/docker.py +250 -0
  16. shoestring_assembler-0.0.8/src/shoestring_assembler/engine/action/filesystem.py +46 -0
  17. shoestring_assembler-0.0.8/src/shoestring_assembler/engine/action/git.py +129 -0
  18. shoestring_assembler-0.0.8/src/shoestring_assembler/engine/action/user_config.py +55 -0
  19. shoestring_assembler-0.0.8/src/shoestring_assembler/engine/engine.py +254 -0
  20. shoestring_assembler-0.0.8/src/shoestring_assembler/implementation/source/__init__.py +34 -0
  21. shoestring_assembler-0.0.8/src/shoestring_assembler/implementation/source/filesystem.py +92 -0
  22. shoestring_assembler-0.0.8/src/shoestring_assembler/implementation/source/git.py +114 -0
  23. shoestring_assembler-0.0.8/src/shoestring_assembler/implementation/vc/git.py +155 -0
  24. shoestring_assembler-0.0.8/src/shoestring_assembler/interface/events/__init__.py +15 -0
  25. shoestring_assembler-0.0.8/src/shoestring_assembler/interface/events/_events.py +30 -0
  26. shoestring_assembler-0.0.8/src/shoestring_assembler/interface/events/audit.py +73 -0
  27. shoestring_assembler-0.0.8/src/shoestring_assembler/interface/events/progress.py +88 -0
  28. shoestring_assembler-0.0.8/src/shoestring_assembler/interface/events/updates.py +96 -0
  29. shoestring_assembler-0.0.8/src/shoestring_assembler/interface/pipe/pipe.py +41 -0
  30. shoestring_assembler-0.0.8/src/shoestring_assembler/interface/signals.py +33 -0
  31. shoestring_assembler-0.0.8/src/shoestring_assembler/interface/state_machine/steps.py +281 -0
  32. shoestring_assembler-0.0.8/src/shoestring_assembler/model/base_module.py +70 -0
  33. {shoestring_assembler-0.0.7/src/shoestring_assembler/models → shoestring_assembler-0.0.8/src/shoestring_assembler/model}/common.py +3 -3
  34. {shoestring_assembler-0.0.7/src/shoestring_assembler/models → shoestring_assembler-0.0.8/src/shoestring_assembler/model}/container.py +43 -25
  35. shoestring_assembler-0.0.8/src/shoestring_assembler/model/filesystem.py +329 -0
  36. {shoestring_assembler-0.0.7/src/shoestring_assembler/models → shoestring_assembler-0.0.8/src/shoestring_assembler/model}/infrastructure_module.py +2 -2
  37. shoestring_assembler-0.0.8/src/shoestring_assembler/model/installed.py +68 -0
  38. shoestring_assembler-0.0.8/src/shoestring_assembler/model/recipe.py +176 -0
  39. {shoestring_assembler-0.0.7/src/shoestring_assembler → shoestring_assembler-0.0.8/src/shoestring_assembler/model}/schemas/schema_validators.py +5 -5
  40. shoestring_assembler-0.0.8/src/shoestring_assembler/model/service_module.py +9 -0
  41. shoestring_assembler-0.0.8/src/shoestring_assembler/model/solution.py +175 -0
  42. {shoestring_assembler-0.0.7/src/shoestring_assembler/models → shoestring_assembler-0.0.8/src/shoestring_assembler/model}/source.py +20 -25
  43. {shoestring_assembler-0.0.7/src/shoestring_assembler/models → shoestring_assembler-0.0.8/src/shoestring_assembler/model}/user_config.py +81 -54
  44. shoestring_assembler-0.0.8/src/shoestring_assembler/view/__init__.py +0 -0
  45. shoestring_assembler-0.0.8/src/shoestring_assembler/view/cli_app/__init__.py +1 -0
  46. shoestring_assembler-0.0.8/src/shoestring_assembler/view/cli_app/app.py +117 -0
  47. shoestring_assembler-0.0.8/src/shoestring_assembler/view/cli_app/screens/__init__.py +6 -0
  48. shoestring_assembler-0.0.8/src/shoestring_assembler/view/cli_app/screens/config.tcss +39 -0
  49. shoestring_assembler-0.0.8/src/shoestring_assembler/view/cli_app/screens/config_inputs.py +325 -0
  50. shoestring_assembler-0.0.8/src/shoestring_assembler/view/cli_app/screens/engine.py +263 -0
  51. shoestring_assembler-0.0.8/src/shoestring_assembler/view/cli_app/screens/engine.tcss +61 -0
  52. shoestring_assembler-0.0.8/src/shoestring_assembler/view/cli_app/screens/find_solution.py +79 -0
  53. shoestring_assembler-0.0.8/src/shoestring_assembler/view/cli_app/screens/home.py +101 -0
  54. shoestring_assembler-0.0.8/src/shoestring_assembler/view/cli_app/screens/home.tcss +20 -0
  55. shoestring_assembler-0.0.8/src/shoestring_assembler/view/cli_app/screens/modals.py +42 -0
  56. shoestring_assembler-0.0.8/src/shoestring_assembler/view/cli_app/screens/modals.tcss +30 -0
  57. shoestring_assembler-0.0.8/src/shoestring_assembler/view/cli_app/screens/solution_picker.py +133 -0
  58. shoestring_assembler-0.0.8/src/shoestring_assembler/view/cli_app/screens/solution_picker.tcss +11 -0
  59. shoestring_assembler-0.0.7/src/shoestring_assembler/views/plain_cli.py → shoestring_assembler-0.0.8/src/shoestring_assembler/view/plain_cli/__init__.py +171 -55
  60. shoestring_assembler-0.0.8/src/shoestring_assembler/view/plain_cli/audit_events.py +60 -0
  61. {shoestring_assembler-0.0.7 → shoestring_assembler-0.0.8}/src/shoestring_assembler.egg-info/PKG-INFO +2 -2
  62. shoestring_assembler-0.0.8/src/shoestring_assembler.egg-info/SOURCES.txt +93 -0
  63. {shoestring_assembler-0.0.7 → shoestring_assembler-0.0.8}/src/shoestring_assembler.egg-info/requires.txt +1 -1
  64. shoestring_assembler-0.0.7/src/shoestring_assembler/assembler.py +0 -231
  65. shoestring_assembler-0.0.7/src/shoestring_assembler/docker.py +0 -87
  66. shoestring_assembler-0.0.7/src/shoestring_assembler/engine/engine.py +0 -204
  67. shoestring_assembler-0.0.7/src/shoestring_assembler/engine/step_definitions.py +0 -167
  68. shoestring_assembler-0.0.7/src/shoestring_assembler/filesystem.py +0 -181
  69. shoestring_assembler-0.0.7/src/shoestring_assembler/git.py +0 -354
  70. shoestring_assembler-0.0.7/src/shoestring_assembler/models/base_module.py +0 -58
  71. shoestring_assembler-0.0.7/src/shoestring_assembler/models/recipe.py +0 -119
  72. shoestring_assembler-0.0.7/src/shoestring_assembler/models/service_module.py +0 -10
  73. shoestring_assembler-0.0.7/src/shoestring_assembler/models/solution.py +0 -164
  74. shoestring_assembler-0.0.7/src/shoestring_assembler/user_config.py +0 -98
  75. shoestring_assembler-0.0.7/src/shoestring_assembler/views/cli_app.py +0 -38
  76. shoestring_assembler-0.0.7/src/shoestring_assembler/views/interface/updates.py +0 -59
  77. shoestring_assembler-0.0.7/src/shoestring_assembler.egg-info/SOURCES.txt +0 -61
  78. {shoestring_assembler-0.0.7 → shoestring_assembler-0.0.8}/AUTHORS.rst +0 -0
  79. {shoestring_assembler-0.0.7 → shoestring_assembler-0.0.8}/CONTRIBUTING.rst +0 -0
  80. {shoestring_assembler-0.0.7 → shoestring_assembler-0.0.8}/HISTORY.rst +0 -0
  81. {shoestring_assembler-0.0.7 → shoestring_assembler-0.0.8}/LICENSE +0 -0
  82. {shoestring_assembler-0.0.7 → shoestring_assembler-0.0.8}/MANIFEST.in +0 -0
  83. {shoestring_assembler-0.0.7 → shoestring_assembler-0.0.8}/README.rst +0 -0
  84. {shoestring_assembler-0.0.7 → shoestring_assembler-0.0.8}/docs/authors.rst +0 -0
  85. {shoestring_assembler-0.0.7 → shoestring_assembler-0.0.8}/docs/contributing.rst +0 -0
  86. {shoestring_assembler-0.0.7 → shoestring_assembler-0.0.8}/docs/history.rst +0 -0
  87. {shoestring_assembler-0.0.7 → shoestring_assembler-0.0.8}/docs/installation.rst +0 -0
  88. {shoestring_assembler-0.0.7 → shoestring_assembler-0.0.8}/docs/make.bat +0 -0
  89. {shoestring_assembler-0.0.7 → shoestring_assembler-0.0.8}/docs/readme.rst +0 -0
  90. {shoestring_assembler-0.0.7 → shoestring_assembler-0.0.8}/docs/usage.rst +0 -0
  91. {shoestring_assembler-0.0.7 → shoestring_assembler-0.0.8}/setup.cfg +0 -0
  92. {shoestring_assembler-0.0.7 → shoestring_assembler-0.0.8}/src/shoestring_assembler/__init__.py +0 -0
  93. {shoestring_assembler-0.0.7 → shoestring_assembler-0.0.8}/src/shoestring_assembler/engine/__init__.py +0 -0
  94. {shoestring_assembler-0.0.7/src/shoestring_assembler/views → shoestring_assembler-0.0.8/src/shoestring_assembler/interface}/__init__.py +0 -0
  95. {shoestring_assembler-0.0.7/src/shoestring_assembler/engine → shoestring_assembler-0.0.8/src/shoestring_assembler/interface/state_machine}/process.MD +0 -0
  96. {shoestring_assembler-0.0.7/src/shoestring_assembler/models → shoestring_assembler-0.0.8/src/shoestring_assembler/model}/__init__.py +0 -0
  97. {shoestring_assembler-0.0.7/src/shoestring_assembler → shoestring_assembler-0.0.8/src/shoestring_assembler/model}/schemas/__init__.py +0 -0
  98. {shoestring_assembler-0.0.7/src/shoestring_assembler → shoestring_assembler-0.0.8/src/shoestring_assembler/model}/schemas/meta.schema.json +0 -0
  99. {shoestring_assembler-0.0.7/src/shoestring_assembler → shoestring_assembler-0.0.8/src/shoestring_assembler/model}/schemas/recipe.schema.json +0 -0
  100. {shoestring_assembler-0.0.7 → shoestring_assembler-0.0.8}/src/shoestring_assembler/solution_picker.py +0 -0
  101. {shoestring_assembler-0.0.7 → shoestring_assembler-0.0.8}/src/shoestring_assembler/utilities/minimal_mustache.py +0 -0
  102. {shoestring_assembler-0.0.7 → shoestring_assembler-0.0.8}/src/shoestring_assembler/utilities/path.py +0 -0
  103. {shoestring_assembler-0.0.7/src/shoestring_assembler → shoestring_assembler-0.0.8/src/shoestring_assembler/view/cli_app}/layout.tcss +0 -0
  104. {shoestring_assembler-0.0.7 → shoestring_assembler-0.0.8}/src/shoestring_assembler.egg-info/dependency_links.txt +0 -0
  105. {shoestring_assembler-0.0.7 → shoestring_assembler-0.0.8}/src/shoestring_assembler.egg-info/entry_points.txt +0 -0
  106. {shoestring_assembler-0.0.7 → shoestring_assembler-0.0.8}/src/shoestring_assembler.egg-info/top_level.txt +0 -0
  107. {shoestring_assembler-0.0.7 → shoestring_assembler-0.0.8}/tests/__init__.py +0 -0
  108. {shoestring_assembler-0.0.7 → shoestring_assembler-0.0.8}/tests/console.log +0 -0
  109. {shoestring_assembler-0.0.7 → shoestring_assembler-0.0.8}/tests/test_shoestring_assembler.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: shoestring_assembler
3
- Version: 0.0.7
3
+ Version: 0.0.8
4
4
  Summary: Assembles Shoestring Solutions from a solution recipe
5
5
  Author-email: Greg Hawkridge <gth24@cam.ac.uk>
6
6
  Maintainer-email: Greg Hawkridge <gth24@cam.ac.uk>
@@ -24,7 +24,7 @@ Requires-Dist: tomli==2.2.1; python_version < "3.11"
24
24
  Requires-Dist: jsonschema[format-nongpl]==4.21.1
25
25
  Requires-Dist: pyyaml==6.0.2
26
26
  Requires-Dist: Jinja2==3.1.6
27
- Requires-Dist: textual==2.1.2
27
+ Requires-Dist: textual==5.0.1
28
28
  Provides-Extra: dev
29
29
  Requires-Dist: coverage; extra == "dev"
30
30
  Requires-Dist: mypy; extra == "dev"
@@ -17,4 +17,4 @@ help:
17
17
  # Catch-all target: route all unknown targets to Sphinx using the new
18
18
  # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
19
19
  %: Makefile
20
- @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
20
+ @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
@@ -0,0 +1,7 @@
1
+ API
2
+ ===
3
+
4
+ .. autosummary::
5
+ :toctree: generated
6
+
7
+ shoestring_assembler
@@ -19,7 +19,8 @@
19
19
  #
20
20
  import os
21
21
  import sys
22
- sys.path.insert(0, os.path.abspath('..'))
22
+
23
+ sys.path.insert(0, os.path.abspath(".."))
23
24
 
24
25
  import shoestring_assembler
25
26
 
@@ -31,22 +32,27 @@ import shoestring_assembler
31
32
 
32
33
  # Add any Sphinx extension module names here, as strings. They can be
33
34
  # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
34
- extensions = ['sphinx.ext.autodoc', 'sphinx.ext.viewcode']
35
+ extensions = [
36
+ "sphinx.ext.autodoc",
37
+ "sphinx.ext.viewcode",
38
+ "sphinx.ext.autosummary",
39
+ "myst_parser",
40
+ "sphinx_markdown_builder",
41
+ ]
35
42
 
36
43
  # Add any paths that contain templates here, relative to this directory.
37
- templates_path = ['_templates']
44
+ templates_path = ["_templates"]
38
45
 
39
46
  # The suffix(es) of source filenames.
40
47
  # You can specify multiple suffix as a list of string:
41
48
  #
42
- # source_suffix = ['.rst', '.md']
43
- source_suffix = '.rst'
49
+ source_suffix = ['.rst', '.md']
44
50
 
45
51
  # The master toctree document.
46
- master_doc = 'index'
52
+ master_doc = "index"
47
53
 
48
54
  # General information about the project.
49
- project = 'Shoestring Assembler'
55
+ project = "Shoestring Assembler"
50
56
  copyright = "2025, Greg Hawkridge"
51
57
  author = "Greg Hawkridge"
52
58
 
@@ -69,10 +75,10 @@ language = None
69
75
  # List of patterns, relative to source directory, that match files and
70
76
  # directories to ignore when looking for source files.
71
77
  # This patterns also effect to html_static_path and html_extra_path
72
- exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
78
+ exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
73
79
 
74
80
  # The name of the Pygments (syntax highlighting) style to use.
75
- pygments_style = 'sphinx'
81
+ pygments_style = "sphinx"
76
82
 
77
83
  # If true, `todo` and `todoList` produce output, else they produce nothing.
78
84
  todo_include_todos = False
@@ -83,7 +89,7 @@ todo_include_todos = False
83
89
  # The theme to use for HTML and HTML Help pages. See the documentation for
84
90
  # a list of builtin themes.
85
91
  #
86
- html_theme = 'alabaster'
92
+ html_theme = "alabaster"
87
93
 
88
94
  # Theme options are theme-specific and customize the look and feel of a
89
95
  # theme further. For a list of options available for each theme, see the
@@ -94,13 +100,13 @@ html_theme = 'alabaster'
94
100
  # Add any paths that contain custom static files (such as style sheets) here,
95
101
  # relative to this directory. They are copied after the builtin static files,
96
102
  # so a file named "default.css" will overwrite the builtin "default.css".
97
- html_static_path = ['_static']
103
+ html_static_path = ["_static"]
98
104
 
99
105
 
100
106
  # -- Options for HTMLHelp output ---------------------------------------
101
107
 
102
108
  # Output file base name for HTML help builder.
103
- htmlhelp_basename = 'shoestring_assemblerdoc'
109
+ htmlhelp_basename = "shoestring_assemblerdoc"
104
110
 
105
111
 
106
112
  # -- Options for LaTeX output ------------------------------------------
@@ -109,15 +115,12 @@ latex_elements = {
109
115
  # The paper size ('letterpaper' or 'a4paper').
110
116
  #
111
117
  # 'papersize': 'letterpaper',
112
-
113
118
  # The font size ('10pt', '11pt' or '12pt').
114
119
  #
115
120
  # 'pointsize': '10pt',
116
-
117
121
  # Additional stuff for the LaTeX preamble.
118
122
  #
119
123
  # 'preamble': '',
120
-
121
124
  # Latex figure (float) alignment
122
125
  #
123
126
  # 'figure_align': 'htbp',
@@ -127,9 +130,13 @@ latex_elements = {
127
130
  # (source start file, target name, title, author, documentclass
128
131
  # [howto, manual, or own class]).
129
132
  latex_documents = [
130
- (master_doc, 'shoestring_assembler.tex',
131
- 'Shoestring Assembler Documentation',
132
- 'Greg Hawkridge', 'manual'),
133
+ (
134
+ master_doc,
135
+ "shoestring_assembler.tex",
136
+ "Shoestring Assembler Documentation",
137
+ "Greg Hawkridge",
138
+ "manual",
139
+ ),
133
140
  ]
134
141
 
135
142
 
@@ -138,9 +145,13 @@ latex_documents = [
138
145
  # One entry per manual page. List of tuples
139
146
  # (source start file, name, description, authors, manual section).
140
147
  man_pages = [
141
- (master_doc, 'shoestring_assembler',
142
- 'Shoestring Assembler Documentation',
143
- [author], 1)
148
+ (
149
+ master_doc,
150
+ "shoestring_assembler",
151
+ "Shoestring Assembler Documentation",
152
+ [author],
153
+ 1,
154
+ )
144
155
  ]
145
156
 
146
157
 
@@ -150,13 +161,13 @@ man_pages = [
150
161
  # (source start file, target name, title, author,
151
162
  # dir menu entry, description, category)
152
163
  texinfo_documents = [
153
- (master_doc, 'shoestring_assembler',
154
- 'Shoestring Assembler Documentation',
155
- author,
156
- 'shoestring_assembler',
157
- 'One line description of project.',
158
- 'Miscellaneous'),
164
+ (
165
+ master_doc,
166
+ "shoestring_assembler",
167
+ "Shoestring Assembler Documentation",
168
+ author,
169
+ "shoestring_assembler",
170
+ "One line description of project.",
171
+ "Miscellaneous",
172
+ ),
159
173
  ]
160
-
161
-
162
-
@@ -0,0 +1,23 @@
1
+ shoestring\_assembler
2
+ =====================
3
+
4
+ .. automodule:: shoestring_assembler
5
+
6
+
7
+
8
+
9
+
10
+
11
+
12
+
13
+
14
+
15
+
16
+
17
+
18
+
19
+
20
+
21
+
22
+
23
+
@@ -12,6 +12,11 @@ Welcome to Shoestring Assembler's documentation!
12
12
  contributing
13
13
  authors
14
14
  history
15
+ file_structure
16
+ recipe
17
+ sources
18
+ user_config
19
+ api
15
20
 
16
21
  Indices and tables
17
22
  ==================
@@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta"
6
6
 
7
7
  [project]
8
8
  name = "shoestring_assembler"
9
- version = "0.0.7"
9
+ version = "0.0.8"
10
10
  description = "Assembles Shoestring Solutions from a solution recipe"
11
11
  readme = "README.rst"
12
12
  authors = [
@@ -34,7 +34,7 @@ dependencies = [
34
34
  "jsonschema[format-nongpl]==4.21.1",
35
35
  "pyyaml==6.0.2",
36
36
  "Jinja2==3.1.6",
37
- "textual==2.1.2"
37
+ "textual==5.0.1"
38
38
  ]
39
39
 
40
40
  [project.optional-dependencies]
@@ -1,18 +1,15 @@
1
1
  """Console script for shoestring_assembler."""
2
2
 
3
3
  import shoestring_assembler
4
- from shoestring_assembler.assembler import Assembler
5
- from shoestring_assembler.models.recipe import Recipe
6
- from shoestring_assembler.user_config import UserConfig
4
+ from shoestring_assembler.model.recipe import Recipe
7
5
  from shoestring_assembler.display import Display
8
- from shoestring_assembler.filesystem import SolutionFilesystem
9
- from shoestring_assembler.git import SolutionGitVC, GetSolutionUsingGit
10
- from shoestring_assembler.docker import Docker
6
+ from shoestring_assembler.interface.signals import Action
11
7
 
12
8
  import typer
13
9
  from typing_extensions import Annotated
14
10
  import os
15
11
  import sys
12
+ import asyncio
16
13
 
17
14
  typer_app = typer.Typer(name="Shoestring Assembler", no_args_is_help=True)
18
15
 
@@ -37,7 +34,7 @@ def download(
37
34
  """
38
35
  Downloads the specified solution
39
36
  """
40
- execute(Commands.DOWNLOAD,verbose=verbose)
37
+ execute(Action.DOWNLOAD,verbose=verbose)
41
38
 
42
39
 
43
40
  @typer_app.command()
@@ -61,7 +58,7 @@ def update(
61
58
  """
62
59
  Updates the solution to the specified version. If a version is not specified - it lists the available versions that you can choose from.
63
60
  """
64
- execute(Commands.UPDATE,recipe_location=recipe_location,verbose=verbose)
61
+ execute(Action.UPDATE,version=version,no_prompt=yes,recipe_location=recipe_location,verbose=verbose)
65
62
 
66
63
 
67
64
  @typer_app.command()
@@ -77,7 +74,7 @@ def assemble(
77
74
  """
78
75
  Assembles the solution using the provided recipe
79
76
  """
80
- execute(Commands.ASSEMBLE, recipe_location=recipe_location, verbose=verbose)
77
+ execute(Action.ASSEMBLE, recipe_location=recipe_location, verbose=verbose,download=download)
81
78
 
82
79
 
83
80
  @typer_app.command()
@@ -89,24 +86,39 @@ def reconfigure(
89
86
  bool, typer.Option("--verbose", help="Show extra logs.")
90
87
  ] = False,
91
88
  ):
92
- execute(Commands.RECONFIGURE, recipe_location=recipe_location, verbose=verbose)
89
+ execute(Action.RECONFIGURE, recipe_location=recipe_location, verbose=verbose)
93
90
 
94
91
 
95
92
  @typer_app.command()
96
93
  def build():
97
- execute(Commands.BUILD)
94
+ execute(Action.BUILD)
98
95
 
99
96
 
100
97
  @typer_app.command()
101
98
  def setup():
102
- execute(Commands.SETUP)
99
+ execute(Action.SETUP)
103
100
 
104
101
 
105
102
  @typer_app.command()
106
103
  def start():
107
- execute(Commands.START)
104
+ execute(Action.START)
108
105
 
109
106
 
107
+ @typer_app.command()
108
+ def stop():
109
+ execute(Action.STOP)
110
+
111
+
112
+ @typer_app.command()
113
+ def rebuild():
114
+ execute(Action.REBUILD)
115
+
116
+ @typer_app.command()
117
+ def app():
118
+ from shoestring_assembler.view.cli_app import SolutionAssemblerApp
119
+ app = SolutionAssemblerApp()
120
+ app.run()
121
+
110
122
  @typer_app.callback(invoke_without_command=True)
111
123
  def main(
112
124
  version: Annotated[
@@ -118,51 +130,25 @@ def main(
118
130
  f"Shoestring Assembler version {shoestring_assembler.__version__}"
119
131
  )
120
132
  else:
121
- pass # TODO display menu
133
+ pass #todo
122
134
 
123
135
 
124
- from enum import Enum, unique
125
136
  from .engine.engine import Engine
126
- from .views.plain_cli import PlainCLI
127
-
128
- @unique
129
- class Commands(Enum):
130
- DOWNLOAD = "download"
131
- UPDATE = "update"
132
- ASSEMBLE = "assemble"
133
- RECONFIGURE = "reconfigure"
134
- BUILD = "build"
135
- SETUP = "setup"
136
- START = "start"
137
-
138
- def execute(command,*,recipe_location=None,verbose=False):
137
+ from shoestring_assembler.view.plain_cli import PlainCLI
138
+
139
+
140
+ def execute(action,*,recipe_location=None,verbose=False,**kwargs):
139
141
  if verbose:
140
142
  Display.log_level = 5
141
143
 
142
- ui = PlainCLI()
143
- engine = Engine(update_callback=ui.notify_fn)
144
-
145
- match(command):
146
- case Commands.DOWNLOAD:
147
- engine.init_download()
148
- case Commands.UPDATE:
149
- engine.init_update()
150
- case Commands.ASSEMBLE:
151
- engine.init_assemble()
152
- case Commands.RECONFIGURE:
153
- engine.init_reconfigure()
154
- case Commands.BUILD:
155
- engine.init_build()
156
- case Commands.SETUP:
157
- engine.init_setup()
158
- case Commands.START:
159
- engine.init_start()
160
- case _:
161
- Display.print_error("Unknown Command")
162
- sys.exit(255)
144
+ ui = PlainCLI(action)
145
+ loop = asyncio.get_event_loop()
146
+ ui_task = loop.create_task(ui.run())
147
+ try:
148
+ loop.run_until_complete(ui_task)
149
+ except asyncio.CancelledError:
150
+ Display.print_error("Closing")
163
151
 
164
- ui.execute(engine)
165
-
166
152
  def app():
167
153
  try:
168
154
  if os.geteuid() == 0:
@@ -177,7 +163,3 @@ def app():
177
163
 
178
164
  if __name__ == "__main__":
179
165
  app()
180
- """
181
- * shoestring
182
- * bootstrap (maybe for a separate developer focussed tool?)
183
- """
@@ -1,6 +1,10 @@
1
+ import os
2
+ from pathlib import Path
1
3
 
2
- class Contants:
3
- # FILE PATHS
4
+ class Constants:
5
+ INSTALLED_SOLUTIONS_LIST = Path(os.getenv("HOME"))/".local/share/shoestring/installed.json"
6
+
7
+ # SOLUTION FILE PATHS (relative to solution root)
4
8
  SOLUTION_FILES_DIR = "solution_files"
5
9
  MODULE_SOURCE_FILES_DIR = f"{SOLUTION_FILES_DIR}/sources"
6
10
  SOLUTION_CONFIG_DIR = f"{SOLUTION_FILES_DIR}/config"
@@ -9,7 +13,6 @@ class Contants:
9
13
  DATA_DIR = "data"
10
14
  USER_CONFIG_DIR = "user_config"
11
15
 
12
-
13
16
  TEMPLATE_MANAGEMENT_SUBDIR = "__templating"
14
17
  VERSION_FILE_NAME = "__version__"
15
18
  DEFAULTS_FILE_NAME = "defaults.json"
@@ -18,11 +21,10 @@ class Contants:
18
21
 
19
22
  DOCKER_NETWORK_NAME = "internal"
20
23
 
21
-
22
24
  META_FILE_NAME = "meta.toml"
23
25
  DOCKER_ALIAS_SUFFIX = ".docker.local"
24
26
 
25
-
26
27
  # TODO
27
28
  DEFAULT_GIT_HOST = ""
28
29
  DEFAULT_GIT_REPO = ""
30
+
@@ -1,24 +1,29 @@
1
1
  from rich.console import Console
2
2
  from rich.panel import Panel
3
+ from rich.text import Text
4
+ from rich.rule import Rule
3
5
 
4
6
  import rich.progress
5
7
  import os
6
8
 
9
+ from shoestring_assembler.interface.events import Update
10
+
7
11
  PREFIX = "[grey58]> [/grey58]"
8
12
 
9
13
 
10
14
  class Display:
11
15
  root_console = Console()
16
+ alt_console = None
12
17
  file_console = Console(
13
18
  record=True, file=open(os.devnull, "wt"), color_system="truecolor", width=100
14
19
  )
15
- log_level = 0
16
- file_log_level = 5
20
+ log_level = Update.LevelOfDetail.ALWAYS
21
+ file_log_level = Update.LevelOfDetail.DEBUG
17
22
 
18
23
  @classmethod
19
- def print_top_header(cls, text, console=None, log_level=0):
20
- cls.__tee_rule(
21
- console, f"[bold cyan]{text}", align="center", log_level=log_level
24
+ def print_top_header(cls, text, console=None, log_level=Update.LevelOfDetail.ALWAYS):
25
+ cls.__tee_print(
26
+ console, Rule(f"[bold cyan]{text}", align="center"), log_level=log_level
22
27
  )
23
28
 
24
29
  @classmethod
@@ -29,16 +34,15 @@ class Display:
29
34
  )
30
35
 
31
36
  @classmethod
32
- def print_complete(cls, text, console=None, log_level=0):
37
+ def print_complete(cls, text, console=None, log_level=Update.LevelOfDetail.ALWAYS):
33
38
  cls.__tee_print(
34
39
  console,
35
- f"{PREFIX}:white_check_mark: {text}",
36
- style="green",
40
+ Text.from_markup(f"{PREFIX}:white_check_mark: {text}", style="green"),
37
41
  log_level=log_level,
38
42
  )
39
43
 
40
44
  @classmethod
41
- def print_notification(cls, text, console=None, log_level=0):
45
+ def print_notification(cls, text, console=None, log_level=Update.LevelOfDetail.ALWAYS):
42
46
  cls.__tee_print(
43
47
  console,
44
48
  Panel(
@@ -51,7 +55,7 @@ class Display:
51
55
  )
52
56
 
53
57
  @classmethod
54
- def print_next_steps(cls, text, console=None, log_level=0):
58
+ def print_next_steps(cls, text, console=None, log_level=Update.LevelOfDetail.ALWAYS):
55
59
  cls.__tee_print(
56
60
  console,
57
61
  Panel(
@@ -64,7 +68,7 @@ class Display:
64
68
  )
65
69
 
66
70
  @classmethod
67
- def print_warning(cls, text, console=None, log_level=0):
71
+ def print_warning(cls, text, console=None, log_level=Update.LevelOfDetail.ALWAYS):
68
72
  cls.__tee_print(
69
73
  console,
70
74
  Panel(
@@ -77,7 +81,7 @@ class Display:
77
81
  )
78
82
 
79
83
  @classmethod
80
- def print_error(cls, text, console=None, log_level=0):
84
+ def print_error(cls, text, console=None, log_level=Update.LevelOfDetail.ALWAYS):
81
85
  cls.__tee_print(
82
86
  console,
83
87
  Panel(
@@ -90,11 +94,11 @@ class Display:
90
94
  )
91
95
 
92
96
  @classmethod
93
- def print_log(cls, text, console=None, log_level=0):
94
- cls.__tee_print(console, f"{PREFIX}{text}",log_level=log_level)
97
+ def print_log(cls, text, console=None, log_level=Update.LevelOfDetail.ALWAYS):
98
+ cls.__tee_print(console, Text.from_markup(f"{PREFIX}{text}"), log_level=log_level)
95
99
 
96
100
  @classmethod
97
- def print_debug(cls, text, console=None, log_level=5):
101
+ def print_debug(cls, text, console=None, log_level=Update.LevelOfDetail.DEBUG):
98
102
  cls.__tee_print(
99
103
  console,
100
104
  Panel(
@@ -107,46 +111,45 @@ class Display:
107
111
  )
108
112
 
109
113
  @classmethod
110
- def open_file(cls, file, *args, log_level=0, description=None, **kwargs):
114
+ def open_file(
115
+ cls, file, *args, log_level=Update.LevelOfDetail.ALWAYS, description=None, **kwargs
116
+ ):
111
117
  if log_level <= cls.file_log_level:
112
118
  cls.file_console.print(f"\[open_file] {file}")
113
119
 
114
120
  if log_level <= cls.log_level:
115
121
  if description:
116
122
  # add prefix and suffix padding
117
- description = f'{PREFIX}{description}'.ljust(30, " ")
123
+ description = f"{PREFIX}{description}".ljust(30, " ")
118
124
  return rich.progress.open(file, *args, description=description, **kwargs)
119
125
  else:
120
- return open(file ,* args, **kwargs)
126
+ return open(file, *args, **kwargs)
121
127
 
122
128
  @classmethod
123
- def __tee_print(cls, console, *args, log_level=0, **kwargs):
129
+ def __tee_print(cls, console, *args, log_level=Update.LevelOfDetail.ALWAYS, **kwargs):
124
130
  console = cls.__get_console(console)
125
131
  if log_level <= cls.log_level:
126
132
  console.print(*args, **kwargs)
127
133
  if log_level <= cls.file_log_level:
128
134
  cls.file_console.print(*args, **kwargs)
129
135
 
130
- @classmethod
131
- def __tee_rule(cls, console, *args, log_level=0, **kwargs):
132
- console = cls.__get_console(console)
133
- if log_level <= cls.log_level:
134
- console.rule(*args, **kwargs)
135
- if log_level <= cls.file_log_level:
136
- cls.file_console.rule(*args, **kwargs)
137
-
138
136
  @classmethod
139
137
  def __get_console(cls, console):
140
138
  if console:
141
139
  return console
142
140
  else:
143
- return cls.root_console
141
+ if cls.alt_console:
142
+ return cls.alt_console
143
+ else:
144
+ return cls.root_console
144
145
 
145
146
  @classmethod
146
147
  def finalise_log(cls):
147
148
  cls.file_console.save_html("./console_log.html")
148
149
 
149
- from rich.prompt import PromptBase
150
+
151
+ from rich.prompt import PromptBase,Confirm
152
+
150
153
 
151
154
  # Options are presented using 1 index
152
155
  class OptionPrompt(PromptBase):
@@ -158,8 +161,11 @@ class OptionPrompt(PromptBase):
158
161
  def __init__(self, *args, choices=[], **kwargs):
159
162
  self.choices_list = choices
160
163
  choice_prompts = [str(i) for i in range(1, len(choices) + 1)]
161
- super().__init__(*args, choices=choice_prompts, **kwargs)
164
+ super().__init__(*args, choices=choice_prompts, console=Display.root_console, **kwargs)
162
165
 
163
166
  def pre_prompt(self):
164
167
  for index, choice in enumerate(self.choices_list):
165
- Display.print_log(f"{index+1} - {choice}")
168
+ Display.print_log(f"[magenta]({index+1})[/magenta] - {choice}")
169
+
170
+ class TailoredConfirm(Confirm):
171
+ pass