(
conditions,
)
| 5 | class PasswordGenerator: |
| 6 | @staticmethod |
| 7 | def gen_sequence( |
| 8 | conditions, |
| 9 | ): # must have conditions (in a list format), for each member of the list possible_characters |
| 10 | possible_characters = [ |
| 11 | str.ascii_lowercase, |
| 12 | str.ascii_uppercase, |
| 13 | str.digits, |
| 14 | str.punctuation, |
| 15 | ] |
| 16 | sequence = "" |
| 17 | for x in range(len(conditions)): |
| 18 | if conditions[x]: |
| 19 | sequence += possible_characters[x] |
| 20 | else: |
| 21 | pass |
| 22 | return sequence |
| 23 | |
| 24 | @staticmethod |
| 25 | def gen_password(sequence, passlength=8): |