Skip to content

Commit 254e742

Browse files
authored
Merge pull request #10 from ross-mcnairn-dev/parametrise_target
Parametrise target
2 parents 3998921 + 30d2a45 commit 254e742

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/python_redlines/engines.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414

1515

1616
class XmlPowerToolsEngine(object):
17-
def __init__(self):
17+
def __init__(self, target_path: Optional[str] = None):
18+
self.target_path = target_path
1819
self.extracted_binaries_path = self.__unzip_binary()
1920

2021
def __unzip_binary(self):
@@ -23,7 +24,7 @@ def __unzip_binary(self):
2324
"""
2425
base_path = os.path.dirname(__file__)
2526
binaries_path = os.path.join(base_path, 'dist')
26-
target_path = os.path.join(base_path, 'bin')
27+
target_path = self.target_path if self.target_path else os.path.join(base_path, 'bin')
2728

2829
if not os.path.exists(target_path):
2930
os.makedirs(target_path)
@@ -47,7 +48,6 @@ def __extract_binary(self, zip_path: str, target_path: str):
4748
zip_path: str - The path to the zip file
4849
target_path: str - The path to extract the binary to
4950
"""
50-
print(f"")
5151
if zip_path.endswith('.zip'):
5252
with zipfile.ZipFile(zip_path, 'r') as zip_ref:
5353
zip_ref.extractall(target_path)

0 commit comments

Comments
 (0)