Skip to content

Commit

Permalink
Merge f18ef95 into 5f3659c
Browse files Browse the repository at this point in the history
  • Loading branch information
hoechenberger committed Feb 14, 2015
2 parents 5f3659c + f18ef95 commit bbc09cd
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions psychopy/data.py
Expand Up @@ -305,17 +305,22 @@ def saveAsPickle(self,fileName, fileCollisionMethod='rename'):
fileCollisionMethod: Collision method passed to :func:`~psychopy.tools.fileerrortools.handleFileCollision`
"""
# Store the current state of self.savePickle for later use:
# We are going to set self.savePickle to False before saving,
# so PsychoPy won't try to save it again after loading from
# disk.
# Store the current state of self.savePickle and self.saveWideText
# for later use:
# We are going to set both to False before saving,
# so PsychoPy won't try to save again after loading the pickled
# .psydat file from disk.
#
# After saving, the initial state of self.savePickle is restored.
# After saving, the initial state of self.savePickle and
# self.saveWideText is restored.
#
# See https://groups.google.com/d/msg/psychopy-dev/Z4m_UX88q8U/UGuh1eeyjMEJ
# for details.
savePickle = self.savePickle
saveWideText = self.saveWideText

self.savePickle = False
self.saveWideText = False

#otherwise use default location
if not fileName.endswith('.psydat'):
Expand All @@ -327,6 +332,7 @@ def saveAsPickle(self,fileName, fileCollisionMethod='rename'):
f.close()
logging.info('saved data to %s' % f.name)
self.savePickle = savePickle
self.saveWideText = saveWideText

def abort(self):
"""Inform the ExperimentHandler that the run was aborted.
Expand Down

0 comments on commit bbc09cd

Please sign in to comment.