passphera-core 0.22.0__tar.gz → 0.23.0__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: passphera-core
3
- Version: 0.22.0
3
+ Version: 0.23.0
4
4
  Summary: The core system of passphera project
5
5
  Home-page: https://github.com/passphera/core
6
6
  Author: Fathi Abdelmalek
@@ -22,9 +22,9 @@ class SetPropertyUseCase:
22
22
  def __init__(self, generator_repository: GeneratorRepository):
23
23
  self.generator_repository: GeneratorRepository = generator_repository
24
24
 
25
- def __call__(self, field: str, value: str) -> Generator:
25
+ def __call__(self, prop: str, value: str) -> Generator:
26
26
  generator_entity: Generator = self.generator_repository.get()
27
- generator_entity.set_property(field, value)
27
+ generator_entity.set_property(prop, value)
28
28
  self.generator_repository.update(generator_entity)
29
29
  return generator_entity
30
30
 
@@ -33,9 +33,9 @@ class ResetPropertyUseCase:
33
33
  def __init__(self, generator_repository: GeneratorRepository):
34
34
  self.generator_repository: GeneratorRepository = generator_repository
35
35
 
36
- def __call__(self, field: str) -> Generator:
36
+ def __call__(self, prop: str) -> Generator:
37
37
  generator_entity: Generator = self.generator_repository.get()
38
- generator_entity.reset_property(field)
38
+ generator_entity.reset_property(prop)
39
39
  self.generator_repository.update(generator_entity)
40
40
  return generator_entity
41
41
 
@@ -103,35 +103,35 @@ class Generator:
103
103
  "characters_replacements": self.characters_replacements,
104
104
  }
105
105
 
106
- def set_property(self, property: str, value: str):
106
+ def set_property(self, prop: str, value: str):
107
107
  """
108
108
  Update a generator property with a new value
109
- :param property: The property name to update; must be one of: shift, multiplier, key, algorithm, prefix, postfix
109
+ :param prop: The property name to update; must be one of: shift, multiplier, key, algorithm, prefix, postfix
110
110
  :param value: The new value to set for the property
111
111
  :raises ValueError: If the property name is not one of the allowed properties
112
112
  :return: None
113
113
  """
114
- if property not in {"shift", "multiplier", "key", "algorithm", "prefix", "postfix"}:
115
- raise ValueError(f"Invalid property: {property}")
116
- if property in ["shift", "multiplier"]:
114
+ if prop not in {"shift", "multiplier", "key", "algorithm", "prefix", "postfix"}:
115
+ raise ValueError(f"Invalid property: {prop}")
116
+ if prop in ["shift", "multiplier"]:
117
117
  value = int(value)
118
- setattr(self, property, value)
119
- if property == "algorithm":
118
+ setattr(self, prop, value)
119
+ if prop == "algorithm":
120
120
  self.get_algorithm()
121
121
  self.updated_at = datetime.now(timezone.utc)
122
122
 
123
- def reset_property(self, property: str):
123
+ def reset_property(self, prop: str):
124
124
  """
125
125
  Reset a generator property to its default value
126
- :param property: The property name to reset, it must be one of: shift, multiplier, key, algorithm, prefix, postfix
126
+ :param prop: The property name to reset, it must be one of: shift, multiplier, key, algorithm, prefix, postfix
127
127
  :raises ValueError: If the property name is not one of the allowed properties
128
128
  :return: None
129
129
  """
130
- if property not in {"shift", "multiplier", "key", "algorithm", "prefix", "postfix"}:
131
- raise ValueError(f"Invalid property: {property}")
130
+ if prop not in {"shift", "multiplier", "key", "algorithm", "prefix", "postfix"}:
131
+ raise ValueError(f"Invalid property: {prop}")
132
132
 
133
- setattr(self, property, self._default_properties[property])
134
- if property == "algorithm":
133
+ setattr(self, prop, self._default_properties[prop])
134
+ if prop == "algorithm":
135
135
  self.get_algorithm()
136
136
  self.updated_at = datetime.now(timezone.utc)
137
137
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: passphera-core
3
- Version: 0.22.0
3
+ Version: 0.23.0
4
4
  Summary: The core system of passphera project
5
5
  Home-page: https://github.com/passphera/core
6
6
  Author: Fathi Abdelmalek
@@ -5,7 +5,7 @@ with open("README.md", "r") as f:
5
5
 
6
6
  setup(
7
7
  name='passphera-core',
8
- version='0.22.0',
8
+ version='0.23.0',
9
9
  author='Fathi Abdelmalek',
10
10
  author_email='abdelmalek.fathi.2001@gmail.com',
11
11
  url='https://github.com/passphera/core',