#============================================================================== # # Project: SharpImage # Module: Rename.py # Language: IronPython # Author: Dan Mueller # Date: $Date: 2007-07-06 10:57:00 +1000 (Fri, 06 Jul 2007) $ # Revision: $Revision: 2 $ # # Copyright (c) Queensland University of Technology (QUT) 2007. # All rights reserved. # # This software is distributed WITHOUT ANY WARRANTY; without even # the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR # PURPOSE. See the above copyright notices for more information. # #============================================================================== # Import the base script class import Script from Script import * class RenameScript(ScriptObject): Name = "Rename" Help = """Sets the Image.Name property to the given value.""" Parameters = """(string) Default = the new value for the Image.Name property.""" ParentApplication = None Handlers = None Default = "New" def Run(self): """ The entry-point for this script. """ self.Initialise() self.Input = self.ParentApplication.CurrentRenderer.Inputs[0] self.Input.Name = self.Default self.ParentApplication.CurrentRenderer.Form.Refresh() self.Finalise()