forked from FreeCAD/FreeCAD
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Mesh: Workaround to load 3mf files not supported by zipios library
- Loading branch information
Showing
5 changed files
with
73 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,6 +35,7 @@ set(EXT_FILES | |
sketcher.py | ||
UiTools.py | ||
utils.py | ||
utils_zip.py | ||
) | ||
|
||
foreach (it ${EXT_FILES}) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# (c) 2024 Werner Mayer LGPL | ||
|
||
__author__ = "Werner Mayer" | ||
__url__ = "https://www.freecad.org" | ||
__doc__ = "Helper module to convert zip files" | ||
|
||
|
||
import zipfile | ||
|
||
def rewrite(source: str, target: str): | ||
source_zip = zipfile.ZipFile(source, "r") | ||
target_zip = zipfile.ZipFile(target, "w") | ||
|
||
for name in source_zip.namelist(): | ||
target_zip.writestr(name, source_zip.open(name).read()) | ||
|
||
source_zip.close() | ||
target_zip.close() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters