#============================================================================== # # Project: SharpImage # Module: Save.py # Language: IronPython # Author: Dan Mueller # $Date: 2007-07-06 10:57:00 +1000 (Fri, 06 Jul 2007) $ # $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 SaveScript(ScriptObject): Name = "Save" Help = """Saves the given image or displays the open image dialog if a path is not provided.""" Parameters = """(string) Default = the absolute path and type of the image. Eg. C:/temp/test.png#F2""" ParentApplication = None Handlers = None Default = None def Run(self): """ The entry-point for this script. """ self.Initialise() if (self.Default != None and self.Default.Length > 0): self.ParentApplication.SaveImageAs( self.Default ) else: self.ParentApplication.SaveImage( ) self.Finalise()