From 79996d06fb08b37b5e8163c7bcecc5bd4f1a25f3 Mon Sep 17 00:00:00 2001 From: Duduf Date: Thu, 30 Mar 2023 15:25:30 +0200 Subject: [PATCH] fixed save() --- ramses/ramses.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/ramses/ramses.py b/ramses/ramses.py index 57938e9..ced5cc4 100644 --- a/ramses/ramses.py +++ b/ramses/ramses.py @@ -563,6 +563,9 @@ def saveFile( self, filePath, incrementVersion=False, comment=None, newStateShor - 2: The file was a restored version, it's been incremented then saved as a working file. - 3: The file was misplaced (in a reserved folder), and was incremented and saved in the right place. - 4: The file was too old (according to RamSettings.autoIncrementTimeout) and was incremented and saved.""" + + from .ram_item import RamItem + from .ram_step import RamStep returnCode = 0 incrementReason = "" @@ -598,12 +601,8 @@ def saveFile( self, filePath, incrementVersion=False, comment=None, newStateShor returnCode = 4 # Get the RamItem and RamStep - if not item: - from .ram_item import RamItem - item = RamItem.fromPath( filePath ) - if not step: - from .ram_step import RamStep - step = RamStep.fromPath( filePath ) + item = RamItem.fromPath( filePath ) + step = RamStep.fromPath( filePath ) # Get the version versionInfo = RamFileManager.getLatestVersionInfo( saveFilePath ) @@ -747,7 +746,7 @@ def saveTemplate( self, fileExtension, step, templateName="Template" ): Returns an error code: - -1: One of the scripts interrupted the process - 0: Saved template""" - + from .ram_item import RamItem log("Saving as template...")