Skip to content
This repository has been archived by the owner on Oct 10, 2024. It is now read-only.

Commit

Permalink
fixed save()
Browse files Browse the repository at this point in the history
  • Loading branch information
Nico-Duduf committed Mar 30, 2023
1 parent 20ac7f7 commit 79996d0
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions ramses/ramses.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = ""
Expand Down Expand Up @@ -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 )
Expand Down Expand Up @@ -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...")
Expand Down

0 comments on commit 79996d0

Please sign in to comment.