xmipp3-installer 1.0.0__py3-none-any.whl → 1.1.0__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.
Files changed (60) hide show
  1. xmipp3_installer/__main__.py +1 -1
  2. xmipp3_installer/api_client/api_client.py +35 -34
  3. xmipp3_installer/api_client/assembler/installation_info_assembler.py +140 -145
  4. xmipp3_installer/application/cli/arguments/__init__.py +3 -2
  5. xmipp3_installer/application/cli/arguments/modes.py +112 -95
  6. xmipp3_installer/application/cli/arguments/params.py +63 -53
  7. xmipp3_installer/application/cli/cli.py +171 -190
  8. xmipp3_installer/application/cli/parsers/base_help_formatter.py +256 -235
  9. xmipp3_installer/application/cli/parsers/error_handler_parser.py +53 -53
  10. xmipp3_installer/application/cli/parsers/format.py +22 -22
  11. xmipp3_installer/application/cli/parsers/general_help_formatter.py +102 -84
  12. xmipp3_installer/application/cli/parsers/mode_help_formatter.py +144 -105
  13. xmipp3_installer/application/logger/__init__.py +5 -0
  14. xmipp3_installer/application/logger/errors.py +8 -8
  15. xmipp3_installer/application/logger/logger.py +218 -215
  16. xmipp3_installer/application/logger/predefined_messages.py +42 -35
  17. xmipp3_installer/application/user_interactions.py +6 -0
  18. xmipp3_installer/installer/constants/paths.py +6 -1
  19. xmipp3_installer/installer/handlers/cmake/cmake_handler.py +49 -53
  20. xmipp3_installer/installer/handlers/conda_handler.py +6 -6
  21. xmipp3_installer/installer/handlers/generic_package_handler.py +9 -9
  22. xmipp3_installer/installer/handlers/git_handler.py +152 -153
  23. xmipp3_installer/installer/handlers/shell_handler.py +87 -88
  24. xmipp3_installer/installer/handlers/versions_manager.py +20 -6
  25. xmipp3_installer/installer/installer_service.py +22 -8
  26. xmipp3_installer/installer/modes/mode_all_executor.py +61 -51
  27. xmipp3_installer/installer/modes/mode_clean/mode_clean_all_executor.py +44 -36
  28. xmipp3_installer/installer/modes/mode_clean/mode_clean_bin_executor.py +84 -74
  29. xmipp3_installer/installer/modes/mode_clean/mode_clean_executor.py +48 -34
  30. xmipp3_installer/installer/modes/mode_cmake/mode_cmake_executor.py +60 -47
  31. xmipp3_installer/installer/modes/mode_cmake/mode_compile_and_install_executor.py +52 -39
  32. xmipp3_installer/installer/modes/mode_cmake/mode_config_build_executor.py +68 -49
  33. xmipp3_installer/installer/modes/mode_config_executor.py +44 -33
  34. xmipp3_installer/installer/modes/mode_executor.py +14 -13
  35. xmipp3_installer/installer/modes/mode_get_sources_executor.py +121 -112
  36. xmipp3_installer/installer/modes/mode_git_executor.py +43 -31
  37. xmipp3_installer/installer/modes/mode_selector.py +6 -0
  38. xmipp3_installer/installer/modes/mode_sync/mode_add_model_executor.py +97 -83
  39. xmipp3_installer/installer/modes/mode_sync/mode_get_models_executor.py +53 -41
  40. xmipp3_installer/installer/modes/mode_sync/mode_sync_executor.py +41 -35
  41. xmipp3_installer/installer/modes/mode_sync/mode_test_executor.py +144 -77
  42. xmipp3_installer/installer/modes/mode_version_executor.py +161 -150
  43. xmipp3_installer/installer/orquestrator.py +24 -24
  44. xmipp3_installer/installer/urls.py +4 -3
  45. xmipp3_installer/repository/config.py +225 -227
  46. xmipp3_installer/repository/config_vars/__init__.py +5 -0
  47. xmipp3_installer/repository/config_vars/config_values_adapter.py +97 -91
  48. xmipp3_installer/repository/config_vars/default_values.py +24 -24
  49. xmipp3_installer/repository/config_vars/variables.py +9 -9
  50. xmipp3_installer/repository/invalid_config_line.py +17 -0
  51. xmipp3_installer/shared/file_operations.py +14 -12
  52. xmipp3_installer/shared/singleton.py +16 -17
  53. xmipp3_installer-1.1.0.dist-info/METADATA +86 -0
  54. xmipp3_installer-1.1.0.dist-info/RECORD +70 -0
  55. {xmipp3_installer-1.0.0.dist-info → xmipp3_installer-1.1.0.dist-info}/WHEEL +1 -1
  56. xmipp3_installer-1.0.0.dist-info/METADATA +0 -729
  57. xmipp3_installer-1.0.0.dist-info/RECORD +0 -70
  58. {xmipp3_installer-1.0.0.dist-info → xmipp3_installer-1.1.0.dist-info}/entry_points.txt +0 -0
  59. /xmipp3_installer-1.0.0.dist-info/LICENSE → /xmipp3_installer-1.1.0.dist-info/licenses/LICENSE.txt +0 -0
  60. {xmipp3_installer-1.0.0.dist-info → xmipp3_installer-1.1.0.dist-info}/top_level.txt +0 -0
