##########################################################################
#
#  Copyright (c) 2010-2012, Image Engine Design Inc. All rights reserved.
#
#  Redistribution and use in source and binary forms, with or without
#  modification, are permitted provided that the following conditions are
#  met:
#
#     * Redistributions of source code must retain the above copyright
#       notice, this list of conditions and the following disclaimer.
#
#     * Redistributions in binary form must reproduce the above copyright
#       notice, this list of conditions and the following disclaimer in the
#       documentation and/or other materials provided with the distribution.
#
#     * Neither the name of Image Engine Design nor the names of any
#       other contributors to this software may be used to endorse or
#       promote products derived from this software without specific prior
#       written permission.
#
#  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
#  IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
#  THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
#  PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
#  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
#  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
#  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
#  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
#  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
#  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
#  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
##########################################################################

from __future__ import with_statement

import os
import sys
import shutil
import unittest
import IECore

class TestBasicPreset( unittest.TestCase ) :

	def testCopy( self ) :

		testObj = IECore.Parameterised( "testParameterised1" )
		testObj.parameters().addParameters(
			[
				IECore.BoolParameter( "a", "", True ),
				IECore.FloatParameter( "b", "", 1.0 ),
			]
		)

		testObj2 = IECore.Parameterised( "testParameterised2" )
		testObj2.parameters().addParameters(
			[
				IECore.BoolParameter( "a", "", False ),
				IECore.FloatParameter( "c", "", 0.0	),
			]
		)

		p = IECore.BasicPreset( testObj, testObj.parameters() )

		self.assertTrue( p.applicableTo( testObj, testObj.parameters() ) )
		self.assertFalse( p.applicableTo( testObj2, testObj2.parameters() ) )

		testObj.parameters()["a"].setTypedValue( False )
		testObj.parameters()["b"].setTypedValue( 0.0 )

		p( testObj, testObj.parameters() )

		self.assertEqual( testObj.parameters()["a"].getTypedValue(), True )
		self.assertEqual( testObj.parameters()["b"].getTypedValue(), 1.0 )

		p2 = IECore.BasicPreset( testObj, testObj.parameters(), parameters=( testObj.parameters()["a"], ) )

		self.assertTrue( p2.applicableTo( testObj, testObj.parameters() ) )
		self.assertTrue( p2.applicableTo( testObj2, testObj.parameters() ) )

		p2( testObj2, testObj2.parameters() )

		self.assertEqual( testObj2.parameters()["a"].getTypedValue(), True )
		self.assertEqual( testObj2.parameters()["c"].getTypedValue(), 0.0 )

	def testLoad( self ) :

		testObj = IECore.Parameterised( "testParameterised1" )
		testObj.parameters().addParameters(
			[
				IECore.BoolParameter( "a", "", True ),
				IECore.FloatParameter( "b", "", 1.0 ),
			]
		)

		testObj2 = IECore.Parameterised( "testParameterised1" )
		testObj2.parameters().addParameters(
			[
				IECore.BoolParameter( "a", "", False ),
				IECore.FloatParameter( "c", "", 0.0	),
			]
		)

		savePath = os.path.abspath( os.path.join( os.path.dirname( __file__ ), "data", "basicPreset" ) )

		messageHandler = IECore.CapturingMessageHandler()
		with messageHandler :

			p = IECore.BasicPreset( os.path.join( savePath, "basicPresetLoadTest", "basicPresetLoadTest-1.cob" ) )

		self.assertEqual( len( messageHandler.messages ), 0 )

		self.assertTrue( p.applicableTo( testObj, testObj.parameters() ) )
		self.assertFalse( p.applicableTo( testObj2, testObj2.parameters() ) )

		testObj.parameters()["a"].setTypedValue( False )
		testObj.parameters()["b"].setTypedValue( 0.0 )

		p( testObj, testObj.parameters() )

		self.assertEqual( testObj.parameters()["a"].getTypedValue(), True )
		self.assertEqual( testObj.parameters()["b"].getTypedValue(), 1.0 )

	def testSave( self ) :

		testObj = IECore.Parameterised( "testParameterised1" )
		testObj.parameters().addParameters(
			[
				IECore.BoolParameter( "a", "", True ),
				IECore.FloatParameter( "b", "", 1.0 ),
			]
		)

		testObj2 = IECore.Parameterised( "testParameterised1" )
		testObj2.parameters().addParameters(
			[
				IECore.BoolParameter( "a", "", False ),
				IECore.FloatParameter( "c", "", 0.0	),
			]
		)

		savePath = os.path.abspath( os.path.join( os.path.dirname( __file__ ), "data", "basicPreset" ) )

		preset = IECore.BasicPreset( testObj, testObj.parameters() )

		# Save for the classLoader and check its there, we test the 'loadability' later...
		preset.save( savePath, "basicPresetTest" )
		self.assertTrue( os.path.isfile( os.path.join( savePath, "basicPresetTest", "basicPresetTest-1.cob" ) ) )
		self.assertTrue( os.path.isfile( os.path.join( savePath, "basicPresetTest", "basicPresetTest-1.py" ) ) )

		# save without the classLoader and check its there
		preset.save( savePath, "basicPresetTest", classLoadable=False )
		self.assertTrue( os.path.isfile( os.path.join( savePath, "basicPresetTest.cob" ) ) )

		# reload
		p = IECore.BasicPreset( os.path.join( savePath, "basicPresetTest.cob" ) )

		self.assertTrue( p.applicableTo( testObj, testObj.parameters() ) )
		self.assertFalse( p.applicableTo( testObj2, testObj2.parameters() ) )

		testObj.parameters()["a"].setTypedValue( False )
		testObj.parameters()["b"].setTypedValue( 0.0 )

		p( testObj, testObj.parameters() )

		self.assertEqual( testObj.parameters()["a"].getTypedValue(), True )
		self.assertEqual( testObj.parameters()["b"].getTypedValue(), 1.0 )

		preset2 = IECore.BasicPreset( testObj, testObj.parameters(), parameters=( testObj.parameters()["a"], ) )
		preset2.save( savePath, "basicPresetTest2", classLoadable=False )

		#reload
		p2 = IECore.BasicPreset( os.path.join( savePath, "basicPresetTest2.cob" ) )

		self.assertTrue( p2.applicableTo( testObj, testObj.parameters() ) )
		self.assertTrue( p2.applicableTo( testObj2, testObj.parameters() ) )

		p2( testObj2, testObj2.parameters() )

		self.assertEqual( testObj2.parameters()["a"].getTypedValue(), True )
		self.assertEqual( testObj2.parameters()["c"].getTypedValue(), 0.0 )

	def testClassLoader( self ) :

		testObj = IECore.Parameterised( "testParameterised1" )
		testObj.parameters().addParameters(
			[
				IECore.BoolParameter( "a", "", True ),
				IECore.FloatParameter( "b", "", 1.0 ),
			]
		)

		savePath = os.path.abspath( os.path.join( os.path.dirname( __file__ ), "data", "basicPreset" ) )
		preset = IECore.BasicPreset( testObj, testObj.parameters() )
		preset.save( savePath, "basicPresetTestClassLoader" )

		# make sure that no messages are emitted during loading
		messageHandler = IECore.CapturingMessageHandler()
		with messageHandler :

			loader = IECore.ClassLoader( IECore.SearchPath( savePath ) )
			p = loader.load( "basicPresetTestClassLoader" )()

		self.assertEqual( len( messageHandler.messages ), 0 )

		self.assertTrue( isinstance( p, IECore.BasicPreset ) )

		p.metadata()

	def testClasses( self ) :

		testObj = IECore.Parameterised( "testParameterised1" )
		testObj.parameters().addParameters(
			[
				IECore.BoolParameter( "a", "", True ),
				IECore.ClassParameter( "b", "", "IECORE_OP_PATHS", os.path.join( "maths", "multiply" ), 2 ),
			]
		)

		testObj2 = IECore.Parameterised( "testParameterised2" )
		testObj2.parameters().addParameters(
			[
				IECore.ClassParameter( "c", "",	"IECORE_OP_PATHS" ),
			]
		)

		classes1 = testObj.parameters()["b"].getClass( True )
		classes2 = testObj2.parameters()["c"].getClass( True )
		self.assertNotEqual( classes1[1:], classes2[1:] )

		p = IECore.BasicPreset( testObj, testObj.parameters()["b"] )

		self.assertTrue( p.applicableTo( testObj, testObj.parameters()["b"] ) )
		self.assertFalse( p.applicableTo( testObj, testObj.parameters() ) )
		self.assertTrue( p.applicableTo( testObj2, testObj2.parameters()["c"] ) )

		p( testObj2, testObj2.parameters()["c"] )

		classes1 = testObj.parameters()["b"].getClass( True )
		classes2 = testObj2.parameters()["c"].getClass( True )

		self.assertEqual( classes1[1:], classes2[1:] )

	def testClassVectors( self ) :

		testObj = IECore.Parameterised( "testParameterised1" )
		testObj.parameters().addParameters(
			[
				IECore.BoolParameter( "a", "", True ),
				IECore.ClassVectorParameter( "b", "", "IECORE_OP_PATHS" ),
			]
		)

		testObj.parameters()["b"].setClasses(
			[
				( "mult", os.path.join( "maths", "multiply" ), 2 ),
				( "coIO", "compoundObjectInOut", 1 ),
			]
		)

		testObj2 = IECore.Parameterised( "testParameterised2" )
		testObj2.parameters().addParameters(
			[
				IECore.ClassVectorParameter( "c", "", "IECORE_OP_PATHS" ),
			]
		)

		classes1 = [ c[1:] for c in testObj.parameters()["b"].getClasses( True ) ]
		classes2 = [ c[1:] for c in testObj2.parameters()["c"].getClasses( True ) ]

		self.assertNotEqual( classes1, classes2 )

		p = IECore.BasicPreset( testObj, testObj.parameters()["b"] )

		self.assertTrue( p.applicableTo( testObj, testObj.parameters()["b"] ) )
		self.assertFalse( p.applicableTo( testObj, testObj.parameters() ) )
		self.assertTrue( p.applicableTo( testObj2, testObj2.parameters()["c"] ) )

		p( testObj2, testObj2.parameters()["c"] )

		classes1 = [ c[1:] for c in testObj.parameters()["b"].getClasses( True ) ]
		classes2 = [ c[1:] for c in testObj2.parameters()["c"].getClasses( True ) ]

		self.assertEqual( classes1, classes2 )

	def testCompoundVectorParameter( self ) :

		p = IECore.Parameterised( "test" )
		p.parameters().addParameters(
			[
				IECore.BoolParameter( "a", "", False ),
				IECore.CompoundVectorParameter(
					"c",
					"",
					members = [
						IECore.StringVectorParameter( "s", "", IECore.StringVectorData() ),
						IECore.BoolVectorParameter( "b", "", IECore.BoolVectorData() ),
					]
				)
			]
		)

		p["c"]["s"].setValue( IECore.StringVectorData( [ "1", "2", "3" ] ) )
		p["c"]["b"].setValue( IECore.BoolVectorData( [ True, False, True ] ) )

		v = p.parameters().getValue().copy()

		preset = IECore.BasicPreset( p, p.parameters() )

		self.assertTrue( preset.applicableTo( p, p.parameters() ) )

		p.parameters().setValue( p.parameters().defaultValue )
		self.assertNotEqual( p.parameters().getValue(), v )

		preset( p, p.parameters() )

		self.assertEqual( p.parameters().getValue(), v )

	def tearDown( self ) :

		savePath = os.path.abspath( os.path.join( os.path.dirname( __file__ ), "data", "basicPreset" ) )
		paths = (
			os.path.join( savePath, "basicPresetTest" ),
			os.path.join( savePath, "basicPresetTest.cob" ),
			os.path.join( savePath, "basicPresetTest2.cob" ),
			os.path.join( savePath, "basicPresetTestClassLoader" ),
		)

		for p in paths :
			if os.path.isdir( p ) :
				shutil.rmtree( p )
			elif os.path.isfile( p ) :
				os.remove( p )

