passphera-core 0.2.0__tar.gz → 0.3.0__tar.gz

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: passphera-core
3
- Version: 0.2.0
3
+ Version: 0.3.0
4
4
  Summary: The core system of passphera project
5
5
  Home-page: https://github.com/passphera/core
6
6
  Author: Fathi Abdelmalek
@@ -0,0 +1,2 @@
1
+ from generator import PasswordGenerator
2
+ from exceptions import InvalidAlgorithmException
@@ -0,0 +1,3 @@
1
+ class InvalidAlgorithmException(Exception):
2
+ def __init__(self, algorithm: str) -> None:
3
+ super().__init__(f"Invalid algorithm name {algorithm}")
@@ -1,9 +1,6 @@
1
1
  from cipherspy.cipher import *
2
2
 
3
-
4
- class InvalidAlgorithmException(Exception):
5
- def __init__(self, algorithm: str) -> None:
6
- super().__init__(f"Invalid algorithm name {algorithm}")
3
+ from .exceptions import InvalidAlgorithmException
7
4
 
8
5
 
9
6
  class PasswordGenerator:
@@ -35,7 +32,10 @@ class PasswordGenerator:
35
32
  self._key_iter: iter = key_iter
36
33
  self._algorithm_name: str = algorithm.lower()
37
34
  self._algorithm = self._set_algorithm()
38
- self._password: str = f'secret{self._text}secret'
35
+ if text:
36
+ self._password: str = f"secret{self._text.replace(' ', '')}secret"
37
+ else:
38
+ self._password: str = f'secret'
39
39
 
40
40
  @property
41
41
  def text(self) -> str:
@@ -55,7 +55,7 @@ class PasswordGenerator:
55
55
  :return:
56
56
  """
57
57
  self._text = text
58
- self._password: str = f'secret{self._text}secret'
58
+ self._password: str = f"secret{self._text.replace(' ', '')}secret"
59
59
 
60
60
  @property
61
61
  def shift(self) -> int:
@@ -227,5 +227,5 @@ class PasswordGenerator:
227
227
  self._password = self._password.replace(char, replacement)
228
228
  for char in self._password:
229
229
  if char in self._text:
230
- self._password = self._text.replace(char, char.upper())
230
+ self._password = self._password.replace(char, char.upper())
231
231
  return self._password
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: passphera-core
3
- Version: 0.2.0
3
+ Version: 0.3.0
4
4
  Summary: The core system of passphera project
5
5
  Home-page: https://github.com/passphera/core
6
6
  Author: Fathi Abdelmalek
@@ -1,6 +1,8 @@
1
1
  README.md
2
2
  setup.py
3
3
  passphera_core/__init__.py
4
+ passphera_core/exceptions.py
5
+ passphera_core/generator.py
4
6
  passphera_core.egg-info/PKG-INFO
5
7
  passphera_core.egg-info/SOURCES.txt
6
8
  passphera_core.egg-info/dependency_links.txt
@@ -5,7 +5,7 @@ with open("README.md", "r") as fh:
5
5
 
6
6
  setup(
7
7
  name='passphera-core',
8
- version='0.2.0',
8
+ version='0.3.0',
9
9
  author='Fathi Abdelmalek',
10
10
  author_email='abdelmalek.fathi.2001@gmail.com',
11
11
  url='https://github.com/passphera/core',
File without changes
File without changes