Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions netpyne_ui/netpyne_geppetto.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import threading
import time
import traceback

import re

from netpyne import specs, sim, analysis
from netpyne.specs.utils import validateFunction
Expand Down Expand Up @@ -211,11 +211,12 @@ def rename(self, path, oldValue,newValue):
command = 'sim.rename('+path+',"'+oldValue+'","'+newValue+'")'
logging.debug('renaming '+command)
eval(command)

for model, synched_component in list(GeppettoJupyterGUISync.synched_models.items()):
if model != '' and oldValue in model:
if model != '' and oldValue in model and path in model: #
logging.debug("Rename funct model is " + model)
GeppettoJupyterGUISync.synched_models.pop(model)
newModel = model.replace(oldValue,newValue)
newModel = re.sub("(['])(?:(?=(\\?))\2.)*?\1", lambda x:x.group(0).replace(oldValue,newValue, 1), model)
logging.debug("Rename funct newModel is " + newModel)
GeppettoJupyterGUISync.synched_models[newModel]=synched_component

def getPlotSettings(self, plot):
Expand Down