Commit ccc32e10 authored by John Tourtellott's avatar John Tourtellott

Remove debug lines and unused code

Also update Truchas testwriter's resource reader to use model manager
parent 95d8f4c6
......@@ -15,9 +15,6 @@ Export script for Shallow Water 2D applications
import imp
import os
import sys
sys.path.append('/media/ssd/sim/projects/erdc/build/pybind-superbuild/install/lib')
for path in sys.path:
print path
import smtk
if 'pybind11' == smtk.wrappingProtocol():
import smtk.io
......@@ -32,10 +29,9 @@ module_name = 'adhcommon'
abs_path = os.path.abspath(__file__)
abs_dir = os.path.dirname(abs_path)
module_args = imp.find_module(module_name, [abs_dir])
print 'module_args', module_args
imp.load_module(module_name, *module_args)
adh = sys.modules.get(module_name)
print 'adh', adh
#print 'adh', adh
# Define placeholder/passthrough functions for custom writer functions
# Actual implementations, prefixed by "_", are further below
......@@ -144,7 +140,7 @@ def ExportCMB(spec):
----------
spec: Top-level object passed in from CMB
'''
print 'Enter ExportCMB()'
#print 'Enter ExportCMB()'
# Initialize scope instance to store spec values and other info
scope = adh.init_scope(spec)
......
......@@ -9,10 +9,6 @@
# PURPOSE. See the above copyright notice for more information.
#
#=============================================================================
print 'ENTER dakotaExporter.py'
import bisect
import math
import random
import string
import smtk
......
......@@ -8,7 +8,6 @@ if 'pybind11' == smtk.wrappingProtocol():
import smtk.model
import smtk.io
import smtk.bridge.exodus
print 'exodus', smtk.bridge.exodus
# Add path to Truchas.py script
abs_path = os.path.abspath(__file__)
......@@ -54,12 +53,22 @@ def load_resources(model_manager, resource_file):
reader = smtk.io.ResourceSetReader()
logger = smtk.io.Logger()
hasErrors = reader.readFile(resource_file, resources, logger)
if hasErrors:
print "Reader has errors:"
print logger.convertToString()
#has_errors = reader.readFile(resource_file, resources, logger)
with open(resource_file) as instream:
content = instream.read()
return resources
simatts = smtk.attribute.System()
simatts.setRefModelManager(model_manager)
resource_map = {'simbuilder': simatts}
has_errors = reader.readString(content, resources, logger, True, resource_map)
if has_errors:
print "Reader has errors:"
print logger.convertToString()
return resources
# (else)
return None
#----------------------------------------------------------------------
def load_attributes(model_manager, att_file):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment