38 lines
928 B
Python
38 lines
928 B
Python
# Python imports
|
|
import faulthandler
|
|
import traceback
|
|
|
|
# Gtk imports
|
|
|
|
# Application imports
|
|
from . import msh2_unpack
|
|
|
|
|
|
class MSH2():
|
|
"""docstring for MSH2."""
|
|
|
|
def __init__(self, arg):
|
|
faulthandler.enable() # For better debug info
|
|
self.arg = arg
|
|
self.msh_config = {'do_logging': True, 'ignore_geo': False, 'triangulate': False}
|
|
self.msh = None
|
|
|
|
|
|
def import_file(self, file_name):
|
|
try:
|
|
self.msh = msh2_unpack.MSHUnpack(file_name, self.msh_config).unpack()
|
|
except Exception as e:
|
|
traceback.print_exc()
|
|
|
|
def export_file(self, file_name):
|
|
try:
|
|
self.msh.save(file_name)
|
|
except Exception as e:
|
|
traceback.print_exc()
|
|
|
|
def export_file_to_binary_json(self, file_name):
|
|
try:
|
|
self.msh.save_json(file_name)
|
|
except Exception as e:
|
|
traceback.print_exc()
|