OSDN Git Service

fix refactoring
[meshio/pymeshio.git] / pymeshio / mqo / reader.py
index b3e0919..1b7e365 100644 (file)
@@ -20,7 +20,7 @@ class Reader(object):
     """\r
     __slots__=[\r
             "has_mikoto",\r
-            "eof", "io", "lines",\r
+            "eof", "ios", "lines",\r
             "materials", "objects",\r
             ]\r
     def __init__(self, ios):\r
@@ -169,11 +169,12 @@ class Reader(object):
 \r
 \r
 def read_from_file(path):\r
-    with open(path, 'rb') as ios:\r
-        read(ios)\r
+    with io.open(path, 'rb') as ios:\r
+        return read(ios)\r
 \r
 \r
 def read(ios):\r
+    print(type(ios), ios)\r
     assert(isinstance(ios, io.IOBase))\r
     reader=Reader(ios)\r
     model=pymeshio.mqo.Model()\r