@@ -1,6 +1,5 @@
1
1
  """### Provides a global logger."""
2
2
 
3
- import math
4
3
  import shutil
5
4
  from io import BufferedReader
6
5
 
@@ -9,221 +8,225 @@ from xmipp3_installer.application.logger import errors
9
8
  from xmipp3_installer.installer import urls
10
9
 
11
10
  class Logger(Singleton):
12
- """
13
- ### Logger class for keeping track of installation messages.
14
- """
15
- __UP = "\x1B[1A\r"
16
- __REMOVE_LINE = '\033[K'
17
- __BOLD = "\033[1m"
18
- __BLUE = "\033[34m"
19
- __RED = "\033[91m"
20
- __GREEN = "\033[92m"
21
- __YELLOW = "\033[93m"
22
- __END_FORMAT = "\033[0m"
23
- __FORMATTING_CHARACTERS = [__UP, __REMOVE_LINE, __BOLD, __BLUE, __RED, __GREEN, __YELLOW, __END_FORMAT]
11
+ """### Logger class for keeping track of installation messages."""
12
+
13
+ __UP = "\x1B[1A\r"
14
+ __REMOVE_LINE = '\033[K'
15
+ __BOLD = "\033[1m"
16
+ __BLUE = "\033[34m"
17
+ __RED = "\033[91m"
18
+ __GREEN = "\033[92m"
19
+ __YELLOW = "\033[93m"
20
+ __END_FORMAT = "\033[0m"
21
+ __FORMATTING_CHARACTERS = [__UP, __REMOVE_LINE, __BOLD, __BLUE, __RED, __GREEN, __YELLOW, __END_FORMAT]
24
22
 
25
- def __init__(self):
26
- """
27
- ### Constructor.
28
-
29
- #### Params:
30
- - ouputToConsoloe (bool): Print messages to console.
31
- """
32
- self.__log_file = None
33
- self.__len_last_printed_elem = 0
34
- self.__allow_substitution = True
35
-
36
- def green(self, text: str) -> str:
37
- """
38
- ### This function returns the given text formatted in green color.
39
-
40
- #### Params:
41
- - text (str): Text to format.
42
-
43
- #### Returns:
44
- - (str): Text formatted in green color.
45
- """
46
- return self.__format_text(text, self.__GREEN)
47
-
48
- def yellow(self, text: str) -> str:
49
- """
50
- ### This function returns the given text formatted in yellow color.
51
-
52
- #### Params:
53
- - text (str): Text to format.
54
-
55
- #### Returns:
56
- - (str): Text formatted in yellow color.
57
- """
58
- return self.__format_text(text, self.__YELLOW)
59
-
60
- def red(self, text: str) -> str:
61
- """
62
- ### This function returns the given text formatted in red color.
63
-
64
- #### Params:
65
- - text (str): Text to format.
66
-
67
- #### Returns:
68
- - (str): Text formatted in red color.
69
- """
70
- return self.__format_text(text, self.__RED)
71
-
72
- def blue(self, text: str) -> str:
73
- """
74
- ### This function returns the given text formatted in blue color.
75
-
76
- #### Params:
77
- - text (str): Text to format.
78
-
79
- #### Returns:
80
- - (str): Text formatted in blue color.
81
- """
82
- return self.__format_text(text, self.__BLUE)
83
-
84
- def bold(self, text: str) -> str:
85
- """
86
- ### This function returns the given text formatted in bold.
87
-
88
- #### Params:
89
- - text (str): Text to format.
90
-
91
- #### Returns:
92
- - (str): Text formatted in bold.
93
- """
94
- return self.__format_text(text, self.__BOLD)
95
-
96
- def start_log_file(self, log_path: str):
97
- """
98
- ### Initiates the log file.
99
-
100
- #### Params:
101
- - log_path (str): Path to the log file.
102
- """
103
- if self.__log_file is None:
104
- self.__log_file = open(log_path, 'w')
105
-
106
- def close(self):
107
- """
108
- ### Closes the log file.
109
- """
110
- if self.__log_file:
111
- self.__log_file.close()
112
- self.__log_file = None
113
-
114
- def set_allow_substitution(self, allow_substitution: bool):
115
- """
116
- ### Modifies console output behaviour, allowing or disallowing substitutions.
117
-
118
- #### Params:
119
- - allow_substitution (bool): If False, console outputs won't be substituted.
120
- """
121
- self.__allow_substitution = allow_substitution
122
-
123
- def __call__(self, text: str, show_in_terminal: bool=True, substitute: bool=False):
124
- """
125
- ### Log a message.
126
-
127
- #### Params:
128
- - text (str): Message to be logged. Supports fancy formatting.
129
- - show_in_terminal (bool): Optional. If True, text is also printed through terminal.
130
- - substitute (bool): Optional. If True, previous line is substituted with new text. Only used when show_in_terminal = True.
131
- """
132
- if self.__log_file is not None:
133
- print(self.__remove_non_printable(text), file=self.__log_file, flush=True)
134
-
135
- if show_in_terminal:
136
- text = self.__substitute_lines(text) if self.__allow_substitution and substitute else text
137
- print(text, flush=True)
138
- # Store length of printed string for next substitution calculation
139
- self.__len_last_printed_elem = len(self.__remove_non_printable(text))
140
-
141
- def log_error(self, error_msg: str, ret_code: int=1, add_portal_link: bool=True):
142
- """
143
- ### Prints an error message.
144
-
145
- #### Params:
146
- - error_msg (str): Error message to show.
147
- - ret_code (int): Optional. Return code to end the exection with.
148
- - add_portal_link (bool): If True, a message linking the documentation portal is shown.
149
- """
150
- error = errors.ERROR_CODES.get(ret_code, errors.ERROR_CODES[errors.UNKOW_ERROR])
151
- error_str = error_msg + '\n\n' if error_msg else ''
152
- error_str += f'Error {ret_code}: {error[0]}'
153
- error_str += f"\n{error[1]}" if error[1] else ''
154
- if add_portal_link:
155
- error_str += f'\nMore details on the Xmipp documentation portal: {urls.DOCUMENTATION_URL}'
156
-
157
- self.__call__(self.red(error_str), show_in_terminal=True)
158
-
159
- def log_in_streaming(self, stream: BufferedReader, show_in_terminal: bool=False, substitute: bool=False, err: bool=False):
160
- """
161
- ### Receives a process output stream and logs its lines.
162
-
163
- #### Params:
164
- - stream (BufferedReader): Function to run.
165
- - show_in_terminal (bool): Optional. If True, output will also be printed through terminal.
166
- - substitute (bool): Optional. If True, output will replace previous line. Only used when show is True.
167
- - err (bool): Optional. If True, the stream contains an error. Otherwise, it is regular output.
168
- """
169
- if show_in_terminal and self.__allow_substitution and substitute:
170
- print("")
171
-
172
- for line in iter(stream.readline, b''):
173
- line = line.decode().replace("\n", "")
174
- if err:
175
- line = self.red(line)
176
- self.__call__(line, show_in_terminal=show_in_terminal, substitute=substitute)
177
-
178
- def __remove_non_printable(self, text: str) -> str:
179
- """
180
- ### This function returns the given text without non printable characters.
181
-
182
- #### Params:
183
- - text (str): Text to remove format.
184
-
185
- #### Returns:
186
- - (str): Text without format.
187
- """
188
- for formatting_char in self.__FORMATTING_CHARACTERS:
189
- text = text.replace(formatting_char, "")
190
- return text
191
-
192
- def __get_n_last_lines(self) -> int:
193
- """
194
- ### This function returns the number of lines of the terminal the last print occupied.
195
-
196
- #### Returns:
197
- - (int): Number of lines of the last print.
198
- """
199
- return math.ceil(self.__len_last_printed_elem / shutil.get_terminal_size().columns)
200
-
201
- def __format_text(self, text: str, format_code: str) -> str:
202
- """
203
- ### Returns the given text formatted in the given format code.
204
-
205
- #### Params:
206
- - text (str): Text to format.
207
- - format_code (str): Formatting character.
208
-
209
- #### Returns:
210
- - (str): Text formatted.
211
- """
212
- return f"{format_code}{text}{self.__END_FORMAT}"
213
-
214
- def __substitute_lines(self, text: str) -> str:
215
- """
216
- ### Removes the appropiate lines from the terminal to show a given text.
217
-
218
- #### Params:
219
- - text (str): Text to show substituting some lines.
220
-
221
- #### Returns:
222
- - (str): Text with line substitution characters as a prefix.
223
- """
224
- substitution_chars = [f'{self.__UP}{self.__REMOVE_LINE}' for _ in range(self.__get_n_last_lines())]
225
- return f"{''.join(substitution_chars)}{text}"
226
-
23
+ def __init__(self):
24
+ """
25
+ ### Constructor.
26
+
27
+ #### Params:
28
+ - ouputToConsoloe (bool): Print messages to console.
29
+ """
30
+ self.__log_file = None
31
+ self.__last_printed_elem = None
32
+ self.__allow_substitution = True
33
+
34
+ def green(self, text: str) -> str:
35
+ """
36
+ ### This function returns the given text formatted in green color.
37
+
38
+ #### Params:
39
+ - text (str): Text to format.
40
+
41
+ #### Returns:
42
+ - (str): Text formatted in green color.
43
+ """
44
+ return self.__format_text(text, self.__GREEN)
45
+
46
+ def yellow(self, text: str) -> str:
47
+ """
48
+ ### This function returns the given text formatted in yellow color.
49
+
50
+ #### Params:
51
+ - text (str): Text to format.
52
+
53
+ #### Returns:
54
+ - (str): Text formatted in yellow color.
55
+ """
56
+ return self.__format_text(text, self.__YELLOW)
57
+
58
+ def red(self, text: str) -> str:
59
+ """
60
+ ### This function returns the given text formatted in red color.
61
+
62
+ #### Params:
63
+ - text (str): Text to format.
64
+
65
+ #### Returns:
66
+ - (str): Text formatted in red color.
67
+ """
68
+ return self.__format_text(text, self.__RED)
69
+
70
+ def blue(self, text: str) -> str:
71
+ """
72
+ ### This function returns the given text formatted in blue color.
73
+
74
+ #### Params:
75
+ - text (str): Text to format.
76
+
77
+ #### Returns:
78
+ - (str): Text formatted in blue color.
79
+ """
80
+ return self.__format_text(text, self.__BLUE)
81
+
82
+ def bold(self, text: str) -> str:
83
+ """
84
+ ### This function returns the given text formatted in bold.
85
+
86
+ #### Params:
87
+ - text (str): Text to format.
88
+
89
+ #### Returns:
90
+ - (str): Text formatted in bold.
91
+ """
92
+ return self.__format_text(text, self.__BOLD)
93
+
94
+ def start_log_file(self, log_path: str):
95
+ """
96
+ ### Initiates the log file.
97
+
98
+ #### Params:
99
+ - log_path (str): Path to the log file.
100
+ """
101
+ if self.__log_file is None:
102
+ self.__log_file = open(log_path, 'w', encoding="utf-8")
103
+
104
+ def close(self):
105
+ """### Closes the log file."""
106
+ if self.__log_file:
107
+ self.__log_file.close()
108
+ self.__log_file = None
109
+
110
+ def set_allow_substitution(self, allow_substitution: bool):
111
+ """
112
+ ### Modifies console output behaviour, allowing or disallowing substitutions.
113
+
114
+ #### Params:
115
+ - allow_substitution (bool): If False, console outputs won't be substituted.
116
+ """
117
+ self.__allow_substitution = allow_substitution
118
+
119
+ def __call__(self, text: str, show_in_terminal: bool=True, substitute: bool=False):
120
+ """
121
+ ### Log a message.
122
+
123
+ #### Params:
124
+ - text (str): Message to be logged. Supports fancy formatting.
125
+ - show_in_terminal (bool): Optional. If True, text is also printed through terminal.
126
+ - substitute (bool): Optional. If True, previous line is substituted with new text. Only used when show_in_terminal = True.
127
+ """
128
+ if self.__log_file is not None:
129
+ print(self.__remove_non_printable(text), file=self.__log_file, flush=True)
130
+
131
+ if show_in_terminal:
132
+ text = self.__substitute_lines(text) if self.__allow_substitution and substitute else text
133
+ print(text, flush=True)
134
+
135
+ # Store printed string for next substitution calculation
136
+ self.__last_printed_elem = self.__remove_non_printable(text) if self.__allow_substitution and substitute else None
137
+
138
+ def log_error(self, error_msg: str, ret_code: int=1, add_portal_link: bool=True):
139
+ """
140
+ ### Prints an error message.
141
+
142
+ #### Params:
143
+ - error_msg (str): Error message to show.
144
+ - ret_code (int): Optional. Return code to end the exection with.
145
+ - add_portal_link (bool): If True, a message linking the documentation portal is shown.
146
+ """
147
+ error = errors.ERROR_CODES.get(ret_code, errors.ERROR_CODES[errors.UNKOW_ERROR])
148
+ error_str = error_msg + '\n\n' if error_msg else ''
149
+ error_str += f'Error {ret_code}: {error[0]}'
150
+ error_str += f"\n{error[1]}" if error[1] else ''
151
+ if add_portal_link:
152
+ error_str += f'\nMore details on the Xmipp documentation portal: {urls.DOCUMENTATION_URL}'
153
+
154
+ self.__call__(self.red(error_str), show_in_terminal=True)
155
+
156
+ def log_in_streaming(self, stream: BufferedReader, show_in_terminal: bool=False, substitute: bool=False, err: bool=False):
157
+ """
158
+ ### Receives a process output stream and logs its lines.
159
+
160
+ #### Params:
161
+ - stream (BufferedReader): Function to run.
162
+ - show_in_terminal (bool): Optional. If True, output will also be printed through terminal.
163
+ - substitute (bool): Optional. If True, output will replace previous line. Only used when show is True.
164
+ - err (bool): Optional. If True, the stream contains an error. Otherwise, it is regular output.
165
+ """
166
+ for line in iter(stream.readline, b''):
167
+ calling_line = line.decode().replace("\n", "")
168
+ if err:
169
+ calling_line = self.red(calling_line)
170
+ self.__call__(calling_line, show_in_terminal=show_in_terminal, substitute=substitute)
171
+
172
+ def __remove_non_printable(self, text: str) -> str:
173
+ """
174
+ ### This function returns the given text without non printable characters.
175
+
176
+ #### Params:
177
+ - text (str): Text to remove format.
178
+
179
+ #### Returns:
180
+ - (str): Text without format.
181
+ """
182
+ for formatting_char in self.__FORMATTING_CHARACTERS:
183
+ text = text.replace(formatting_char, "")
184
+ return text
185
+
186
+ def __get_n_last_lines(self) -> int:
187
+ """
188
+ ### This function returns the number of lines of the terminal the last print occupied.
189
+
190
+ #### Returns:
191
+ - (int): Number of lines of the last print.
192
+ """
193
+ if self.__last_printed_elem is None:
194
+ return 0
195
+
196
+ terminal_width = shutil.get_terminal_size().columns
197
+ # At least one line break exists, as prints end with line break
198
+ n_line_breaks = self.__last_printed_elem.count("\n") + 1
199
+ text_lines = self.__last_printed_elem.split("\n")
200
+ for line in text_lines:
201
+ n_line_breaks += int(len(line) / (terminal_width + 1)) # Equal does not count, it needs to exceed
202
+ return n_line_breaks
203
+
204
+ def __format_text(self, text: str, format_code: str) -> str:
205
+ """
206
+ ### Returns the given text formatted in the given format code.
207
+
208
+ #### Params:
209
+ - text (str): Text to format.
210
+ - format_code (str): Formatting character.
211
+
212
+ #### Returns:
213
+ - (str): Text formatted.
214
+ """
215
+ return f"{format_code}{text}{self.__END_FORMAT}"
216
+
217
+ def __substitute_lines(self, text: str) -> str:
218
+ """
219
+ ### Removes the appropiate lines from the terminal to show a given text.
220
+
221
+ #### Params:
222
+ - text (str): Text to show substituting some lines.
223
+
224
+ #### Returns:
225
+ - (str): Text with line substitution characters as a prefix.
226
+ """
227
+ substitution_chars = [f'{self.__UP}{self.__REMOVE_LINE}' for _ in range(self.__get_n_last_lines())]
228
+ return f"{''.join(substitution_chars)}{text}"
229
+
227
230
  """
228
231
  ### Global logger.
229
232
  """
