Relative Submission Script Path

Is it possible to get the path relative to the script that creates a submission window? Usually in Python, I’ll use file to get the path of the script that’s running, then use that to look up files relatively. But with Deadline, file turns out to be None. Can these kinds of relative paths be done?

Not really. We usually just go relative to the Repository root when we do this sort of thing. You can see that in the client script when we bootstrap into the primary script from the Repository.

What effect are you after? I’m guessing reading an external file or similar?

I’m making custom Draft submission windows so that they automatically include the Draft script path (as well as other added widgets). However, we’re trying to keep all our company code together in one place instead of putting our custom code in the Deadline repository. This way, we don’t have a separate place for scripts for each program – there’s just one place to go.
It just leaves room for errors when I’m switching between development environment and production environment, and I have to change the absolute path of the Draft script every time I push from development to production.
So, that’s the situation I’m in.

Agreed that’s the best way to go. Looking at things, you might need to use an environment variable like everyone else does (looking at you chaos group!). That’s usually how I separate production from dev. The only problem being it’s a massive pain to do rollouts if the artist machines aren’t set up with some deployment tool yet.

Easiest way on Windows is a *.reg file if you’re willing to go the env variable route. I can look up the keys to set. If it’s on Mac, that situation is nightmarish.

I’ll ask the guys if they have any ideas too. Usually if it’s python, PYTHON_PATH is your friend.

Thank you for the reply. I’ll look into your suggestions