Cleanup: #!s, prints, exceptions, more consistent naming

This commit is contained in:
surkeh
2018-05-16 22:10:46 -07:00
parent a5abb9d24f
commit 43afe7bf70
6 changed files with 33 additions and 38 deletions

View File

@@ -1,6 +1,5 @@
#!/usr/bin/python3
import ctypes
from .__init__ import libc
from __init__ import libc
#--------------------------------------+
# Basic Struct
@@ -141,7 +140,7 @@ del libc
# Pythonic Object
#--------------------------------------+
class GEOHeader:
class pyGeoHeader:
def __init__(self, filedata):
self.cstruct = ctypes.pointer(Header())
ptrofptr = ctypes.byref(self.cstruct)
@@ -171,7 +170,7 @@ class GEOHeader:
return hex(self.cstruct.contents.unknownOffset)
class MEShHeader:
class pyMeshHeader:
def __init__(self, i, filedata):
self.cstruct = ctypes.pointer(MeshHeader())
ptrofptr = ctypes.byref(self.cstruct)
@@ -198,11 +197,11 @@ class MEShHeader:
def getflags(self):
return self.cstruct.contents.flags
class MEsh:
class pyMesh:
def __init__(self, i, filedata):
self.cstruct = Mesh()
if filedata:
mh = MEShHeader(i, filedata)
mh = pyMeshHeader(i, filedata)
# allocate memory for the size of batch * number of batches
memsize = ctypes.sizeof(Batch) * mh.getbatchno()
self.cstruct.b = ctypes.cast(