@@ -213,7 +213,22 @@ def processjobs(jobs):
213213 flags = list (set (execdata ["requiredfiles" ]) - set (foundflags ))
214214
215215 # If there are any missing still then tell the user.
216- if len (flags ) is not 0 :
216+ if len (flags ) > 0 :
217+
218+ # Firstly is this due to it being an either type flag?
219+ for flag in flags :
220+
221+ if "||" in flag :
222+
223+ tmpflags = flag .split (" || " )
224+ tmpflag = list (set (tmpflags ).intersection (set (foundflags )))
225+
226+ if len (tmpflag ) > 0 :
227+
228+ flags .remove (flag )
229+
230+ # If there are any missing still then tell the user.
231+ if len (flags ) > 0 :
217232
218233 raise exceptions .RequiredinputError (
219234 "In job '{0}' there are missing flags on the command line "
@@ -239,16 +254,8 @@ def processjobs(jobs):
239254 LOG .info ("For job '%s' - execution string: %s" ,
240255 job , jobs [job ]["executableargs" ])
241256
242- print "filelist = " , filelist
243- print "includes = " , jobs [job ]["upload-include" ]
244- print "excludes = " , jobs [job ]["upload-exclude" ]
245- print "execargs = " , jobs [job ]["executableargs" ]
246-
247257 LOG .info ("Processing jobs - complete." )
248258
249- import sys
250- sys .exit ()
251-
252259
253260def _proccommandlinetype1 (job , app , cwd , filelist ):
254261
@@ -290,9 +297,11 @@ def _proccommandlinetype1(job, app, cwd, filelist):
290297 # We have a replicate job so we should amend the paths.
291298 else :
292299
293- fileitem , filelist = _procreplicatejobs (
300+ fileitem , filelist , initargs = _procreplicatejobs (
294301 app , args [1 ], cwd , fileitem , filelist , initargs , rep )
295302
303+ job ["executableargs" ] = initargs
304+
296305 # If the next argument along is a valid file.
297306 if os .path .isfile (os .path .join (cwd , fileitem )):
298307
@@ -371,9 +380,11 @@ def _proccommandlinetype2(job, app, cwd, filelist):
371380 # Otherwise we have a replicate job so check these.
372381 else :
373382
374- fileitem , filelist = _procreplicatejobs (
383+ fileitem , filelist , initargs = _procreplicatejobs (
375384 app , arg , cwd , fileitem , filelist , initargs , rep )
376385
386+ job ["executableargs" ] = initargs
387+
377388 # If we have a valid file
378389 if os .path .isfile (os .path .join (cwd , fileitem )):
379390
@@ -440,9 +451,11 @@ def _proccommandlinetype3(job, app, cwd, filelist):
440451 # Otherwise we have a replicate job so check these.
441452 else :
442453
443- fileitem , filelist = _procreplicatejobs (
454+ fileitem , filelist , initargs = _procreplicatejobs (
444455 app , arg , cwd , fileitem , filelist , initargs , rep )
445456
457+ job ["executableargs" ] = initargs
458+
446459 # If we have a valid file
447460 if os .path .isfile (os .path .join (cwd , fileitem )):
448461
@@ -500,9 +513,11 @@ def _proccommandlinetype4(job, app, cwd, filelist):
500513 # Otherwise we have a replicate job so we should amend the paths.
501514 else :
502515
503- fileitem , filelist = _procreplicatejobs (
516+ fileitem , filelist , initargs = _procreplicatejobs (
504517 app , args [0 ], cwd , fileitem , filelist , initargs , rep )
505518
519+ job ["executableargs" ] = initargs
520+
506521 # If we have something to load then check that it is a valid file.
507522 if os .path .isfile (os .path .join (cwd , fileitem )):
508523
@@ -551,7 +566,8 @@ def _procsinglejob(app, arg, cwd):
551566
552567 try :
553568
554- fileitem = getattr (apps , app .lower ()).defaultfilename (cwd , arg )
569+ fileitem , _ = getattr (
570+ apps , app .lower ()).defaultfilename (cwd , arg , "" )
555571
556572 except AttributeError :
557573
@@ -600,8 +616,8 @@ def _procreplicatejobs(app, arg, cwd, fileitem, filelist, initargs, rep):
600616
601617 try :
602618
603- tmpitem = getattr (apps , app .lower ()).defaultfilename (
604- cwd , os .path .join ("rep" + str (rep ) + arg ))
619+ tmpitem , _ = getattr (apps , app .lower ()).defaultfilename (
620+ cwd , os .path .join ("rep" + str (rep ) + arg ), "" )
605621
606622 except AttributeError :
607623
@@ -617,15 +633,11 @@ def _procreplicatejobs(app, arg, cwd, fileitem, filelist, initargs, rep):
617633
618634 try :
619635
620- fileitem = getattr (apps , app .lower ()).defaultfilename (cwd , arg )
621-
622- # Also update the command line to reflect a global file.
623- if fileitem is not "" and arg in initargs :
624-
625- initargs [initargs .index (arg )] = os .path .join ("../" , arg )
636+ fileitem , initargs = getattr (
637+ apps , app .lower ()).defaultfilename (cwd , arg , initargs )
626638
627639 except AttributeError :
628640
629641 pass
630642
631- return fileitem , filelist
643+ return fileitem , filelist , initargs
0 commit comments