Hi im trying to create a trigger for the event daemon to create the folder structure in a local storage when a new project is created, but sometime my code works and sometimes it doesn’t.
Is there something i’m missisng?
This is my code:
import os
import logging
def registerCallbacks(reg):
eventFilter = {‘Shotgun_Project_New’: [’*’]}
reg.registerCallback(
“My script Name”,
“My script key”,
CreateFolders,
eventFilter,
None,)
def CreateFolders(sg, logger, event, args):
project = event.get(“project”)
path = “My local storage”
os.chdir(path)
os.mkdir(project)
os.chdir(path)
os.mkdir(project)
os.chdir(path + “/” + project)
os.mkdir(“For_CGI”)
os.mkdir(“production_info”)
os.mkdir(“work”)