- for checkfile in potcheckfiles:
if checkfile not in checklist:
sys.stderr.write("%s not in POTFILES.in\n" % checkfile)
success = False
If you ever expected these lists to be large, set operations would likely be faster. But I don't particularly care.
Ah jeez. The whole reason I did it in python instead of shell was to speed up that part, so at least I got halfway there. How about I convert POTFILES to a set when I pass it to os.path.walk, and instead of the block above I do something like:
The internet thinks that sets are way faster for testing membership, but lists are faster for iteration. You're doing both, so who knows! Whoo!
difference = set(potcheckfiles) - checklist for missing in difference: sys.stderr.write("%s not in POTFILES.in\n" % missing) success = False
But yes, this is what I was thinking.
- Chris