10 """ return a list of all files found from rootPath
11 the resulting file pathes are relative to rootPath
14 for root, dirs, files
in os.walk(rootPath):
15 for filename
in files:
16 fullpath = os.path.join(root, filename)
17 result.append(os.path.relpath(fullpath, rootPath))
22 """ Entry point of the box library converter
25 if len(sys.argv)
not in range(2, 4):
26 sys.stderr.write(
"Incorrect number of arguments" + os.linesep)
28 param.append(sys.argv[1])
29 if (len(sys.argv) == 3):
30 param.append(sys.argv[2])
32 param.append(
"objects")
34 abspath = os.path.abspath(param[0])
35 dest_dir = os.path.abspath(param[1])
39 filepath, filename = os.path.split(file)
40 if(filename
in [
"box.xar",
"behavior.xar"]):
41 print(
"converting " + str(file) +
":\n")
43 fullinputpath = os.path.join(abspath, file)
44 fulloutputpath = os.path.join(dest_dir, filepath)
46 folders = filepath.split(os.sep)
47 xar_converter.convert_boxlibrary(fullinputpath,
49 folders[len(folders) - 1])
50 except BaseException
as error:
51 print(
"Could not convert: " + str(error))
54 if __name__ ==
"__main__":