"""We need to touch 1 file from each of 30 pk4s. Find the first file in each of the pk4s.""" PK4LIST = [ "tdm_ai_humanoid_builders01.pk4", "tdm_ai_humanoid_guards01.pk4", "tdm_gui01.pk4", "tdm_models01.pk4", "tdm_models02.pk4", "tdm_models_decls01.pk4", "tdm_prefabs01.pk4", "tdm_sound_ambient01.pk4", "tdm_sound_ambient02.pk4", "tdm_sound_sfx01.pk4", "tdm_sound_vocals02.pk4", "tdm_sound_vocals03.pk4", "tdm_sound_vocals04.pk4", "tdm_sound_vocals06.pk4", "tdm_sound_vocals07.pk4", "tdm_textures_base01.pk4", "tdm_textures_carpet01.pk4", "tdm_textures_decals01.pk4", "tdm_textures_door01.pk4", "tdm_textures_glass01.pk4", "tdm_textures_metal01.pk4", "tdm_textures_nature01.pk4", "tdm_textures_plaster01.pk4", "tdm_textures_stone_brick01.pk4", "tdm_textures_stone_cobblestones01.pk4", "tdm_textures_stone_flat01.pk4", "tdm_textures_stone_natural01.pk4", "tdm_textures_stone_sculpted01.pk4", "tdm_textures_window01.pk4", "tdm_textures_wood01.pk4" ] # The folder where we'll look in pk4s to find a file to touch TDM_RELEASE_DIR = r"C:\darkmod" # The SVN folder where we'll touch the files TDM_SVN_DIR = r"E:\dm-dev\darkmod" import os, zipfile for pk4 in PK4LIST: fname = os.path.join(TDM_RELEASE_DIR, pk4) f = zipfile.ZipFile(fname) firstfile = f.infolist()[0].filename.replace('/', '\\') touchfile = os.path.join(TDM_SVN_DIR, firstfile) # print touchfile # List of files for touching # print pk4, ' --> ', firstfile # List of pk4s and files for tracker issue # generate batch commands for windows touches. Need to switch to E:\ first dir, fil = os.path.split(touchfile) print 'cd', dir print 'copy "' + touchfile + '" /B +,,'