Advertisement
Guest User

Untitled

a guest
Jul 20th, 2019
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.88 KB | None | 0 0
  1. import os
  2. from sys import argv
  3. import shutil
  4.  
  5. ASS_FOLDER = "muxable"
  6. RELEASE_FOLDER = "release"
  7. TEMPLATE_FOLDER = "release_template"
  8. PLACEHOLDER_FILE = "Placeholder"
  9.  
  10. def create_and_populate_folders(show_path: str, next_ep: str, release_path: str, mux_path: str) -> None:
  11.     os.mkdir(os.path.join(show_path, next_ep))
  12.  
  13.     os.mkdir(mux_path)
  14.     os.mknod(os.path.join(mux_path,PLACEHOLDER_FILE))
  15.  
  16.     os.mkdir(release_path)
  17.     shutil.copy(os.path.join(show_path, TEMPLATE_FOLDER), release_path)
  18.  
  19.  
  20. def main(show_path: str) -> None:
  21.     curr_ep: int = max([int(x) for x in os.listdir(show_path) if x.isdigit()])
  22.     next_ep: str = str(curr_ep + 1).zfill(2)
  23.    
  24.     release_path: str = os.path.join(show_path, next_ep, RELEASE_FOLDER)
  25.     mux_path: str = os.path.join(show_path, next_ep, ASS_FOLDER)
  26.  
  27.     create_and_populate_folders(show_path, next_ep, release_path, mux_path)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement