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
@@ -10,105 +10,104 @@ from xmipp3_installer.application.logger.logger import logger
10
10
  from xmipp3_installer.application.logger import errors
11
11
 
12
12
  def run_shell_command(
13
- cmd: str,
14
- cwd: str='./',
15
- show_command: bool=False,
16
- show_output: bool=False,
17
- show_error: bool=False,
18
- substitute: bool=False
13
+ cmd: str,
14
+ *,
15
+ cwd: str='./',
16
+ show_command: bool=False,
17
+ show_output: bool=False,
18
+ show_error: bool=False
19
19
  ) -> Tuple[int, str]:
20
- """
21
- ### This function runs the given command.
20
+ """
21
+ ### This function runs the given command.
22
22
 
23
- #### Params:
24
- - cmd (str): Command to run.
25
- - cwd (str): Optional. Path to run the command from. Default is current directory.
26
- - show_output (bool): Optional. If True, output is printed.
27
- - show_error (bool): Optional. If True, errors are printed.
28
- - show_command (bool): Optional. If True, command is printed in blue.
29
- - substitute (bool): Optional. If True, output will replace previous line.
23
+ #### Params:
24
+ - cmd (str): Command to run.
25
+ - cwd (str): Optional. Path to run the command from. Default is current directory.
26
+ - show_output (bool): Optional. If True, output is printed.
27
+ - show_error (bool): Optional. If True, errors are printed.
28
+ - show_command (bool): Optional. If True, command is printed in blue.
30
29
 
31
- #### Returns:
32
- - (int): Return code.
33
- - (str): Output of the command, regardless of if it is an error or regular output.
34
- """
35
- if show_command:
36
- logger(logger.blue(cmd), substitute=substitute)
37
- ret_code, output_str = __run_command(cmd, cwd=cwd)
30
+ #### Returns:
31
+ - (int): Return code.
32
+ - (str): Output of the command, regardless of if it is an error or regular output.
33
+ """
34
+ if show_command:
35
+ logger(logger.blue(cmd))
36
+ ret_code, output_str = __run_command(cmd, cwd=cwd)
38
37
 
39
- if not ret_code and show_output:
40
- logger(output_str, substitute=substitute)
41
-
42
- if ret_code and show_error:
43
- logger.log_error(output_str, ret_code=ret_code)
44
-
45
- return ret_code, output_str
38
+ if not ret_code and show_output:
39
+ logger(output_str)
40
+
41
+ if ret_code and show_error:
42
+ logger(logger.red(output_str))
43
+
44
+ return ret_code, output_str
46
45
 
47
46
  def run_shell_command_in_streaming(
48
- cmd: str,
49
- cwd: str='./',
50
- show_output: bool=False,
51
- show_error: bool=False,
52
- substitute: bool=False
47
+ cmd: str,
48
+ cwd: str='./',
49
+ show_output: bool=False,
50
+ show_error: bool=False,
51
+ substitute: bool=False
53
52
  ) -> int:
54
- """
55
- ### Runs the given command and shows its output as it is being generated.
53
+ """
54
+ ### Runs the given command and shows its output as it is being generated.
56
55
 
57
- #### Params:
58
- - cmd (str): Command to run.
59
- - cwd (str): Optional. Path to run the command from. Default is current directory.
60
- - show_output (bool): Optional. If True, output is printed.
61
- - show_error (bool): Optional. If True, errors are printed.
62
- - substitute (bool): Optional. If True, output will replace previous line.
56
+ #### Params:
57
+ - cmd (str): Command to run.
58
+ - cwd (str): Optional. Path to run the command from. Default is current directory.
59
+ - show_output (bool): Optional. If True, output is printed.
60
+ - show_error (bool): Optional. If True, errors are printed.
61
+ - substitute (bool): Optional. If True, output will replace previous line.
63
62
 
