From 0260327cff34787394cf9aaa3e8cc5bd35cb0a25 Mon Sep 17 00:00:00 2001 From: Mikhail Rachinskiy Date: Tue, 15 Oct 2019 14:09:44 +0400 Subject: STL: cleanup and PEP8 Unused imports, move rare imports inside functions, correct description. --- io_mesh_stl/stl_utils.py | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) (limited to 'io_mesh_stl/stl_utils.py') diff --git a/io_mesh_stl/stl_utils.py b/io_mesh_stl/stl_utils.py index 0c108e83..ee693375 100644 --- a/io_mesh_stl/stl_utils.py +++ b/io_mesh_stl/stl_utils.py @@ -26,14 +26,9 @@ Used as a blender script, it load all the stl files in the scene: blender --python stl_utils.py -- file1.stl file2.stl file3.stl ... """ -import os -import struct -import contextlib -import itertools -from mathutils.geometry import normal - # TODO: endien + class ListDict(dict): """ Set struct with order. @@ -88,6 +83,10 @@ def _is_ascii_file(data): represents a binary file. It can be a (very *RARE* in real life, but can easily be forged) ascii file. """ + + import os + import struct + # Skip header... data.seek(BINARY_HEADER) size = struct.unpack('