@@ -1,3 +1,9 @@
1
+ """
2
+ ### Predefined Messages Module.
3
+
4
+ This module contains functions to generate standard log messages.
5
+ """
6
+
1
7
  from xmipp3_installer.application.logger.logger import logger
2
8
  from xmipp3_installer.installer.handlers import git_handler
3
9
 
@@ -22,45 +28,46 @@ def get_working_message() -> str:
22
28
  return logger.yellow("Working...")
23
29
 
24
30
  def get_section_message(text: str) -> str:
25
- """
26
- ### Returns the given text as a section header.
31
+ """
32
+ ### Returns the given text as a section header.
27
33
 
28
- #### Params:
29
- - text (str): Title of the section.
34
+ #### Params:
35
+ - text (str): Title of the section.
30
36
 
31
- #### Returns:
32
- - (str): Formatted section header.
33
- """
34
- text_len = len(text)
35
- remaining_len = __SECTION_MESSAGE_LEN - text_len
36
- if remaining_len < 4:
37
- return text
38
-
39
- n_dashes = remaining_len - 2
40
- n_final_dashes = int(n_dashes / 2)
41
- n_initial_dashes = n_dashes - n_final_dashes
42
- final_dashes = ''.join(['-' for _ in range(n_final_dashes)])
43
- initial_dashes = ''.join(['-' for _ in range(n_initial_dashes)])
44
- return f"{initial_dashes} {text} {final_dashes}"
37
+ #### Returns:
38
+ - (str): Formatted section header.
39
+ """
40
+ minimum_remaining_len = len("- -")
41
+ text_len = len(text)
42
+ remaining_len = __SECTION_MESSAGE_LEN - text_len
43
+ if remaining_len < minimum_remaining_len:
44
+ return text
45
+
46
+ n_dashes = remaining_len - 2
47
+ n_final_dashes = int(n_dashes / 2)
48
+ n_initial_dashes = n_dashes - n_final_dashes
49
+ final_dashes = ''.join(['-' for _ in range(n_final_dashes)])
50
+ initial_dashes = ''.join(['-' for _ in range(n_initial_dashes)])
51
+ return f"{initial_dashes} {text} {final_dashes}"
45
52
 
