I am using the p4 Python module to try and open several files for edit. Basically I have a list of files that I am grabbing from a txt document. I then do some formatting to each item in the list and append those items to an empty list. My method is not the most efficient but I am just trying to get this to work before optimizing.
edit_files = []
with open('C:\\Users\\rgriffin\Desktop\\replace.txt', 'r' )as f:
for line in f:
l = line.partition(',')[0]
e = l.replace('#(', '')
r = e.replace('U:\\', '//Stream/main/')
q= r.replace('\\', '/')
edit_files.append(q)
f.close
for i in edit_files:
p4.run("edit" , i)
With this code I get an error:
[Warning]: '"//Stream/main/Data/anims/stuff/char/Emotion_Angry.hkx" - file(s) not on client.'
If I change the last line to this...
p4.run("edit" , "//Stream/main/Data/anims/stuff/char/Emotion_Angry.hkx")
The file is checked out as expected. I did a type check and i is a string.
Input data:
#("U:\Data\anims\stuff\char\Emotion_Angry_Partial.hkx", "u:\Assets\Actors\stuff\char\Animation\char_Idle.max")