def getserialnum(flist):
sn = []<EOL>for f in flist:<EOL><INDENT>tmp = search(r'<STR_LIT>', f)<EOL>if tmp:<EOL><INDENT>ser = int(tmp.group())<EOL><DEDENT>else:<EOL><INDENT>ser = None<EOL><DEDENT>sn.append(ser)<EOL><DEDENT>return sn<EOL>
This function assumes the serial number of the camera is in a particular place in the filename.
Yes, this is a little lame, but it's how the original 2011 image-writing program worked, and I've
carried over the scheme rather than appending bits to dozens of TB of files.