Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import os
- from sys import argv
- import shutil
- ASS_FOLDER = "muxable"
- RELEASE_FOLDER = "release"
- TEMPLATE_FOLDER = "release_template"
- PLACEHOLDER_FILE = "Placeholder"
- def create_and_populate_folders(show_path: str, next_ep: str, release_path: str, mux_path: str) -> None:
- os.mkdir(os.path.join(show_path, next_ep))
- os.mkdir(mux_path)
- os.mknod(os.path.join(mux_path,PLACEHOLDER_FILE))
- os.mkdir(release_path)
- shutil.copy(os.path.join(show_path, TEMPLATE_FOLDER), release_path)
- def main(show_path: str) -> None:
- curr_ep: int = max([int(x) for x in os.listdir(show_path) if x.isdigit()])
- next_ep: str = str(curr_ep + 1).zfill(2)
- release_path: str = os.path.join(show_path, next_ep, RELEASE_FOLDER)
- mux_path: str = os.path.join(show_path, next_ep, ASS_FOLDER)
- create_and_populate_folders(show_path, next_ep, release_path, mux_path)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement