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.

old.make.py 915B

1234567891011121314151617181920212223242526272829303132333435363738
  1. import chevron
  2. files={
  3. "jsync_dep" : "jsync_dep.js",
  4. "jsync_ord" : "jsync_ord.js",
  5. "jsync_ws" : "jsync_ws.js",
  6. "jsync_sto" : "jsync_sto.js",
  7. "jsync_test" : "jsync_test.js",
  8. "jsync_test2" : "jsync_test2.js",
  9. "jsync_init" : "jsync_init.js",
  10. }
  11. def wfile(file_name,out):
  12. f = open(file_name,"w")
  13. f.write(out)
  14. f.close()
  15. def rfile(file_name):
  16. f = open(file_name,"r")
  17. ftxt = f.read()
  18. f.close()
  19. return ftxt
  20. # C:\bspace\repos\jc4\ign4\indx\jsyncdb\jsync_lib_template.js
  21. def run_now():
  22. path = r"C:\bspace\repos\jc4\ign4\indx\jsyncdb" + "\\"
  23. files2 = {}
  24. for k,v in files.items():
  25. ftxt = rfile(path+v)
  26. files2[k] = ftxt
  27. template = rfile(path+"jsync_lib_template.js")
  28. out = chevron.render(template,files2)
  29. # wfile("jsync_lib_out.js",out)
  30. wfile(path+"jsync_lib.js",out)
  31. # run_now()
  32. print("This was the old file I used to render the template the new one should keep all (or) most logic in the template")