You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

34 line
804 B

  1. # make public folders
  2. from __future__ import unicode_literals
  3. import os
  4. def make():
  5. """make public folder symlinks if missing"""
  6. dirs = ["public", "public/js", "public/css", "public/files", "public/backups"]
  7. for dirname in dirs:
  8. if not os.path.exists(dirname):
  9. os.mkdir(dirname)
  10. os.chdir("public")
  11. symlinks = [
  12. ["app", "../app/public"],
  13. ["lib", "../lib/public"],
  14. ["web.py", "../lib/public/html/web.py"],
  15. ["server.py", "../lib/public/html/server.py"],
  16. ["blank.html", "../lib/public/html/blank.html"],
  17. ["unsupported.html", "../lib/public/html/unsupported.html"],
  18. ["sitemap.xml", "../lib/public/html/sitemap.xml"],
  19. ["rss.xml", "../lib/public/html/rss.xml"],
  20. ]
  21. for link in symlinks:
  22. if not os.path.exists(link[0]):
  23. os.symlink(link[1], link[0])
  24. os.chdir("..")