Example #1
0
 private Shotgun()
 {
     lock (this) {
         if (_pythonModule == null)
         {
             // Find out where our files are
             Assembly exAssembly  = System.Reflection.Assembly.GetExecutingAssembly();
             Uri      uriCodeBase = new Uri(exAssembly.CodeBase);
             String   installBase = Path.GetDirectoryName(uriCodeBase.LocalPath.ToString());
             // Initialize IronPython
             ScriptRuntime           ipy  = Python.CreateRuntime();
             IronPython.Runtime.List path = ipy.GetSysModule().GetVariable("path");
             // Point IronPython to our files
             path.append(Path.Combine(installBase, "Python", "PythonStatic.zip"));
             _pythonModule = ipy.UseFile(Path.Combine(installBase, "Python", "shotgun_config.py"));
         }
     }
 }