Skip to content

Commit cdf96e8

Browse files
author
rootware
committed
working refactor for valid_options()
1 parent 7d15fb9 commit cdf96e8

File tree

2 files changed

+15
-13
lines changed

2 files changed

+15
-13
lines changed

pyredactkit/common_jobs.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
import json
88
import uuid
99

10+
from pyredactkit.identifiers import Identifier
11+
id_object = Identifier()
1012

1113
class CommonJobs:
1214
"""Common Jobs class
@@ -40,6 +42,19 @@ def write_hashmap(self, hash_map=dict, filename=str, savedir="./") -> dict:
4042
with open(f"{savedir}.hashshadow_{os.path.basename(filename)}.json", "w", encoding="utf-8") as file:
4143
json.dump(hash_map, file)
4244

45+
def valid_options(self) -> tuple:
46+
"""Function to read in valid options from Identifier.regexes
47+
Args:
48+
None
49+
50+
Returns:
51+
option_tupe (tuple): redacted line
52+
"""
53+
option_tuple = ()
54+
for id in id_object.regexes:
55+
option_tuple += id['type']
56+
return option_tuple
57+
4358
def process_report(self, filename, savedir="./"):
4459
"""Function to process calculate and generate report of man hour saved.
4560
Args:

pyredactkit/core_redactor.py

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -67,19 +67,6 @@ def write_hashmap(self, hash_map=dict, filename=str, savedir="./") -> dict:
6767
with open(f"{savedir}.hashshadow_{os.path.basename(filename)}.json", "w", encoding="utf-8") as file:
6868
json.dump(hash_map, file)
6969

70-
def valid_options(self) -> tuple:
71-
"""Function to read in valid options from Identifier.regexes
72-
Args:
73-
None
74-
75-
Returns:
76-
option_tupe (tuple): redacted line
77-
"""
78-
option_tuple = ()
79-
for id in id_object.regexes:
80-
option_tuple += id['type']
81-
return option_tuple
82-
8370
def redact_custom(self, line=str, customfile=str) -> tuple:
8471
"""Function to redact custom option
8572
Args:

0 commit comments

Comments
 (0)