46
53
  def get_success_message(tag_version: str) -> str:
47
- """
48
- ### Returns the message shown when Xmipp is compiled successfully.
54
+ """
55
+ ### Returns the message shown when Xmipp is compiled successfully.
49
56
 
50
- #### Params:
51
- - tag_version (str): Version number of the latest release.
52
-
53
- #### Returms:
54
- - (str): Success message.
55
- """
56
- release_name = tag_version if git_handler.is_tag() else git_handler.get_current_branch()
57
+ #### Params:
58
+ - tag_version (str): Version number of the latest release.
59
+
60
+ #### Returms:
61
+ - (str): Success message.
62
+ """
63
+ release_name = tag_version if git_handler.is_tag() else git_handler.get_current_branch()
57
64
 
58
- box_wrapper = '* *'
59
- half_len_box_wrapper = int(len(box_wrapper) / 2)
60
- release_message = f'Xmipp {release_name} has been successfully installed, enjoy it!'
61
- total_len = len(release_message) + len(box_wrapper)
62
- release_message = f'{box_wrapper[:half_len_box_wrapper]}{logger.green(release_message)}{box_wrapper[half_len_box_wrapper:]}'
63
- margin_line = f"*{' ' * (total_len - 2)}*"
64
- box_border = '*' * total_len
65
+ box_wrapper = '* *'
66
+ half_len_box_wrapper = int(len(box_wrapper) / 2)
67
+ release_message = f'Xmipp {release_name} has been successfully installed, enjoy it!'
68
+ total_len = len(release_message) + len(box_wrapper)
69
+ release_message = f'{box_wrapper[:half_len_box_wrapper]}{logger.green(release_message)}{box_wrapper[half_len_box_wrapper:]}'
70
+ margin_line = f"*{' ' * (total_len - 2)}*"
71
+ box_border = '*' * total_len
65
72
 