if __name__ == "__main__":
	unittest.main()

[((336, 1, 336, 16), 'unittest.main', 'unittest.main', ({}, {}), '()', False, 'import unittest\n'), ((47, 12, 47, 56), 'IECore.Parameterised', 'IECore.Parameterised', ({(47, 34, 47, 54): '"""testParameterised1"""'}, {}), "('testParameterised1')", False, 'import IECore\n'), ((55, 13, 55, 57), 'IECore.Parameterised', 'IECore.Parameterised', ({(55, 35, 55, 55): '"""testParameterised2"""'}, {}), "('testParameterised2')", False, 'import IECore\n'), ((88, 12, 88, 56), 'IECore.Parameterised', 'IECore.Parameterised', ({(88, 34, 88, 54): '"""testParameterised1"""'}, {}), "('testParameterised1')", False, 'import IECore\n'), ((96, 13, 96, 57), 'IECore.Parameterised', 'IECore.Parameterised', ({(96, 35, 96, 55): '"""testParameterised1"""'}, {}), "('testParameterised1')", False, 'import IECore\n'), ((106, 19, 106, 51), 'IECore.CapturingMessageHandler', 'IECore.CapturingMessageHandler', ({}, {}), '()', False, 'import IECore\n'), ((126, 12, 126, 56), 'IECore.Parameterised', 'IECore.Parameterised', ({(126, 34, 126, 54): '"""testParameterised1"""'}, {}), "('testParameterised1')", False, 'import IECore\n'), ((134, 13, 134, 57), 'IECore.Parameterised', 'IECore.Parameterised', ({(134, 35, 134, 55): '"""testParameterised1"""'}, {}), "('testParameterised1')", False, 'import IECore\n'), ((185, 12, 185, 56), 'IECore.Parameterised', 'IECore.Parameterised', ({(185, 34, 185, 54): '"""testParameterised1"""'}, {}), "('testParameterised1')", False, 'import IECore\n'), ((198, 19, 198, 51), 'IECore.CapturingMessageHandler', 'IECore.CapturingMessageHandler', ({}, {}), '()', False, 'import IECore\n'), ((212, 12, 212, 56), 'IECore.Parameterised', 'IECore.Parameterised', ({(212, 34, 212, 54): '"""testParameterised1"""'}, {}), "('testParameterised1')", False, 'import IECore\n'), ((220, 13, 220, 57), 'IECore.Parameterised', 'IECore.Parameterised', ({(220, 35, 220, 55): '"""testParameterised2"""'}, {}), "('testParameterised2')", False, 'import IECore\n'), ((246, 12, 246, 56), 'IECore.Parameterised', 'IECore.Parameterised', ({(246, 34, 246, 54): '"""testParameterised1"""'}, {}), "('testParameterised1')", False, 'import IECore\n'), ((261, 13, 261, 57), 'IECore.Parameterised', 'IECore.Parameterised', ({(261, 35, 261, 55): '"""testParameterised2"""'}, {}), "('testParameterised2')", False, 'import IECore\n'), ((288, 6, 288, 36), 'IECore.Parameterised', 'IECore.Parameterised', ({(288, 28, 288, 34): '"""test"""'}, {}), "('test')", False, 'import IECore\n'), ((156, 26, 156, 73), 'os.path.join', 'os.path.join', ({(156, 40, 156, 48): 'savePath', (156, 50, 156, 71): '"""basicPresetTest.cob"""'}, {}), "(savePath, 'basicPresetTest.cob')", False, 'import os\n'), ((173, 27, 173, 75), 'os.path.join', 'os.path.join', ({(173, 41, 173, 49): 'savePath', (173, 51, 173, 73): '"""basicPresetTest2.cob"""'}, {}), "(savePath, 'basicPresetTest2.cob')", False, 'import os\n'), ((303, 24, 303, 68), 'IECore.StringVectorData', 'IECore.StringVectorData', ({(303, 49, 303, 66): "['1', '2', '3']"}, {}), "(['1', '2', '3'])", False, 'import IECore\n'), ((304, 24, 304, 70), 'IECore.BoolVectorData', 'IECore.BoolVectorData', ({(304, 47, 304, 68): '[True, False, True]'}, {}), '([True, False, True])', False, 'import IECore\n'), ((323, 3, 323, 46), 'os.path.join', 'os.path.join', ({(323, 17, 323, 25): 'savePath', (323, 27, 323, 44): '"""basicPresetTest"""'}, {}), "(savePath, 'basicPresetTest')", False, 'import os\n'), ((324, 3, 324, 50), 'os.path.join', 'os.path.join', ({(324, 17, 324, 25): 'savePath', (324, 27, 324, 48): '"""basicPresetTest.cob"""'}, {}), "(savePath, 'basicPresetTest.cob')", False, 'import os\n'), ((325, 3, 325, 51), 'os.path.join', 'os.path.join', ({(325, 17, 325, 25): 'savePath', (325, 27, 325, 49): '"""basicPresetTest2.cob"""'}, {}), "(savePath, 'basicPresetTest2.cob')", False, 'import os\n'), ((326, 3, 326, 57), 'os.path.join', 'os.path.join', ({(326, 17, 326, 25): 'savePath', (326, 27, 326, 55): '"""basicPresetTestClassLoader"""'}, {}), "(savePath, 'basicPresetTestClassLoader')", False, 'import os\n'), ((330, 6, 330, 24), 'os.path.isdir', 'os.path.isdir', ({(330, 21, 330, 22): 'p'}, {}), '(p)', False, 'import os\n'), ((50, 4, 50, 41), 'IECore.BoolParameter', 'IECore.BoolParameter', ({(50, 26, 50, 29): '"""a"""', (50, 31, 50, 33): '""""""', (50, 35, 50, 39): '(True)'}, {}), "('a', '', True)", False, 'import IECore\n'), ((51, 4, 51, 41), 'IECore.FloatParameter', 'IECore.FloatParameter', ({(51, 27, 51, 30): '"""b"""', (51, 32, 51, 34): '""""""', (51, 36, 51, 39): '(1.0)'}, {}), "('b', '', 1.0)", False, 'import IECore\n'), ((58, 4, 58, 42), 'IECore.BoolParameter', 'IECore.BoolParameter', ({(58, 26, 58, 29): '"""a"""', (58, 31, 58, 33): '""""""', (58, 35, 58, 40): '(False)'}, {}), "('a', '', False)", False, 'import IECore\n'), ((59, 4, 59, 41), 'IECore.FloatParameter', 'IECore.FloatParameter', ({(59, 27, 59, 30): '"""c"""', (59, 32, 59, 34): '""""""', (59, 36, 59, 39): '(0.0)'}, {}), "('c', '', 0.0)", False, 'import IECore\n'), ((91, 4, 91, 41), 'IECore.BoolParameter', 'IECore.BoolParameter', ({(91, 26, 91, 29): '"""a"""', (91, 31, 91, 33): '""""""', (91, 35, 91, 39): '(True)'}, {}), "('a', '', True)", False, 'import IECore\n'), ((92, 4, 92, 41), 'IECore.FloatParameter', 'IECore.FloatParameter', ({(92, 27, 92, 30): '"""b"""', (92, 32, 92, 34): '""""""', (92, 36, 92, 39): '(1.0)'}, {}), "('b', '', 1.0)", False, 'import IECore\n'), ((99, 4, 99, 42), 'IECore.BoolParameter', 'IECore.BoolParameter', ({(99, 26, 99, 29): '"""a"""', (99, 31, 99, 33): '""""""', (99, 35, 99, 40): '(False)'}, {}), "('a', '', False)", False, 'import IECore\n'), ((100, 4, 100, 41), 'IECore.FloatParameter', 'IECore.FloatParameter', ({(100, 27, 100, 30): '"""c"""', (100, 32, 100, 34): '""""""', (100, 36, 100, 39): '(0.0)'}, {}), "('c', '', 0.0)", False, 'import IECore\n'), ((104, 44, 104, 71), 'os.path.dirname', 'os.path.dirname', ({(104, 61, 104, 69): '__file__'}, {}), '(__file__)', False, 'import os\n'), ((109, 27, 109, 103), 'os.path.join', 'os.path.join', ({(109, 41, 109, 49): 'savePath', (109, 51, 109, 72): '"""basicPresetLoadTest"""', (109, 74, 109, 101): '"""basicPresetLoadTest-1.cob"""'}, {}), "(savePath, 'basicPresetLoadTest', 'basicPresetLoadTest-1.cob')", False, 'import os\n'), ((129, 4, 129, 41), 'IECore.BoolParameter', 'IECore.BoolParameter', ({(129, 26, 129, 29): '"""a"""', (129, 31, 129, 33): '""""""', (129, 35, 129, 39): '(True)'}, {}), "('a', '', True)", False, 'import IECore\n'), ((130, 4, 130, 41), 'IECore.FloatParameter', 'IECore.FloatParameter', ({(130, 27, 130, 30): '"""b"""', (130, 32, 130, 34): '""""""', (130, 36, 130, 39): '(1.0)'}, {}), "('b', '', 1.0)", False, 'import IECore\n'), ((137, 4, 137, 42), 'IECore.BoolParameter', 'IECore.BoolParameter', ({(137, 26, 137, 29): '"""a"""', (137, 31, 137, 33): '""""""', (137, 35, 137, 40): '(False)'}, {}), "('a', '', False)", False, 'import IECore\n'), ((138, 4, 138, 41), 'IECore.FloatParameter', 'IECore.FloatParameter', ({(138, 27, 138, 30): '"""c"""', (138, 32, 138, 34): '""""""', (138, 36, 138, 39): '(0.0)'}, {}), "('c', '', 0.0)", False, 'import IECore\n'), ((142, 44, 142, 71), 'os.path.dirname', 'os.path.dirname', ({(142, 61, 142, 69): '__file__'}, {}), '(__file__)', False, 'import os\n'), ((148, 35, 148, 103), 'os.path.join', 'os.path.join', ({(148, 49, 148, 57): 'savePath', (148, 59, 148, 76): '"""basicPresetTest"""', (148, 78, 148, 101): '"""basicPresetTest-1.cob"""'}, {}), "(savePath, 'basicPresetTest', 'basicPresetTest-1.cob')", False, 'import os\n'), ((149, 35, 149, 102), 'os.path.join', 'os.path.join', ({(149, 49, 149, 57): 'savePath', (149, 59, 149, 76): '"""basicPresetTest"""', (149, 78, 149, 100): '"""basicPresetTest-1.py"""'}, {}), "(savePath, 'basicPresetTest', 'basicPresetTest-1.py')", False, 'import os\n'), ((153, 35, 153, 82), 'os.path.join', 'os.path.join', ({(153, 49, 153, 57): 'savePath', (153, 59, 153, 80): '"""basicPresetTest.cob"""'}, {}), "(savePath, 'basicPresetTest.cob')", False, 'import os\n'), ((188, 4, 188, 41), 'IECore.BoolParameter', 'IECore.BoolParameter', ({(188, 26, 188, 29): '"""a"""', (188, 31, 188, 33): '""""""', (188, 35, 188, 39): '(True)'}, {}), "('a', '', True)", False, 'import IECore\n'), ((189, 4, 189, 41), 'IECore.FloatParameter', 'IECore.FloatParameter', ({(189, 27, 189, 30): '"""b"""', (189, 32, 189, 34): '""""""', (189, 36, 189, 39): '(1.0)'}, {}), "('b', '', 1.0)", False, 'import IECore\n'), ((193, 44, 193, 71), 'os.path.dirname', 'os.path.dirname', ({(193, 61, 193, 69): '__file__'}, {}), '(__file__)', False, 'import os\n'), ((201, 32, 201, 61), 'IECore.SearchPath', 'IECore.SearchPath', ({(201, 51, 201, 59): 'savePath'}, {}), '(savePath)', False, 'import IECore\n'), ((215, 4, 215, 41), 'IECore.BoolParameter', 'IECore.BoolParameter', ({(215, 26, 215, 29): '"""a"""', (215, 31, 215, 33): '""""""', (215, 35, 215, 39): '(True)'}, {}), "('a', '', True)", False, 'import IECore\n'), ((223, 4, 223, 55), 'IECore.ClassParameter', 'IECore.ClassParameter', ({(223, 27, 223, 30): '"""c"""', (223, 32, 223, 34): '""""""', (223, 36, 223, 53): '"""IECORE_OP_PATHS"""'}, {}), "('c', '', 'IECORE_OP_PATHS')", False, 'import IECore\n'), ((249, 4, 249, 41), 'IECore.BoolParameter', 'IECore.BoolParameter', ({(249, 26, 249, 29): '"""a"""', (249, 31, 249, 33): '""""""', (249, 35, 249, 39): '(True)'}, {}), "('a', '', True)", False, 'import IECore\n'), ((250, 4, 250, 61), 'IECore.ClassVectorParameter', 'IECore.ClassVectorParameter', ({(250, 33, 250, 36): '"""b"""', (250, 38, 250, 40): '""""""', (250, 42, 250, 59): '"""IECORE_OP_PATHS"""'}, {}), "('b', '', 'IECORE_OP_PATHS')", False, 'import IECore\n'), ((264, 4, 264, 61), 'IECore.ClassVectorParameter', 'IECore.ClassVectorParameter', ({(264, 33, 264, 36): '"""c"""', (264, 38, 264, 40): '""""""', (264, 42, 264, 59): '"""IECORE_OP_PATHS"""'}, {}), "('c', '', 'IECORE_OP_PATHS')", False, 'import IECore\n'), ((291, 4, 291, 42), 'IECore.BoolParameter', 'IECore.BoolParameter', ({(291, 26, 291, 29): '"""a"""', (291, 31, 291, 33): '""""""', (291, 35, 291, 40): '(False)'}, {}), "('a', '', False)", False, 'import IECore\n'), ((321, 44, 321, 71), 'os.path.dirname', 'os.path.dirname', ({(321, 61, 321, 69): '__file__'}, {}), '(__file__)', False, 'import os\n'), ((331, 4, 331, 22), 'shutil.rmtree', 'shutil.rmtree', ({(331, 19, 331, 20): 'p'}, {}), '(p)', False, 'import shutil\n'), ((332, 8, 332, 27), 'os.path.isfile', 'os.path.isfile', ({(332, 24, 332, 25): 'p'}, {}), '(p)', False, 'import os\n'), ((216, 55, 216, 90), 'os.path.join', 'os.path.join', ({(216, 69, 216, 76): '"""maths"""', (216, 78, 216, 88): '"""multiply"""'}, {}), "('maths', 'multiply')", False, 'import os\n'), ((256, 14, 256, 49), 'os.path.join', 'os.path.join', ({(256, 28, 256, 35): '"""maths"""', (256, 37, 256, 47): '"""multiply"""'}, {}), "('maths', 'multiply')", False, 'import os\n'), ((333, 4, 333, 18), 'os.remove', 'os.remove', ({(333, 15, 333, 16): 'p'}, {}), '(p)', False, 'import os\n'), ((296, 45, 296, 70), 'IECore.StringVectorData', 'IECore.StringVectorData', ({}, {}), '()', False, 'import IECore\n'), ((297, 43, 297, 66), 'IECore.BoolVectorData', 'IECore.BoolVectorData', ({}, {}), '()', False, 'import IECore\n')]