Rewrite generate-xcfilelists in Python