64
- #### Returns:
65
- - (int): Return code.
66
- """
67
- logger(cmd)
68
- process = subprocess.Popen(cmd, cwd=cwd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
69
-
70
- thread_out = threading.Thread(
71
- target=logger.log_in_streaming,
72
- args=(process.stdout,),
73
- kwargs={"show_in_terminal": show_output, "substitute": substitute, "err": False}
74
- )
75
- thread_err = threading.Thread(
76
- target=logger.log_in_streaming,
77
- args=(process.stderr,),
78
- kwargs={"show_in_terminal": show_error, "substitute": substitute, "err": True}
79
- )
80
- thread_out.start()
81
- thread_err.start()
63
+ #### Returns:
64
+ - (int): Return code.
65
+ """
66
+ logger(cmd, substitute=substitute)
67
+ process = subprocess.Popen(cmd, cwd=cwd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
68
+
69
+ thread_out = threading.Thread(
70
+ target=logger.log_in_streaming,
71
+ args=(process.stdout,),
72
+ kwargs={"show_in_terminal": show_output, "substitute": substitute, "err": False}
73
+ )
74
+ thread_err = threading.Thread(
75
+ target=logger.log_in_streaming,
76
+ args=(process.stderr,),
77
+ kwargs={"show_in_terminal": show_error, "substitute": substitute, "err": True}
78
+ )
79
+ thread_out.start()
80
+ thread_err.start()
82
81
 
83
- try:
84
- process.wait()
85
- thread_out.join()
86
- thread_err.join()
87
- except KeyboardInterrupt:
88
- process.returncode = errors.INTERRUPTED_ERROR
89
-
90
- return process.returncode
82
+ try:
83
+ process.wait()
84
+ thread_out.join()
85
+ thread_err.join()
86
+ except KeyboardInterrupt:
87
+ process.returncode = errors.INTERRUPTED_ERROR
88
+
89
+ return process.returncode
91
90
 
92
91
  def __run_command(cmd: str, cwd: str='./') -> Tuple[int, str]:
93
- """
94
- ### Runs the given shell command.
92
+ """
93
+ ### Runs the given shell command.
95
94
 
96
- #### Params:
97
- - cmd (str): Command to run.
98
- - cwd (str): Optional. Path to run the command from.
95
+ #### Params:
96
+ - cmd (str): Command to run.
97
+ - cwd (str): Optional. Path to run the command from.
99
98
 
100
- #### Returns:
101
- - (int): Return code of the operation.
102
- - (str): Return message of the operation.
103
- """
104
- process = subprocess.Popen(cmd, cwd=cwd, env=os.environ, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
105
- try:
106
- process.wait()
107
- except KeyboardInterrupt:
108
- return errors.INTERRUPTED_ERROR, ""
109
-
110
- ret_code = process.returncode
111
- output, err = process.communicate()
112
- output_str = output.decode() if not ret_code and output else err.decode()
113
- output_str = output_str[:-1] if output_str.endswith('\n') else output_str
114
- return ret_code, output_str
99
+ #### Returns:
100
+ - (int): Return code of the operation.
101
+ - (str): Return message of the operation.
102
+ """
103
+ process = subprocess.Popen(cmd, cwd=cwd, env=os.environ, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
104
+ try:
105
+ process.wait()
106
+ except KeyboardInterrupt:
107
+ return errors.INTERRUPTED_ERROR, ""
108
+
109
+ ret_code = process.returncode
110
+ output, err = process.communicate()
111
+ output_str = output.decode() if not ret_code and output else err.decode()
112
+ output_str = output_str[:-1] if output_str.endswith('\n') else output_str
113
+ return ret_code, output_str
@@ -1,3 +1,9 @@
1
+ """
2
+ ### Versions Manager Module.
3
+
4
+ This module contains the class to manage version information.
5
+ """
6
+
1
7
  import json
2
8
  from datetime import datetime
3
9
  from typing import Dict, List
@@ -6,6 +12,12 @@ from xmipp3_installer.installer import constants
6
12
  from xmipp3_installer.shared import singleton
7
13
 
8
14
  class VersionsManager(singleton.Singleton):
15
+ """
16
+ ### Versions Manager.
17
+
18
+ Manages version information by reading and validating version data from a JSON file.
19
+ """
20
+
9
21
  def __init__(self, version_file_path: str):
10
22
  """
11
23
  ### Constructor.
@@ -27,14 +39,14 @@ class VersionsManager(singleton.Singleton):
27
39
  self.sources_versions = version_info["sources_target_tag"]
28
40
  self.__validate_fields()
29
41
 
30
- def __get_version_info(self) -> Dict[str, str]:
42
+ def __get_version_info(self) -> Dict[str, Dict[str, str]]:
31
43
  """
32
44
  ### Retrieves the version info from the version information JSON file.
33
45
 
34
46
  #### Returns:
35
- - (dict(str, str)): Dictionary containing the parsed values.
47
+ - (dict(str, dict(str, str))): Dictionary containing the parsed values.
36
48
  """
37
- with open(self.version_file_path) as json_data:
49
+ with open(self.version_file_path, encoding="utf-8") as json_data:
38
50
  version_info = json.load(json_data)
39
51
  return version_info
40
52
 
@@ -62,12 +74,13 @@ class VersionsManager(singleton.Singleton):
62
74
  - ValueError: If any version number doesn't follow the required format.
63
75
  """
64
76
  parts = self.xmipp_version_number.split('.')
65
- if not self.__is_valid_semver(parts):
77
+ if not VersionsManager.__is_valid_semver(parts):
66
78
  raise ValueError(
67
79
  f"Version number '{self.xmipp_version_number}' is invalid. Must be three numbers separated by dots (x.y.z)."
68
80
  )
69
81
 
70
- def __is_valid_semver(self, version_parts: List[str]) -> bool:
82
+ @staticmethod
83
+ def __is_valid_semver(version_parts: List[str]) -> bool:
71
84
  """
72
85
  ### Checks if version parts constitute a valid semantic version.
73
86
 
@@ -77,7 +90,8 @@ class VersionsManager(singleton.Singleton):
77
90
  #### Returns:
78
91
  - (bool): True if version follows semver format, False otherwise.
79
92
  """
80
- return len(version_parts) == 3 and all(part.isdigit() for part in version_parts)
93
+ SEMVER_N_NUMBERS = 3 # 3 numbers separated by dots: X.Y.Z
94
+ return len(version_parts) == SEMVER_N_NUMBERS and all(part.isdigit() for part in version_parts)
81
95
 
82
96
  def __validate_release_date(self):
83
97
  """
@@ -1,4 +1,10 @@
1
- from typing import Dict
1
+ """
2
+ ### Installer Service Module.
3
+
4
+ This module contains the class to manage the installation process.
5
+ """
6
+
7
+ from typing import Dict, cast
2
8
 
3
9
  from xmipp3_installer.api_client import api_client
4
10
  from xmipp3_installer.api_client.assembler import installation_info_assembler
@@ -15,13 +21,19 @@ from xmipp3_installer.repository import config
15
21
  from xmipp3_installer.repository.config_vars import variables
16
22
 
17
23
  class InstallationManager:
24
+ """
25
+ ### Installation Manager.
26
+
27
+ Manages the installation process by executing the appropriate mode based on the given arguments.
28
+ """
29
+
18
30
  def __init__(self, args: Dict):
19
31
  """
20
- ### Constructor.
32
+ ### Constructor.
21
33
 
22
- #### Params:
23
- - args (dict): Dictionary containing all parsed command-line arguments.
24
- """
34
+ #### Params:
35
+ - args (dict): Dictionary containing all parsed command-line arguments.
36
+ """
25
37
  self.mode = args.pop(modes.MODE, modes.MODE_ALL)
26
38
  config_handler = config.ConfigurationFileHandler(path=paths.CONFIG_FILE, show_errors=False)
27
39
  self.context = {
@@ -50,7 +62,7 @@ class InstallationManager:
50
62
  self.mode_executor.sends_installation_info and
51
63
  self.context[variables.SEND_INSTALLATION_STATISTICS]
52
64
  ):
53
- logger("Sending anonymous installation info...")
65
+ logger("Sending anonymous installation info...", show_in_terminal=False)
54
66
  api_client.send_installation_attempt(
55
67
  installation_info_assembler.get_installation_info(
56
68
  self.context[constants.VERSIONS_CONTEXT_KEY],
@@ -59,8 +71,10 @@ class InstallationManager:
59
71
  )
60
72
  if not ret_code and self.mode_executor.prints_banner_on_exit:
61
73
  logger(predefined_messages.get_success_message(
62
- self.context[constants.VERSIONS_CONTEXT_KEY].xmipp_version_number
74
+ cast(
75
+ versions_manager.VersionsManager,
76
+ self.context[constants.VERSIONS_CONTEXT_KEY]
77
+ ).xmipp_version_number
63
78
  ))
64
79
  logger.close()
65
80
  return ret_code
66
-
@@ -1,63 +1,73 @@
1
+ """
2
+ ### Mode All Executor Module.
3
+
4
+ This module contains the class to run the whole installation process.
5
+ """
6
+
1
7
  from typing import Tuple, Dict
2
8
 
3
9
  from xmipp3_installer.application.cli.arguments import params
4
10
  from xmipp3_installer.application.logger.logger import logger
5
11
  from xmipp3_installer.installer.modes import (
6
- mode_executor, mode_config_executor, mode_get_sources_executor
12
+ mode_executor, mode_config_executor, mode_get_sources_executor
7
13
  )
8
14
  from xmipp3_installer.installer.modes.mode_cmake import (
9
- mode_config_build_executor, mode_compile_and_install_executor
15
+ mode_config_build_executor, mode_compile_and_install_executor
10
16
  )
11
17
 
12
18
  class ModeAllExecutor(mode_executor.ModeExecutor):
13
- def __init__(self, context: Dict):
14
- """
15
- ### Constructor.
16
-
17
- #### Params:
18
- - context (dict): Dictionary containing the installation context variables.
19
- """
20
- config_executor = mode_config_executor.ModeConfigExecutor(
21
- {**context, params.PARAM_OVERWRITE: False}
22
- )
23
- get_sources_executor = mode_get_sources_executor.ModeGetSourcesExecutor(
24
- context
25
- )
26
- config_build_executor = mode_config_build_executor.ModeConfigBuildExecutor(
27
- context
19
+ """
20
+ ### Mode All Executor.
21
+
22
+ Runs the whole installation process with the appropriate parameters.
23
+ """
24
+
25
+ def __init__(self, context: Dict):
26
+ """
27
+ ### Constructor.
28
+
29
+ #### Params:
30
+ - context (dict): Dictionary containing the installation context variables.
31
+ """
32
+ config_executor = mode_config_executor.ModeConfigExecutor(
33
+ {**context, params.PARAM_OVERWRITE: False}
34
+ )
35
+ get_sources_executor = mode_get_sources_executor.ModeGetSourcesExecutor(
36
+ context
28
37
  )
29
- compile_and_install_executor = mode_compile_and_install_executor.ModeCompileAndInstallExecutor(
30
- {**context, params.PARAM_BRANCH: None}
38
+ config_build_executor = mode_config_build_executor.ModeConfigBuildExecutor(
39
+ context
31
40
  )
32
- self.executors = [
33
- config_executor,
34
- get_sources_executor,
35
- config_build_executor,
36
- compile_and_install_executor
37
- ]
38
- super().__init__(context)
39
-
40
- def _set_executor_config(self):
41
- """
42
- ### Sets the specific executor params for this mode.
43
- """
44
- super()._set_executor_config()
45
- self.logs_to_file = True
46
- self.prints_with_substitution = True
47
- self.prints_banner_on_exit = True
48
- self.sends_installation_info = True
49
-
50
- def run(self) -> Tuple[int, str]:
51
- """
52
- ### Runs the whole installation process with the appropiate params.
53
-
54
- #### Returns:
55
- - (tuple(int, str)): Tuple containing the error status and an error message if there was an error.
56
- """
57
- for executor_index in range(len(self.executors)):
58
- if executor_index != 0:
59
- logger("")
60
- ret_code, output = self.executors[executor_index].run()
61
- if ret_code:
62
- return ret_code, output
63
- return 0, ""
41
+ compile_and_install_executor = mode_compile_and_install_executor.ModeCompileAndInstallExecutor(
42
+ context
43
+ )
44
+ self.executors = [
45
+ config_executor,
46
+ get_sources_executor,
47
+ config_build_executor,
48
+ compile_and_install_executor
49
+ ]
50
+ super().__init__(context)
51
+
52
+ def _set_executor_config(self):
53
+ """### Sets the specific executor params for this mode."""
54
+ super()._set_executor_config()
55
+ self.logs_to_file = True
56
+ self.prints_with_substitution = True
57
+ self.prints_banner_on_exit = True
58
+ self.sends_installation_info = True
59
+
60
+ def run(self) -> Tuple[int, str]:
61
+ """
62
+ ### Runs the whole installation process with the appropiate params.
63
+
64
+ #### Returns:
65
+ - (tuple(int, str)): Tuple containing the error status and an error message if there was an error.
66
+ """
67
+ for executor_index in range(len(self.executors)):
68
+ if executor_index != 0:
69
+ logger("")
70
+ ret_code, output = self.executors[executor_index].run()
71
+ if ret_code:
72
+ return ret_code, output
73
+ return 0, ""
@@ -1,3 +1,9 @@
1
+ """
2
+ ### Mode Clean All Executor Module.
3
+
4
+ This module contains the class to clean all content from source and build directories.
5
+ """
6
+
1
7
  from typing import List
2
8
 
3
9
  from xmipp3_installer.application.logger.logger import logger
@@ -6,39 +12,41 @@ from xmipp3_installer.installer.constants import paths
6
12
  from xmipp3_installer.installer.modes.mode_clean import mode_clean_executor
7
13
 
8
14
  class ModeCleanAllExecutor(mode_clean_executor.ModeCleanExecutor):
9
- def _get_paths_to_delete(self) -> List[str]:
10
- """
11
- ### Returns a list of all the paths to be deleted.
12
-
13
- #### Returns:
14
- - (list(str)): List containing all the paths to delete.
15
- """
16
- return [
17
- *[paths.get_source_path(source) for source in constants.XMIPP_SOURCES],
18
- paths.INSTALL_PATH,
19
- paths.BUILD_PATH,
20
- paths.CONFIG_FILE
21
- ]
22
-
23
- def _get_confirmation_keyword(self) -> str:
24
- """
25
- ### Returns the keyword needed to be introduced by the user to confirm an operation.
26
-
27
- #### Returns:
28
- - (str): Confirmation keyword.
29
- """
30
- return "YeS"
31
-
32
- def _get_confirmation_message(self) -> str:
33
- """
34
- ### Returns message to be printed when asking for user confirmation.
35
-
36
- #### Returns:
37
- - (str): Confirmation message.
38
- """
39
- return '\n'.join([
40
- logger.yellow("WARNING: This will DELETE ALL content from src and build, and also the xmipp.conf file."),
41
- logger.yellow("\tNotice that if you have unpushed changes, they will be deleted."),
42
- logger.yellow(f"\nIf you are sure you want to do this, type '{self._get_confirmation_keyword()}' (case sensitive):")
43
- ])
44
-
15
+ """
16
+ ### Mode Clean All Executor.
17
+
18
+ Cleans all content from source and build directories.
19
+ """
20
+
21
+ @property
22
+ def confirmation_keyword(self) -> str:
23
+ """### Property containineg the keyword to confirm the cleaning operation."""
24
+ return "YeS"
25
+
26
+ @staticmethod
27
+ def _get_paths_to_delete() -> List[str]:
28
+ """
29
+ ### Returns a list of all the paths to be deleted.
30
+
31
+ #### Returns:
32
+ - (list(str)): List containing all the paths to delete.
33
+ """
34
+ return [
35
+ *[paths.get_source_path(source) for source in constants.XMIPP_SOURCES],
36
+ paths.INSTALL_PATH,
37
+ paths.BUILD_PATH,
38
+ paths.CONFIG_FILE
39
+ ]
40
+
41
+ def _get_confirmation_message(self) -> str:
42
+ """
43
+ ### Returns message to be printed when asking for user confirmation.
44
+
45
+ #### Returns:
46
+ - (str): Confirmation message.
47
+ """
48
+ return '\n'.join([
49
+ logger.yellow("WARNING: This will DELETE ALL content from src and build, and also the xmipp.conf file."),
50
+ logger.yellow("\tNotice that if you have unpushed changes, they will be deleted."),
51
+ logger.yellow(f"\nIf you are sure you want to do this, type '{self.confirmation_keyword}' (case sensitive):")
52
+ ])