I'm searching through a list of scripts, and in each script, I'm parsing it out and among other things, finding the subscripts.
Whenever I find a subscript, I want to add it to the list of scripts I'm searching through.
I came up with this while loop:
while keep_checking == True:
TMP = deepcopy(FILE_LIST)
for fname in TMP:
if not fname in processed:
SCL_FILE = fname
break
handleSCL(SCL_FILE)
processed.add(SCL_FILE)
if processed == FILE_LIST:
keep_checking = False
break
The code above does the job, but I feel like dirty. handleSCL() is searching for the file and adding any new subscripts to FILE_LIST.
Is there a cleaner way of doing this?
deepcopyhere? How ishandleSCLupdatingFILE_LIST? Through global data? It's pretty difficult to tell what everything is doing here. I think a little more context is necessary ...