AWS Thinkbox Discussion Forums

Event relative path

I have an Event script and I want to call another .py file that is in the same location as the event file being executed.

Normally I would do something like this:

from inspect import getsourcefile dir_path = (os.path.dirname(os.path.abspath(getsourcefile(lambda:0))))
or

dir_path = (os.path.dirname(os.path.abspath(__file__)))

However neither of these work. They all appear to return the Bin folder for Deadline instead of what should be returned

C:\DeadlineRepository8\custom\events\JohnsEvent

I was curious to know if there were any work around for this?

The best solution will be to use RepositoryUtils.GetRepositoryPath(“custom/events/JohnsEvent/MyScript.py”, True). This will have the added benefit of working if you’re making use of the Deadline Proxy server as that call will sync the script to the machine of HTTP and use the cache directory.

docs.thinkboxsoftware.com/produ … 2e60ca6958

Privacy | Site terms | Cookie preferences