Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/python_redlines/engines.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@


class XmlPowerToolsEngine(object):
def __init__(self):
def __init__(self, target_path: Optional[str] = None):
self.target_path = target_path
self.extracted_binaries_path = self.__unzip_binary()

def __unzip_binary(self):
Expand All @@ -23,7 +24,7 @@ def __unzip_binary(self):
"""
base_path = os.path.dirname(__file__)
binaries_path = os.path.join(base_path, 'dist')
target_path = os.path.join(base_path, 'bin')
target_path = self.target_path if self.target_path else os.path.join(base_path, 'bin')

if not os.path.exists(target_path):
os.makedirs(target_path)
Expand All @@ -47,7 +48,6 @@ def __extract_binary(self, zip_path: str, target_path: str):
zip_path: str - The path to the zip file
target_path: str - The path to extract the binary to
"""
print(f"")
if zip_path.endswith('.zip'):
with zipfile.ZipFile(zip_path, 'r') as zip_ref:
zip_ref.extractall(target_path)
Expand Down