Pretty hard to follow. One thing: you might need a db.commit() after rec.update_record(raw_seq=file_raw,processed_seq=rev) since it's looping.
Can you browse your DB to see what exactly is in it? If it's SQLite, you can use a Firefox addon: https://addons.mozilla.org/en-US/firefox/addon/sqlite-manager/ Or add a print statement which will output in a console somewhere: filename = name.split('/')[-1] print filename