Skip to content

Instantly share code, notes, and snippets.

@theodox
Created July 4, 2014 03:23
Show Gist options
  • Save theodox/8e489383f859697f666d to your computer and use it in GitHub Desktop.
Save theodox/8e489383f859697f666d to your computer and use it in GitHub Desktop.
import os
import shutil
import site
# source paths and local storage in environment vars
# switch toolsets by changing these before
# running maya
dist_file = os.environ['MAYA_TOOLS_SRC']
maya_tools = os.environ['MAYA_TOOLS_LCL']
last_mod_time = -1
if os.path.exists(maya_tools):
last_mod_time = os.getmtime(maya_tools)
# if the network zip is newer, download it
dist_mod_time = os.getmtime(dist_file)
if dist_mod_time > last_mod_time:
shutil.copy(dist_file, maya_tools)
# add it to the path
site.addsitedir(maya_tools)
# call the startup module from the zip, and start tools load
import ul.bootstrap as bootstrap
bootstrap.bootstrap(_globals)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment