Skip to content

Commit bcb4a8d

Browse files
authored
Merge pull request #77 from MetaCell/renaming_and_deleting_component
Renaming and deleting component
2 parents 69f1d14 + a95e23c commit bcb4a8d

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

.travis.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ node_js:
88
env:
99
global:
1010
secure: dn0FPQ5IG4M/3kdwnyI78ElQ308Vc3QnKAvkWfwMFb8QxDqxQdnTo7AV1qTMtbLrDNkeEWIgi4nc7jmXNtvGTwOfhAULVh6606Qs5B+ezTdwzajbbFMI8SKQx/pnTojOMu8dx7V4lMoR/YWcojR0VC1IWVC62TGbSB1k5BDGgH0=
11+
before_install:
12+
- sudo apt-get install -y xserver-xorg-dev libxext-dev libxi-dev
1113
install:
1214
- git clone --quiet https://github.com/MetaCell/geppetto-netpyne.git
1315
- cd geppetto-netpyne

netpyne_ui/netpyne_geppetto.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
import threading
1313
import time
1414
import traceback
15-
15+
import re
1616

1717
from netpyne import specs, sim, analysis
1818
from netpyne.specs.utils import validateFunction
@@ -211,11 +211,11 @@ def rename(self, path, oldValue,newValue):
211211
command = 'sim.rename('+path+',"'+oldValue+'","'+newValue+'")'
212212
logging.debug('renaming '+command)
213213
eval(command)
214-
215214
for model, synched_component in list(GeppettoJupyterGUISync.synched_models.items()):
216-
if model != '' and oldValue in model:
215+
if model != '' and oldValue in model and path in model: #
217216
GeppettoJupyterGUISync.synched_models.pop(model)
218-
newModel = model.replace(oldValue,newValue)
217+
newModel = re.sub("(['])(?:(?=(\\?))\2.)*?\1", lambda x:x.group(0).replace(oldValue,newValue, 1), model)
218+
logging.debug("Rename funct - Model is "+model+" newModel is "+newModel)
219219
GeppettoJupyterGUISync.synched_models[newModel]=synched_component
220220

221221
def getPlotSettings(self, plot):

0 commit comments

Comments
 (0)