PyFunceble-dev 4.3.0a23__py3-none-any.whl → 4.3.0a24__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 (99) hide show
  1. PyFunceble/checker/availability/base.py +5 -2
  2. PyFunceble/checker/availability/domain.py +18 -0
  3. PyFunceble/checker/availability/extras/base.py +4 -4
  4. PyFunceble/checker/availability/extras/dns.py +1 -1
  5. PyFunceble/checker/availability/extras/etoxic.py +3 -3
  6. PyFunceble/checker/availability/extras/parked.py +22 -20
  7. PyFunceble/checker/availability/extras/rules.py +5 -13
  8. PyFunceble/checker/availability/extras/subject_switch.py +4 -5
  9. PyFunceble/checker/availability/ip.py +18 -0
  10. PyFunceble/checker/availability/params.py +1 -1
  11. PyFunceble/checker/availability/status.py +9 -4
  12. PyFunceble/checker/availability/url.py +6 -0
  13. PyFunceble/checker/base.py +4 -0
  14. PyFunceble/checker/reputation/base.py +5 -2
  15. PyFunceble/checker/reputation/domain.py +11 -0
  16. PyFunceble/checker/reputation/ip.py +11 -0
  17. PyFunceble/checker/reputation/status.py +1 -1
  18. PyFunceble/checker/reputation/url.py +12 -1
  19. PyFunceble/checker/syntax/base.py +4 -1
  20. PyFunceble/checker/syntax/domain.py +4 -0
  21. PyFunceble/checker/syntax/ip.py +4 -0
  22. PyFunceble/checker/syntax/ipv4.py +10 -13
  23. PyFunceble/checker/syntax/ipv6.py +9 -11
  24. PyFunceble/checker/syntax/params.py +1 -1
  25. PyFunceble/checker/syntax/second_lvl_domain.py +3 -4
  26. PyFunceble/checker/syntax/subdomain.py +3 -4
  27. PyFunceble/checker/syntax/url.py +9 -6
  28. PyFunceble/checker/utils/whois.py +7 -11
  29. PyFunceble/cli/continuous_integration/base.py +14 -14
  30. PyFunceble/cli/credential_loader.py +4 -6
  31. PyFunceble/cli/entry_points/clean.py +0 -1
  32. PyFunceble/cli/entry_points/production.py +1 -1
  33. PyFunceble/cli/entry_points/pyfunceble/cli.py +1 -1
  34. PyFunceble/cli/execution_time.py +2 -2
  35. PyFunceble/cli/filesystem/cleanup.py +1 -3
  36. PyFunceble/cli/filesystem/dir_base.py +5 -1
  37. PyFunceble/cli/filesystem/dir_structure/backup.py +1 -2
  38. PyFunceble/cli/filesystem/dir_structure/base.py +0 -1
  39. PyFunceble/cli/filesystem/dir_structure/restore.py +5 -7
  40. PyFunceble/cli/filesystem/status_file.py +2 -3
  41. PyFunceble/cli/migrators/alembic.py +2 -4
  42. PyFunceble/cli/migrators/csv_file/inactive_source_delete.py +0 -1
  43. PyFunceble/cli/migrators/csv_file/whois_registrar_add.py +0 -1
  44. PyFunceble/cli/migrators/db_base.py +2 -2
  45. PyFunceble/cli/migrators/file_cleanup/base.py +3 -3
  46. PyFunceble/cli/migrators/file_cleanup/hashes_file.py +2 -3
  47. PyFunceble/cli/migrators/file_cleanup/mining_file.py +2 -3
  48. PyFunceble/cli/migrators/file_cleanup/production_config_file.py +2 -3
  49. PyFunceble/cli/migrators/mariadb/base.py +2 -4
  50. PyFunceble/cli/migrators/mariadb/file_and_status.py +1 -1
  51. PyFunceble/cli/migrators/mariadb/whois_record_idna_subject.py +0 -2
  52. PyFunceble/cli/processes/workers/base.py +0 -1
  53. PyFunceble/cli/processes/workers/chancy_producer.py +1 -2
  54. PyFunceble/cli/processes/workers/dir_files_sorter.py +6 -14
  55. PyFunceble/cli/processes/workers/file_sorter.py +2 -9
  56. PyFunceble/cli/processes/workers/migrator.py +0 -1
  57. PyFunceble/cli/processes/workers/producer.py +2 -4
  58. PyFunceble/cli/processes/workers/tester.py +2 -3
  59. PyFunceble/cli/scripts/iana.py +14 -10
  60. PyFunceble/cli/scripts/production.py +2 -2
  61. PyFunceble/cli/scripts/public_suffix.py +2 -2
  62. PyFunceble/cli/system/integrator.py +1 -1
  63. PyFunceble/cli/system/launcher.py +9 -10
  64. PyFunceble/cli/utils/stdout.py +1 -1
  65. PyFunceble/cli/utils/testing.py +6 -16
  66. PyFunceble/config/compare.py +10 -9
  67. PyFunceble/config/loader.py +7 -4
  68. PyFunceble/converter/input_line2subject.py +2 -2
  69. PyFunceble/converter/internal_url.py +1 -1
  70. PyFunceble/converter/rpz_input_line2subject.py +2 -4
  71. PyFunceble/converter/subject2complements.py +4 -1
  72. PyFunceble/converter/url2netloc.py +3 -3
  73. PyFunceble/converter/wildcard2subject.py +3 -3
  74. PyFunceble/helpers/command.py +1 -1
  75. PyFunceble/helpers/dict.py +4 -4
  76. PyFunceble/helpers/file.py +2 -2
  77. PyFunceble/helpers/list.py +10 -7
  78. PyFunceble/helpers/merge.py +2 -2
  79. PyFunceble/helpers/regex.py +9 -11
  80. PyFunceble/query/dns/nameserver.py +9 -19
  81. PyFunceble/query/dns/query_tool.py +64 -205
  82. PyFunceble/query/dns/resolver.py +64 -51
  83. PyFunceble/query/netinfo/address.py +4 -6
  84. PyFunceble/query/netinfo/base.py +1 -1
  85. PyFunceble/query/netinfo/hostbyaddr.py +5 -8
  86. PyFunceble/query/requests/adapter/base.py +3 -3
  87. PyFunceble/query/requests/adapter/http.py +0 -1
  88. PyFunceble/query/requests/requester.py +6 -6
  89. PyFunceble/query/whois/converter/expiration_date.py +19 -8
  90. PyFunceble/query/whois/converter/month2unified.py +4 -6
  91. PyFunceble/query/whois/converter/registrar.py +18 -5
  92. PyFunceble/query/whois/query_tool.py +15 -18
  93. PyFunceble/storage.py +1 -1
  94. {pyfunceble_dev-4.3.0a23.dist-info → pyfunceble_dev-4.3.0a24.dist-info}/METADATA +107 -106
  95. {pyfunceble_dev-4.3.0a23.dist-info → pyfunceble_dev-4.3.0a24.dist-info}/RECORD +99 -99
  96. {pyfunceble_dev-4.3.0a23.dist-info → pyfunceble_dev-4.3.0a24.dist-info}/WHEEL +0 -0
  97. {pyfunceble_dev-4.3.0a23.dist-info → pyfunceble_dev-4.3.0a24.dist-info}/entry_points.txt +0 -0
  98. {pyfunceble_dev-4.3.0a23.dist-info → pyfunceble_dev-4.3.0a24.dist-info}/licenses/LICENSE +0 -0
  99. {pyfunceble_dev-4.3.0a23.dist-info → pyfunceble_dev-4.3.0a24.dist-info}/top_level.txt +0 -0
