Bugfix: Path exclusion constant and min files for path constants werent being respected
This commit is contained in:
@@ -142,7 +142,8 @@ def regulator(paths, case_insensitive=True):
|
||||
print(f"Regulator is providing: {pattern}")
|
||||
return pattern
|
||||
|
||||
def generatePathReview(first_policy, second_policy, badpathparts, min_files_for_path):
|
||||
|
||||
def generatePathReview(first_policy, second_policy, badpathparts, path_exclusion_constant, min_files_for_path):
|
||||
|
||||
if not os.path.exists(f"parquet\\all_approved_hashes_{first_policy}_{second_policy}.parquet"):
|
||||
|
||||
@@ -151,8 +152,6 @@ def generatePathReview(first_policy, second_policy, badpathparts, min_files_for_
|
||||
|
||||
all_approved_hashes = pd.concat([df1 , df2], ignore_index=True).sort_values(by=['filename'])
|
||||
|
||||
|
||||
|
||||
print(ct.colorText(f"Approved hash lists have been combined","green"))
|
||||
|
||||
all_approved_hashes.to_parquet(f"parquet\\all_approved_hashes_{first_policy}_{second_policy}.parquet", index=False)
|
||||
@@ -162,8 +161,8 @@ def generatePathReview(first_policy, second_policy, badpathparts, min_files_for_
|
||||
if not os.path.exists(f"parquet\\path_needs_approved_{first_policy}_{second_policy}.parquet"):
|
||||
all_approved_hashes = pd.read_parquet(f"parquet\\all_approved_hashes_{first_policy}_{second_policy}.parquet")
|
||||
print(ct.colorText(f"Beginning calculating longest common filepaths for path exceptions","green"))
|
||||
|
||||
haslcp = pathf.split_filepaths_grouped(all_approved_hashes)
|
||||
|
||||
haslcp = pathf.split_filepaths_grouped(all_approved_hashes,"filename",path_exclusion_constant, min_files_for_path)
|
||||
haslcp.drop_duplicates()
|
||||
|
||||
forbidden = pathf.regulator(badpathparts, True)
|
||||
|
||||
Reference in New Issue
Block a user