pack.py 579 B

123456789101112131415161718192021222324252627
  1. import os
  2. def listdir(path, data):
  3. for f in os.listdir(path):
  4. if path != ".":
  5. full = path + "/" + f
  6. else:
  7. full = f
  8. if os.path.isdir(full):
  9. listdir(full, data)
  10. else:
  11. ext = os.path.splitext(f)[1]
  12. if ext not in (".dll", ".py", ".icf", ".py", ".js"):
  13. data.append(full)
  14. files = []
  15. listdir(".", files)
  16. print files
  17. s = ""
  18. for f in files:
  19. s = s + " --embed " + f
  20. cmd = "file_packager.py test --js-output=data.js " + s
  21. print cmd
  22. os.system(cmd)