FYI you could have used fname.endswith('-trans.fif')