Skip to content

Commit

Permalink
BF: Copied routines skip the builder rename routine method, so do com…
Browse files Browse the repository at this point in the history
…p updates in base routine method
  • Loading branch information
TEParsons committed Apr 27, 2022
1 parent 25fb102 commit 4592876
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 0 additions & 2 deletions psychopy/app/builder/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -1323,8 +1323,6 @@ def renameRoutine(self, name, event=None):
# Swap old with new names
self.exp.routines[oldName].name = name
self.exp.routines[name] = self.exp.routines.pop(oldName)
for comp in self.exp.routines[name]:
comp.parentName = name
self.exp.namespace.rename(oldName, name)
self.routinePanel.renameRoutinePage(currentRoutineIndex, name)
self.addToUndoStack("`RENAME Routine `%s`" % oldName)
Expand Down
3 changes: 3 additions & 0 deletions psychopy/experiment/routines/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,9 @@ def name(self):
@name.setter
def name(self, name):
self.params['name'] = name
# Update references in components
for comp in self:
comp.parentName = name

def integrityCheck(self):
"""Run tests on self and on all the Components inside"""
Expand Down

0 comments on commit 4592876

Please sign in to comment.