Skip to content

Commit

Permalink
BUG: Fix slicer.util.tempDirectory not including date in folder name
Browse files Browse the repository at this point in the history
Date was not included in the folder name, even if it was requested.

git-svn-id: http://svn.slicer.org/Slicer4/trunk@28700 3bd1e089-480b-0410-8dfb-8563597acbee
  • Loading branch information
lassoan committed Dec 26, 2019
1 parent 6e48df6 commit 17d1a83
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Base/Python/slicer/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -1478,9 +1478,10 @@ def tempDirectory(key='__SlicerTemp__',tempDir=None,includeDateTime=True):
import qt, slicer
if not tempDir:
tempDir = qt.QDir(slicer.app.temporaryPath)
tempDirName = key
if includeDateTime:
key += qt.QDateTime().currentDateTime().toString("yyyy-MM-dd_hh+mm+ss.zzz")
tempDirName = key + qt.QDateTime().currentDateTime().toString("yyyy-MM-dd_hh+mm+ss.zzz")
else:
tempDirName = key
fileInfo = qt.QFileInfo(qt.QDir(tempDir), tempDirName)
dirPath = fileInfo.absoluteFilePath()
qt.QDir().mkpath(dirPath)
Expand Down

0 comments on commit 17d1a83

Please sign in to comment.