Quantcast
Channel: StudioSysAdmins Message Board
Viewing all articles
Browse latest Browse all 3749

Best practices for allowing users to have custom scripts from a SysAdmin perspective?

$
0
0
Best practices for allowing users to have custom scripts from a SysAdmin perspective?
posted by Will Rosecrans on Jan. 6, 2015, 12:45 p.m. (5 days ago)
So, I have been wearing my developer hat a bit more than my admin lately, and I am writing an application that has embedded Python for scripting. And I was musing about how best to expose this feature so that users can have custom scripts. Nuke does it by looking for a file called init.py or menu.py in several locations, and running those scripts. If you want to download a cool script off a website, you need to add something in menu.py that loads the user script, and sets up menu entries for it. This is flexible, in that you can have lots of custom logic for adding menu entries, and you could tehoretically make ~/.nuke/menu.py be unwriteable by the user, preventing them from doing something stupid. OTOH, when you want to give a script to artists, they can almost never figure out what to do. On the other end of the spectrum, the way my add currently works is that it searches ~/myapp/scripts/*.py at startup and adds an entry in the scripts menu for every .py file it finds. So a user could just copy a script into the right place, and it would "just work." Less need for supporting users to help them add a script. But that doesn't let you have more complicated logic.

So, my question for the SSA hivemind, is if you could have custom user scripts work however you wanted in an app, what would you want that to look like? Are there an particular examples that you wish were more widespread?
Thread Tags:
  discuss-at-studiosysadmins 

0 Responses   0 Plus One's   0 Comments  
 
So, I have been wearing my developer hat a bit more than my admin lately, and I am writing an application that has embedded Python for scripting. And I was musing about how best to expose this feature so that users can have custom scripts. Nuke does it by looking for a file called init.py or menu.py in several locations, and running those scripts. If you want to download a cool script off a website, you need to add something in menu.py that loads the user script, and sets up menu entries for it. This is flexible, in that you can have lots of custom logic for adding menu entries, and you could tehoretically make ~/.nuke/menu.py be unwriteable by the user, preventing them from doing something stupid. OTOH, when you want to give a script to artists, they can almost never figure out what to do. On the other end of the spectrum, the way my add currently works is that it searches ~/myapp/scripts/*.py at startup and adds an entry in the scripts menu for every .py file it finds. So a user could just copy a script into the right place, and it would "just work." Less need for supporting users to help them add a script. But that doesn't let you have more complicated logic.

So, my question for the SSA hivemind, is if you could have custom user scripts work however you wanted in an app, what would you want that to look like? Are there an particular examples that you wish were more widespread?

Viewing all articles
Browse latest Browse all 3749

Trending Articles