ddi-fw 0.0.25__py3-none-any.whl → 0.0.26__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.
- ddi_fw/utils/zip_helper.py +11 -4
- {ddi_fw-0.0.25.dist-info → ddi_fw-0.0.26.dist-info}/METADATA +1 -1
- {ddi_fw-0.0.25.dist-info → ddi_fw-0.0.26.dist-info}/RECORD +5 -5
- {ddi_fw-0.0.25.dist-info → ddi_fw-0.0.26.dist-info}/WHEEL +0 -0
- {ddi_fw-0.0.25.dist-info → ddi_fw-0.0.26.dist-info}/top_level.txt +0 -0
ddi_fw/utils/zip_helper.py
CHANGED
@@ -89,6 +89,13 @@ class ZipHelper:
|
|
89
89
|
for file_path in value:
|
90
90
|
zipObj.write(file_path, basename(file_path))
|
91
91
|
|
92
|
+
def extract_single_file(self, file_path, output_path):
|
93
|
+
with z.ZipFile(file_path, 'r') as z1:
|
94
|
+
z1.extractall(path=output_path)
|
95
|
+
|
96
|
+
'''
|
97
|
+
Extract zip files from the given path to the output path
|
98
|
+
'''
|
92
99
|
def extract(self, input_path, output_path):
|
93
100
|
files_paths = [input_path+'/' + p for p in os.listdir(input_path)]
|
94
101
|
if not os.path.exists(output_path):
|
@@ -99,13 +106,13 @@ class ZipHelper:
|
|
99
106
|
z1.extractall(path=output_path)
|
100
107
|
print(f'{file_path} has been extracted')
|
101
108
|
|
102
|
-
def extract_multiparts(self,
|
103
|
-
|
109
|
+
def extract_multiparts(self, input_path, output_path, output_file):
|
110
|
+
parts = [input_path+'/' + p for p in os.listdir(input_path)]
|
104
111
|
with open(f"{output_path}/{output_file}", 'wb') as outfile:
|
105
|
-
for part in
|
112
|
+
for part in parts:
|
106
113
|
with open(part, 'rb') as infile:
|
107
114
|
outfile.write(infile.read())
|
108
|
-
self.
|
115
|
+
self.extract_single_file(f"{output_path}/{output_file}", output_path)
|
109
116
|
|
110
117
|
|
111
118
|
# if __name__ == "__main__":
|
@@ -78,8 +78,8 @@ ddi_fw/test/type_guarding_test.py,sha256=KxjyBxohDu7lwpejalCj-REjtJ-k1S1wQbOB6TG
|
|
78
78
|
ddi_fw/utils/__init__.py,sha256=nhNU_sEp55xsZ5VtvhozjKg6r4GWP6SJI13v8F_jbCg,217
|
79
79
|
ddi_fw/utils/enums.py,sha256=19eJ3fX5eRK_xPvkYcukmug144jXPH4X9zQqtsFBj5A,671
|
80
80
|
ddi_fw/utils/utils.py,sha256=Na6Y8mY-CFbQjrgd9xC8agcrjVvTj_7KIXqFm1H_3qU,3549
|
81
|
-
ddi_fw/utils/zip_helper.py,sha256=
|
82
|
-
ddi_fw-0.0.
|
83
|
-
ddi_fw-0.0.
|
84
|
-
ddi_fw-0.0.
|
85
|
-
ddi_fw-0.0.
|
81
|
+
ddi_fw/utils/zip_helper.py,sha256=tnzA5SwiIbXxNygR9WGQmT7wQ9BEssJHNziQDHlavTM,5378
|
82
|
+
ddi_fw-0.0.26.dist-info/METADATA,sha256=Q6MCymz9sAM4SVPw0miBH8gVhq4W9ZmkF5NV9s9e8Rc,1541
|
83
|
+
ddi_fw-0.0.26.dist-info/WHEEL,sha256=cVxcB9AmuTcXqmwrtPhNK88dr7IR_b6qagTj0UvIEbY,91
|
84
|
+
ddi_fw-0.0.26.dist-info/top_level.txt,sha256=PMwHICFZTZtcpzQNPV4UQnfNXYIeLR_Ste-Wfc1h810,7
|
85
|
+
ddi_fw-0.0.26.dist-info/RECORD,,
|
File without changes
|
File without changes
|