66
- return '\n'.join(["", box_border, margin_line, release_message, margin_line, box_border])
73
+ return '\n'.join(["", box_border, margin_line, release_message, margin_line, box_border])
@@ -1,3 +1,9 @@
1
+ """
2
+ ### User Interactions Module.
3
+
4
+ This module contains functions to handle user interactions.
5
+ """
6
+
1
7
  def get_user_confirmation(confirmation_text: str, case_sensitive: bool=True) -> bool:
2
8
  """
3
9
  ### Receives confirmation from user input.
@@ -1,3 +1,9 @@
1
+ """
2
+ ### Paths Module.
3
+
4
+ This module defines various paths used throughout the application.
5
+ """
6
+
1
7
  import os
2
8
 
3
9
  from xmipp3_installer.installer import constants
@@ -7,7 +13,6 @@ SOURCES_PATH = "src"
7
13
  BUILD_PATH = "build"
8
14
  INSTALL_PATH = "dist"
9
15
  BINARIES_PATH = os.path.join(INSTALL_PATH, "bin")
10
- #CMAKE_CACHE_PATH = os.path.join(BUILD_PATH, 'CMakeCache.txt')
11
16
  SCIPION_SOFTWARE_EM = os.path.join("scipionfiles", "downloads", "scipion", "software", "em")
12
17
 
13
18
  # General file paths