@@ -53,7 +53,6 @@ License:
53
53
  from typing import Optional
54
54
 
55
55
  from PyFunceble.checker.syntax.domain_base import DomainSyntaxCheckerBase
56
- from PyFunceble.helpers.regex import RegexHelper
57
56
 
58
57
 
59
58
  class SecondLvlDomainSyntaxChecker(DomainSyntaxCheckerBase):
@@ -108,15 +107,15 @@ class SecondLvlDomainSyntaxChecker(DomainSyntaxCheckerBase):
108
107
  if "." in subject_without_suffix:
109
108
  return False
110
109
 
111
- return RegexHelper(self.REGEX_VALID_DOMAIN).match(
110
+ return self.regex_helper.set_regex(self.REGEX_VALID_DOMAIN).match(
112
111
  self.idna_subject, return_match=False
113
- ) or RegexHelper(self.REGEX_VALID_RELAXED_DOMAIN).match(
112
+ ) or self.regex_helper.set_regex(self.REGEX_VALID_RELAXED_DOMAIN).match(
114
113
  self.idna_subject, return_match=False
115
114
  )
116
115
 
117
116
  if "." in subject_without_extension:
118
117
  return False
119
118
 
120
- return RegexHelper(self.REGEX_VALID_DOMAIN).match(
119
+ return self.regex_helper.set_regex(self.REGEX_VALID_DOMAIN).match(
121
120
  self.idna_subject, return_match=False
122
121
  )
@@ -51,7 +51,6 @@ License:
51
51
  """
52
52
 
53
53
  from PyFunceble.checker.syntax.domain_base import DomainSyntaxCheckerBase
54
- from PyFunceble.helpers.regex import RegexHelper
55
54
 
56
55
 
57
56
  class SubDomainSyntaxChecker(DomainSyntaxCheckerBase):
@@ -89,19 +88,19 @@ class SubDomainSyntaxChecker(DomainSyntaxCheckerBase):
89
88
 
90
89
  if subject_without_suffix:
91
90
  if suffix.count(".") >= 2:
92
- return RegexHelper(self.REGEX_VALID_SUBDOMAIN).match(
91
+ return self.regex_helper.set_regex(self.REGEX_VALID_SUBDOMAIN).match(
93
92
  subject_without_extension, return_match=False
94
93
  )
95
94
 
96
95
  if "." in subject_without_suffix:
97
- return RegexHelper(self.REGEX_VALID_SUBDOMAIN).match(
96
+ return self.regex_helper.set_regex(self.REGEX_VALID_SUBDOMAIN).match(
98
97
  self.idna_subject, return_match=False
99
98
  )
100
99
 
101
100
  return False
102
101
 
103
102
  if "." in subject_without_extension:
104
- return RegexHelper(self.REGEX_VALID_SUBDOMAIN).match(
103
+ return self.regex_helper.set_regex(self.REGEX_VALID_SUBDOMAIN).match(
105
104
  subject_without_extension, return_match=False
106
105
  )
107
106
 
@@ -57,6 +57,8 @@ from PyFunceble.checker.base import CheckerBase
57
57
  from PyFunceble.checker.syntax.base import SyntaxCheckerBase
58
58
  from PyFunceble.checker.syntax.domain import DomainSyntaxChecker
59
59
  from PyFunceble.checker.syntax.ip import IPSyntaxChecker
60
+ from PyFunceble.checker.syntax.params import SyntaxCheckerParams
61
+ from PyFunceble.checker.syntax.status import SyntaxCheckerStatus
60
62
 
61
63
 
62
64
  class URLSyntaxChecker(SyntaxCheckerBase):
@@ -67,7 +69,11 @@ class URLSyntaxChecker(SyntaxCheckerBase):
67
69
  Optional, The subject to work with.
68
70
  """
69
71
 
70
- def subject_propagator(self) -> CheckerBase:
72
+ def subject_propagator(self) -> "URLSyntaxChecker":
73
+ self.status = SyntaxCheckerStatus()
74
+ self.params = SyntaxCheckerParams()
75
+ self.status.params = self.params
76
+
71
77
  self.status.subject_kind = "url"
72
78
 
73
79
  return super().subject_propagator()
@@ -112,10 +118,7 @@ class URLSyntaxChecker(SyntaxCheckerBase):
112
118
  if not hostname:
113
119
  return False
114
120
 
115
- if (
121
+ return (
116
122
  DomainSyntaxChecker(hostname).is_valid()
117
123
  or IPSyntaxChecker(hostname).is_valid()
118
- ):
119
- return True
120
-
121
- return False
124
+ )
@@ -73,30 +73,26 @@ def get_whois_dataset_object(
73
73
  A database session to use.
74
74
 
75
75
  :raise ValueError:
76
- When the given database type is unkown.
76
+ When the given database type is unknown.
77
77
  :raise RuntimeError:
78
78
  When the configuration was not loaded yet.
79
79
  """
80
80
 
81
81
  if PyFunceble.facility.ConfigLoader.is_already_loaded():
82
- result = None
83
-
84
82
  if PyFunceble.storage.CONFIGURATION.cli_testing.db_type == "csv":
85
- result = CSVWhoisDataset()
86
- elif PyFunceble.storage.CONFIGURATION.cli_testing.db_type in (
83
+ return CSVWhoisDataset().set_authorized(
84
+ bool(PyFunceble.storage.CONFIGURATION.cli_testing.whois_db)
85
+ )
86
+
87
+ if PyFunceble.storage.CONFIGURATION.cli_testing.db_type in (
87
88
  "mariadb",
88
89
  "mysql",
89
90
  "postgresql",
90
91
  ):
91
- result = SQLDBWhoisDataset(db_session=db_session)
92
-
93
- if result:
94
- result.set_authorized(
92
+ return SQLDBWhoisDataset(db_session=db_session).set_authorized(
95
93
  bool(PyFunceble.storage.CONFIGURATION.cli_testing.whois_db)
96
94
  )
97
95
 
98
- return result
99
-
100
96
  raise ValueError(
101
97
  "<config.db_type> "
102
98
  f"({PyFunceble.storage.CONFIGURATION.cli_testing.db_type}) is unknown."
@@ -72,19 +72,19 @@ class ContinuousIntegrationBase:
72
72
  :param authorized:
73
73
  The authorization to run.
74
74
  :param git_email:
75
- The email to apply while initilizing the git repository for push.
75
+ The email to apply while initializing the git repository for push.
76
76
  :param git_name:
77
- The name to apply while initilizing the git repository for push.
77
+ The name to apply while initializing the git repository for push.
78
78
  :param git_branch:
79
79
  The branch to use while testing.
80
80
  :param git_distribution_branch:
81
81
  The branch to push the results into.
82
82
  :param token:
83
- The token to apply while initilizing the git repository for push.
83
+ The token to apply while initializing the git repository for push.
84
84
  :param command:
85
85
  The command to execute before each push (except the latest one).
86
86
  :param end_command:
87
- The commant to execute at the very end.
87
+ The command to execute at the very end.
88
88
  :param commit_message:
89
89
  The commit message to apply before each push (except the latest one).
90
90
  :param end_commit_message:
@@ -202,7 +202,7 @@ class ContinuousIntegrationBase:
202
202
  Otherwise, apply the given :code:`default`.
203
203
  """
204
204
 
205
- def inner_metdhod(func):
205
+ def inner_method(func):
206
206
  @functools.wraps(func)
207
207
  def wrapper(self, *args, **kwargs):
208
208
  if self.authorized:
@@ -211,7 +211,7 @@ class ContinuousIntegrationBase:
211
211
 
212
212
  return wrapper
213
213
 
214
- return inner_metdhod
214
+ return inner_method
215
215
 
216
216
  def ensure_git_email_is_given(func): # pylint: disable=no-self-argument
217
217
  """
@@ -609,7 +609,7 @@ class ContinuousIntegrationBase:
609
609
  raise TypeError(f"<value> should be {str}, {type(value)} given.")
610
610
 
611
611
  if not value:
612
- raise ValueError("<value> should not be empy.")
612
+ raise ValueError("<value> should not be empty.")
613
613
 
614
614
  self._command = value
615
615
 
@@ -651,7 +651,7 @@ class ContinuousIntegrationBase:
651
651
  raise TypeError(f"<value> should be {str}, {type(value)} given.")
652
652
 
653
653
  if not value:
654
- raise ValueError("<value> should not be empy.")
654
+ raise ValueError("<value> should not be empty.")
655
655
 
656
656
  self._end_command = value
657
657
 
@@ -693,7 +693,7 @@ class ContinuousIntegrationBase:
693
693
  raise TypeError(f"<value> should be {str}, {type(value)} given.")
694
694
 
695
695
  if not value:
696
- raise ValueError("<value> should not be empy.")
696
+ raise ValueError("<value> should not be empty.")
697
697
 
698
698
  self._commit_message = value
699
699
 
@@ -735,7 +735,7 @@ class ContinuousIntegrationBase:
735
735
  raise TypeError(f"<value> should be {str}, {type(value)} given.")
736
736
 
737
737
  if not value:
738
- raise ValueError("<value> should not be empy.")
738
+ raise ValueError("<value> should not be empty.")
739
739
 
740
740
  self._end_commit_message = value
741
741
 
@@ -835,7 +835,7 @@ class ContinuousIntegrationBase:
835
835
  @staticmethod
836
836
  def exec_command(command: str, allow_stdout: bool) -> None:
837
837
  """
838
- Exceutes the given command.
838
+ Executes the given command.
839
839
 
840
840
  :param command:
841
841
  The command to execute.
@@ -1293,17 +1293,17 @@ class ContinuousIntegrationBase:
1293
1293
  The purpose of this method is to be able to have some custom init based
1294
1294
  on the CI we are currently on.
1295
1295
 
1296
- The init method should be manually started before runing any further
1296
+ The init method should be manually started before running any further
1297
1297
  action.
1298
1298
 
1299
1299
  .. warning::
1300
1300
  We assume that we are aware that you should run this method first.
1301
1301
  """
1302
1302
 
1303
- PyFunceble.facility.Logger.info("Started initizalization of workflow.")
1303
+ PyFunceble.facility.Logger.info("Started initialization of workflow.")
1304
1304
 
1305
1305
  self.init_git()
1306
1306
 
1307
- PyFunceble.facility.Logger.info("Finished initizalization of workflow.")
1307
+ PyFunceble.facility.Logger.info("Finished initialization of workflow.")
1308
1308
 
1309
1309
  return self
@@ -66,7 +66,7 @@ from PyFunceble.helpers.environment_variable import EnvironmentVariableHelper
66
66
 
67
67
  class CredentialLoader:
68
68
  """
69
- Provides our creadential loader.
69
+ Provides our credentials loader.
70
70
 
71
71
  The idea is to have an interface which provides the credential to use
72
72
  but at the same time load and initiate the credential interface after
@@ -123,7 +123,7 @@ class CredentialLoader:
123
123
  Otherwise, apply the given :code:`default`.
124
124
  """
125
125
 
126
- def inner_metdhod(func):
126
+ def inner_method(func):
127
127
  @functools.wraps(func)
128
128
  def wrapper(self, *args, **kwargs):
129
129
  if self.authorized:
@@ -132,7 +132,7 @@ class CredentialLoader:
132
132
 
133
133
  return wrapper
134
134
 
135
- return inner_metdhod
135
+ return inner_method
136
136
 
137
137
  def start_if_not_started(func): # pylint: disable=no-self-argument
138
138
  """
@@ -248,9 +248,7 @@ class CredentialLoader:
248
248
  else:
249
249
  user_input = input(message)
250
250
 
251
- if user_input:
252
- return user_input
253
- return default
251
+ return user_input or default
254
252
 
255
253
  @execute_if_authorized(None)
256
254
  @ensure_db_type_is_given
@@ -57,7 +57,6 @@ import traceback
57
57
 
58
58
  import colorama
59
59
 
60
- import PyFunceble.cli.facility
61
60
  import PyFunceble.cli.storage
62
61
  import PyFunceble.cli.utils.ascii_logo
63
62
  import PyFunceble.facility
@@ -71,7 +71,7 @@ def producer() -> None: # pylint: disable=too-many-statements
71
71
  description = (
72
72
  f"{colorama.Style.BRIGHT}{colorama.Fore.GREEN}PyFunceble Production Preparator"
73
73
  f"{colorama.Style.RESET_ALL} - "
74
- "The Production peparator for PyFunceble."
74
+ "The Production preparator for PyFunceble."
75
75
  )
76
76
 
77
77
  parser = argparse.ArgumentParser(
@@ -473,7 +473,7 @@ def get_test_control_group_data() -> List[Tuple[List[str], dict]]:
473
473
  {
474
474
  "dest": "self_contained.lookup.netinfo",
475
475
  "action": "store_true",
476
- "help": "Only perform a network information (or networket "
476
+ "help": "Only perform a network information (or network "
477
477
  "socket) lookup.",
478
478
  },
479
479
  ),
@@ -90,7 +90,7 @@ class ExecutionTime:
90
90
  Otherwise, apply the given :code:`default`.
91
91
  """
92
92
 
93
- def inner_metdhod(func):
93
+ def inner_method(func):
94
94
  @functools.wraps(func)
95
95
  def wrapper(self, *args, **kwargs):
96
96
  if self.authorized:
@@ -99,7 +99,7 @@ class ExecutionTime:
99
99
 
100
100
  return wrapper
101
101
 
102
- return inner_metdhod
102
+ return inner_method
103
103
 
104
104
  @staticmethod
105
105
  def split_difference(start: datetime.datetime, end: datetime.datetime) -> dict:
@@ -55,8 +55,6 @@ from typing import List
55
55
 
56
56
  import PyFunceble.cli.facility
57
57
  import PyFunceble.cli.factory
58
- import PyFunceble.cli.utils.testing
59
- import PyFunceble.sessions
60
58
  from PyFunceble.cli.filesystem.dir_base import FilesystemDirBase
61
59
  from PyFunceble.database.sqlalchemy.all_schemas import Continue, Inactive
62
60
  from PyFunceble.helpers.file import FileHelper
@@ -71,7 +69,7 @@ class FilesystemCleanup(FilesystemDirBase):
71
69
 
72
70
  def clean_database(self) -> "FilesystemCleanup":
73
71
  """
74
- Cleanups the uneeded data that were stored in the database.
72
+ Cleanups the unneeded data that were stored in the database.
75
73
 
76
74
  .. warning::
77
75
  This method cleans everything except the WHOIS records.
@@ -70,6 +70,8 @@ class FilesystemDirBase:
70
70
 
71
71
  INLINE_DEST: str = "_inline_"
72
72
 
73
+ directory_helper: Optional[DirectoryHelper] = None
74
+
73
75
  def __init__(
74
76
  self,
75
77
  parent_dirname: Optional[str] = None,
@@ -83,6 +85,8 @@ class FilesystemDirBase:
83
85
 
84
86
  self.db_session = db_session
85
87
 
88
+ self.directory_helper = DirectoryHelper()
89
+
86
90
  @property
87
91
  def parent_dirname(self) -> Optional[str]:
88
92
  """
@@ -187,5 +191,5 @@ class FilesystemDirBase:
187
191
  else:
188
192
  result = PyFunceble.cli.storage.OUTPUT_DIRECTORY
189
193
 
190
- DirectoryHelper(result).create()
194
+ self.directory_helper.set_path(result).create()
191
195
  return result
@@ -55,7 +55,6 @@ import os
55
55
  import PyFunceble.facility
56
56
  from PyFunceble.cli.filesystem.dir_structure.base import DirectoryStructureBase
57
57
  from PyFunceble.helpers.dict import DictHelper
58
- from PyFunceble.helpers.directory import DirectoryHelper
59
58
  from PyFunceble.helpers.file import FileHelper
60
59
  from PyFunceble.helpers.hash import HashHelper
61
60
 
@@ -75,7 +74,7 @@ class DirectoryStructureBackup(DirectoryStructureBase):
75
74
  file_helper = FileHelper()
76
75
  hash_helper = HashHelper()
77
76
 
78
- for file in DirectoryHelper(base_dir).list_all_files():
77
+ for file in self.directory_helper.set_path(base_dir).list_all_files():
79
78
  file_helper.set_path(file)
80
79
  reduced_path = self.get_path_without_base_dir(file)
81
80
 
@@ -58,7 +58,6 @@ try:
58
58
  except ImportError: # pragma: no cover ## Retro compatibility
59
59
  import importlib_resources as package_resources
60
60
 
61
-
62
61
  from PyFunceble.cli.filesystem.cleanup import FilesystemCleanup
63
62
  from PyFunceble.cli.filesystem.dir_base import FilesystemDirBase
64
63
 
@@ -55,7 +55,6 @@ import os
55
55
  import PyFunceble.cli.storage
56
56
  from PyFunceble.cli.filesystem.dir_structure.base import DirectoryStructureBase
57
57
  from PyFunceble.helpers.dict import DictHelper
58
- from PyFunceble.helpers.directory import DirectoryHelper
59
58
  from PyFunceble.helpers.file import FileHelper
60
59
  from PyFunceble.utils.platform import PlatformUtility
61
60
 
@@ -99,15 +98,14 @@ class DirectoryStructureRestoration(DirectoryStructureBase):
99
98
  backup = self.get_backup_data()
100
99
 
101
100
  base_dir = self.get_output_basedir()
102
- dir_helper = DirectoryHelper()
103
101
  file_helper = FileHelper()
104
102
 
105
- if dir_helper.set_path(base_dir).exists():
106
- for root, _, files in os.walk(dir_helper.path):
103
+ if self.directory_helper.set_path(base_dir).exists():
104
+ for root, _, files in os.walk(self.directory_helper.path):
107
105
  reduced_path = self.get_path_without_base_dir(root)
108
106
 
109
107
  if reduced_path not in backup and root != reduced_path:
110
- dir_helper.set_path(root).delete()
108
+ self.directory_helper.set_path(root).delete()
111
109
 
112
110
  PyFunceble.facility.Logger.debug(
113
111
  "Added %r into the list of directories to delete. "
@@ -117,10 +115,10 @@ class DirectoryStructureRestoration(DirectoryStructureBase):
117
115
  continue
118
116
 
119
117
  for directory, files in backup.items():
120
- dir_helper.set_path(os.path.join(base_dir, directory)).create()
118
+ self.directory_helper.set_path(os.path.join(base_dir, directory)).create()
121
119
 
122
120
  for file, dataset in files.items():
123
- file_full_path = os.path.join(dir_helper.path, file)
121
+ file_full_path = os.path.join(self.directory_helper.path, file)
124
122
 
125
123
  if (
126
124
  file == ".gitignore"
@@ -66,7 +66,6 @@ from PyFunceble.cli.filesystem.dir_structure.restore import (
66
66
  DirectoryStructureRestoration,
67
67
  )
68
68
  from PyFunceble.cli.filesystem.printer.file import FilePrinter
69
- from PyFunceble.helpers.directory import DirectoryHelper
70
69
  from PyFunceble.utils.platform import PlatformUtility
71
70
 
72
71
 
@@ -535,7 +534,7 @@ class StatusFileGenerator(FilesystemDirBase):
535
534
 
536
535
  result = super().get_output_basedir()
537
536
 
538
- if not DirectoryHelper(result).exists():
537
+ if not self.directory_helper.set_path(result).exists():
539
538
  DirectoryStructureRestoration(self.parent_dirname).start()
540
539
  return result
541
540
 
@@ -672,7 +671,7 @@ class StatusFileGenerator(FilesystemDirBase):
672
671
  )
673
672
 
674
673
  if self.test_dataset and "from_inactive" in self.test_dataset:
675
- # Let's generate the supicious file :-)
674
+ # Let's generate the suspicious file :-)
676
675
  if self.status.status in [
677
676
  PyFunceble.storage.STATUS.up,
678
677
  PyFunceble.storage.STATUS.valid,
@@ -68,10 +68,8 @@ from alembic import command as alembic_command
68
68
  from alembic.script.base import ScriptDirectory
69
69
 
70
70
  import PyFunceble.cli.facility
71
- import PyFunceble.cli.factory
72
71
  import PyFunceble.cli.storage
73
72
  import PyFunceble.facility
74
- import PyFunceble.sessions
75
73
  from PyFunceble.cli.migrators.db_base import DBMigratorBase
76
74
 
77
75
 
@@ -97,7 +95,7 @@ class Alembic:
97
95
  Otherwise, apply the given :code:`default`.
98
96
  """
99
97
 
100
- def inner_metdhod(func):
98
+ def inner_method(func):
101
99
  @functools.wraps(func)
102
100
  def wrapper(self, *args, **kwargs):
103
101
  if self.authorized:
@@ -106,7 +104,7 @@ class Alembic:
106
104
 
107
105
  return wrapper
108
106
 
109
- return inner_metdhod
107
+ return inner_method
110
108
 
111
109
  @property
112
110
  def authorized(self):
@@ -55,7 +55,6 @@ import os
55
55
  from typing import List
56
56
 
57
57
  import PyFunceble.cli.storage
58
- import PyFunceble.storage
59
58
  from PyFunceble.cli.migrators.csv_file.base import CSVFileMigratorBase
60
59
 
61
60
 
@@ -55,7 +55,6 @@ import os
55
55
  from typing import List
56
56
 
57
57
  import PyFunceble.cli.storage
58
- import PyFunceble.storage
59
58
  from PyFunceble.cli.migrators.csv_file.base import CSVFileMigratorBase
60
59
 
61
60
 
@@ -75,7 +75,7 @@ class DBMigratorBase(MigratorBase):
75
75
  Otherwise, apply the given :code:`default`.
76
76
  """
77
77
 
78
- def inner_metdhod(func):
78
+ def inner_method(func):
79
79
  @functools.wraps(func)
80
80
  def wrapper(self, *args, **kwargs):
81
81
  if self.authorized:
@@ -84,7 +84,7 @@ class DBMigratorBase(MigratorBase):
84
84
 
85
85
  return wrapper
86
86
 
87
- return inner_metdhod
87
+ return inner_method
88
88
 
89
89
  @property
90
90
  def authorized(self):
@@ -59,7 +59,7 @@ from PyFunceble.cli.utils.stdout import print_single_line
59
59
  from PyFunceble.helpers.file import FileHelper
60
60
 
61
61
 
62
- class FileClenupMigratorBase(MigratorBase):
62
+ class FileCleanupMigratorBase(MigratorBase):
63
63
  """
64
64
  Provides the base of all file cleanup related migration classes.
65
65
  """
@@ -85,7 +85,7 @@ class FileClenupMigratorBase(MigratorBase):
85
85
  return wrapper
86
86
 
87
87
  @ensure_source_file_is_given
88
- def migrate(self) -> "FileClenupMigratorBase":
88
+ def migrate(self) -> "FileCleanupMigratorBase":
89
89
  """
90
90
  Provides the migrator (itself)
91
91
  """
@@ -98,7 +98,7 @@ class FileClenupMigratorBase(MigratorBase):
98
98
  if self.print_action_to_stdout:
99
99
  print_single_line()
100
100
 
101
- def start(self) -> "FileClenupMigratorBase":
101
+ def start(self) -> "FileCleanupMigratorBase":
102
102
  """
103
103
  Starts the migration and everything related to it.
104
104
  """
@@ -53,11 +53,10 @@ License:
53
53
  import os
54
54
 
55
55
  import PyFunceble.cli.storage
56
- import PyFunceble.storage
57
- from PyFunceble.cli.migrators.file_cleanup.base import FileClenupMigratorBase
56
+ from PyFunceble.cli.migrators.file_cleanup.base import FileCleanupMigratorBase
58
57
 
59
58
 
60
- class HashesFileCleanupMigrator(FileClenupMigratorBase):
59
+ class HashesFileCleanupMigrator(FileCleanupMigratorBase):
61
60
  """
62
61
  Provides the interface for the cleanup of the hashes file.
63
62
  """
@@ -53,11 +53,10 @@ License:
53
53
  import os
54
54
 
55
55
  import PyFunceble.cli.storage
56
- import PyFunceble.storage
57
- from PyFunceble.cli.migrators.file_cleanup.base import FileClenupMigratorBase
56
+ from PyFunceble.cli.migrators.file_cleanup.base import FileCleanupMigratorBase
58
57
 
59
58
 
60
- class MiningFileCleanupMigrator(FileClenupMigratorBase):
59
+ class MiningFileCleanupMigrator(FileCleanupMigratorBase):
61
60
  """
62
61
  Provides the interface for the cleanup of the mining file.
63
62
  """
@@ -52,12 +52,11 @@ License:
52
52
 
53
53
  import os
54
54
 
55
- import PyFunceble.cli.storage
56
55
  import PyFunceble.storage
57
- from PyFunceble.cli.migrators.file_cleanup.base import FileClenupMigratorBase
56
+ from PyFunceble.cli.migrators.file_cleanup.base import FileCleanupMigratorBase
58
57
 
59
58
 
60
- class ProductionConfigFileCleanupMigrator(FileClenupMigratorBase):
59
+ class ProductionConfigFileCleanupMigrator(FileCleanupMigratorBase):
61
60
  """
62
61
  Provides the interface for the cleanup of the
63
62
  :code:`.PyFunceble_production.yaml` file.
@@ -56,8 +56,6 @@ from typing import Any, Generator, Tuple
56
56
  from sqlalchemy.sql import text
57
57
 
58
58
  import PyFunceble.cli.facility
59
- import PyFunceble.cli.factory
60
- import PyFunceble.sessions
61
59
  from PyFunceble.cli.migrators.db_base import DBMigratorBase
62
60
 
63
61
 
@@ -72,7 +70,7 @@ class MariaDBMigratorBase(DBMigratorBase):
72
70
  Otherwise, apply the given :code:`default`.
73
71
  """
74
72
 
75
- def inner_metdhod(func):
73
+ def inner_method(func):
76
74
  @functools.wraps(func)
77
75
  def wrapper(self, *args, **kwargs):
78
76
  if self.authorized:
@@ -81,7 +79,7 @@ class MariaDBMigratorBase(DBMigratorBase):
81
79
 
82
80
  return wrapper
83
81
 
84
- return inner_metdhod
82
+ return inner_method
85
83
 
86
84
  def get_rows(
87
85
  self, statement: str, limit: int = 20
@@ -92,7 +92,7 @@ class FileAndStatusMigrator(MariaDBMigratorBase):
92
92
  )
93
93
 
94
94
  inactive_dataset = PyFunceble.cli.utils.testing.get_inactive_dataset_object()
95
- continue_dataset = PyFunceble.cli.utils.testing.get_continue_databaset_object()
95
+ continue_dataset = PyFunceble.cli.utils.testing.get_continue_dataset_object()
96
96
 
97
97
  drop_table = True
98
98
 
@@ -52,9 +52,7 @@ License:
52
52
 
53
53
  import domain2idna
54
54
 
55
- import PyFunceble.cli.factory
56
55
  import PyFunceble.facility
57
- import PyFunceble.sessions
58
56
  from PyFunceble.cli.migrators.mariadb.base import MariaDBMigratorBase
59
57
  from PyFunceble.cli.utils.stdout import print_single_line
60
58
  from PyFunceble.database.sqlalchemy.all_schemas import WhoisRecord
@@ -61,7 +61,6 @@ import PyFunceble.cli.facility
61
61
  import PyFunceble.cli.factory
62
62
  import PyFunceble.ext.process_manager
63
63
  import PyFunceble.facility
64
- import PyFunceble.sessions
65
64
  import PyFunceble.storage
66
65
  from PyFunceble.query.requests.requester import Requester
67
66