File tree Expand file tree Collapse file tree 1 file changed +18
-2
lines changed Expand file tree Collapse file tree 1 file changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -287,9 +287,22 @@ def configureWindows(iocName):
287
287
if not ignore :
288
288
fh .write (line )
289
289
290
- def patchStCmd (iocName ):
290
+ def includeMotorIocsh (iocName ):
291
291
#
292
- pass
292
+ lineSubstitutions = { '< common.iocsh\n ' : '< common.iocsh\n \n < iocsh/motors.iocsh\n ' ,
293
+ }
294
+ linesToReplace = lineSubstitutions .keys ()
295
+
296
+ for fn in os .listdir ('iocBoot/ioc{}' .format (iocName )):
297
+ if 'st.cmd' in fn :
298
+ with open ("iocBoot/ioc{}/{}" .format (iocName , fn ), 'r' ) as fh :
299
+ contents = fh .readlines ()
300
+ with open ("iocBoot/ioc{}/{}.new" .format (iocName , fn ), 'w' ) as fh :
301
+ for line in contents :
302
+ if line in linesToReplace :
303
+ fh .write (lineSubstitutions [line ])
304
+ else :
305
+ fh .write (line )
293
306
294
307
def main (options ):
295
308
print (options )
@@ -317,6 +330,9 @@ def main(options):
317
330
configureWindows (iocName )
318
331
elif (options .os == 'vxWorks' ):
319
332
configureVxWorks (iocName )
333
+
334
+ #
335
+ includeMotorIocsh (iocName )
320
336
else :
321
337
print ("{} is not an IOC dir" .format (cwd ))
322
338
You can’t perform that action at this time.
0 commit comments