purem 2.0.3__py3-none-any.whl → 2.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- purem/core.py +16 -11
- purem/logger.py +6 -0
- {purem-2.0.3.dist-info → purem-2.1.0.dist-info}/METADATA +1 -1
- purem-2.1.0.dist-info/RECORD +12 -0
- purem-2.0.3.dist-info/RECORD +0 -12
- {purem-2.0.3.dist-info → purem-2.1.0.dist-info}/WHEEL +0 -0
- {purem-2.0.3.dist-info → purem-2.1.0.dist-info}/licenses/LICENSE +0 -0
- {purem-2.0.3.dist-info → purem-2.1.0.dist-info}/top_level.txt +0 -0
purem/core.py
CHANGED
@@ -201,25 +201,31 @@ class Purem:
|
|
201
201
|
|
202
202
|
def _download_and_extract_binary(self):
|
203
203
|
req = urllib.request.Request(
|
204
|
-
self._download_binary_url,
|
204
|
+
self._download_binary_url,
|
205
|
+
headers={"User-Agent": "Mozilla/5.0"}
|
205
206
|
)
|
206
207
|
|
207
|
-
|
208
|
-
with
|
209
|
-
|
210
|
-
|
211
|
-
with open(self._binary_archive_path_tmp, "rb") as f:
|
212
|
-
zip_utf = base64.b64decode(f.read())
|
208
|
+
try:
|
209
|
+
with urllib.request.urlopen(req, context=self._ctx) as response:
|
210
|
+
with open(self._binary_archive_path_tmp, "wb") as out_file:
|
211
|
+
shutil.copyfileobj(response, out_file)
|
213
212
|
|
214
|
-
|
215
|
-
|
213
|
+
shutil.move(self._binary_archive_path_tmp, self._binary_archive_path)
|
214
|
+
except Exception as e:
|
215
|
+
raise RuntimeError(
|
216
|
+
self._log.info(
|
217
|
+
f"The Purem archive appears to be corrupted or incomplete.\nDetails: {e}"
|
218
|
+
"Please ensure the package downloaded fully and is unmodified.\n"
|
219
|
+
"Need help? Contact support@worktif.com – we'll assist right away.\n"
|
220
|
+
)
|
221
|
+
)
|
216
222
|
|
217
223
|
try:
|
218
224
|
with zipfile.ZipFile(self._binary_archive_path, "r") as zip_ref:
|
219
225
|
zip_ref.extractall(
|
220
226
|
self._file_structure.dirs.project_root_binary_dir_path
|
221
227
|
)
|
222
|
-
self._log.
|
228
|
+
self._log.info_new_line(
|
223
229
|
f"Purem binary extracted to: {self._file_structure.dirs.binary_dir_path}"
|
224
230
|
)
|
225
231
|
except zipfile.BadZipFile as e:
|
@@ -232,4 +238,3 @@ class Purem:
|
|
232
238
|
)
|
233
239
|
|
234
240
|
self._binary_archive_path.unlink()
|
235
|
-
self._binary_archive_path_tmp.unlink()
|
purem/logger.py
CHANGED
@@ -25,6 +25,12 @@ class Logger:
|
|
25
25
|
else:
|
26
26
|
return f"[purem]: {self._default_info_message}\n"
|
27
27
|
|
28
|
+
def info_new_line(self, message: str) -> str:
|
29
|
+
if self._env.PUREM_VERBOSE is True:
|
30
|
+
return f"\n[purem]: {message}\n"
|
31
|
+
else:
|
32
|
+
return f"\n[purem]: {self._default_info_message}\n"
|
33
|
+
|
28
34
|
def printr(self, message: str) -> str or None:
|
29
35
|
if self._env.PUREM_VERBOSE is True:
|
30
36
|
print(self.info(message))
|
@@ -0,0 +1,12 @@
|
|
1
|
+
purem/__init__.py,sha256=-npGtjgo4iHpJHW1DabIA7aUXPDGzgDw8jClOVAg35I,142
|
2
|
+
purem/core.py,sha256=53S0D8TfzVl0TTm1Elf_zQRYFyTbZ3VlhdrpnVVNxEs,10036
|
3
|
+
purem/env_config.py,sha256=J5J_zSRzPYUCSUPZGd8m6dz6AmShgG9e0s7ll0BZL4Q,2668
|
4
|
+
purem/file_structure.py,sha256=8PRP9uk6PApOHwKF5Pfyg7CbZfgqTVwzV4NrYLJkTjY,3341
|
5
|
+
purem/loader.py,sha256=F-4dFzBtmxnB8r4Y620WJhJ6-yAiBjmvZYCi8Z1ykkU,1274
|
6
|
+
purem/logger.py,sha256=bs7jtx1cHmyuM6Irdcq60gTMURCai2pi5MIUB3TQcSQ,1243
|
7
|
+
purem/utils.py,sha256=Kv0DPvt8SpSfKp4ar03ZP26Aj60dxW5Gf8B9FKKUrDc,927
|
8
|
+
purem-2.1.0.dist-info/licenses/LICENSE,sha256=btmdQkvGxH-SryIGO_D4TpIzD7dZ8Y6z9M33WxCb1rI,1633
|
9
|
+
purem-2.1.0.dist-info/METADATA,sha256=Ppf1aPNuvJqxBS1obXUfC6WJQoYMGaomg2nZagvKgd0,5424
|
10
|
+
purem-2.1.0.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
|
11
|
+
purem-2.1.0.dist-info/top_level.txt,sha256=EjS75KEpZUEKSV2TFGW6w5aLqY9nUyO6Gq2ATz-KeZM,6
|
12
|
+
purem-2.1.0.dist-info/RECORD,,
|
purem-2.0.3.dist-info/RECORD
DELETED
@@ -1,12 +0,0 @@
|
|
1
|
-
purem/__init__.py,sha256=-npGtjgo4iHpJHW1DabIA7aUXPDGzgDw8jClOVAg35I,142
|
2
|
-
purem/core.py,sha256=pT_FWD6GHtRs2kWOMfHrGjrIdHAF85kqTl3OBiv_2ng,9761
|
3
|
-
purem/env_config.py,sha256=J5J_zSRzPYUCSUPZGd8m6dz6AmShgG9e0s7ll0BZL4Q,2668
|
4
|
-
purem/file_structure.py,sha256=8PRP9uk6PApOHwKF5Pfyg7CbZfgqTVwzV4NrYLJkTjY,3341
|
5
|
-
purem/loader.py,sha256=F-4dFzBtmxnB8r4Y620WJhJ6-yAiBjmvZYCi8Z1ykkU,1274
|
6
|
-
purem/logger.py,sha256=muhL_QsqKgo-ElSee7SDwwFopGgbPQf6xXB7IlTuC5k,1025
|
7
|
-
purem/utils.py,sha256=Kv0DPvt8SpSfKp4ar03ZP26Aj60dxW5Gf8B9FKKUrDc,927
|
8
|
-
purem-2.0.3.dist-info/licenses/LICENSE,sha256=btmdQkvGxH-SryIGO_D4TpIzD7dZ8Y6z9M33WxCb1rI,1633
|
9
|
-
purem-2.0.3.dist-info/METADATA,sha256=ZHjSCMOEHuN5KKZR2vleLwa2KIHp8TNgrOYrboM905I,5424
|
10
|
-
purem-2.0.3.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
|
11
|
-
purem-2.0.3.dist-info/top_level.txt,sha256=EjS75KEpZUEKSV2TFGW6w5aLqY9nUyO6Gq2ATz-KeZM,6
|
12
|
-
purem-2.0.3.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|